A comprehensive implementation of fundamental cryptography algorithms for academic purposes. This project provides educational implementations of classical and modern cryptographic techniques with interactive demonstrations and analysis tools.
- ✅ Caesar Cipher - Substitution cipher with configurable shift
- ✅ Vigenère Cipher - Polyalphabetic cipher with keyword encryption
- ✅ Cryptanalysis Tools - Frequency analysis and cipher breaking
- ✅ RSA Algorithm - Public-key cryptosystem with key generation
- ✅ AES Encryption - Advanced Encryption Standard (CBC/GCM modes)
- ✅ Diffie-Hellman - Secure key exchange protocol
- ✅ Hash Functions - MD5, SHA-1, SHA-256, SHA-512, HMAC
- ✅ Password Analysis - Strength evaluation and crack time estimation
- ✅ Cryptanalysis - Breaking techniques and vulnerability assessment
- ✅ Interactive GUI - User-friendly testing interface
python gui.pyInteractive graphical interface with tabs for each algorithm.
python demo.pyAutomated demonstration of all algorithms.
python main.pyMenu-driven console interface.
python tests/test_algorithms.pyComprehensive test suite validation.
TP algo/
├── src/ # Core algorithm implementations
│ ├── caesar_cipher.py # Caesar cipher with cryptanalysis
│ ├── vigenere_cipher.py # Vigenère cipher implementation
│ ├── rsa_algorithm.py # RSA public-key cryptography
│ ├── diffie_hellman.py # Diffie-Hellman key exchange
│ ├── aes_algorithm.py # AES symmetric encryption
│ ├── hash_functions.py # Hash algorithms and HMAC
│ └── cryptanalysis.py # Cryptanalysis and security tools
├── tests/ # Test suite
│ └── test_algorithms.py # Comprehensive unit tests
├── gui.py # Interactive GUI interface
├── demo.py # Quick demonstration script
├── main.py # Console interface
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.8+
- cryptography library (for AES implementation)
pip install -r requirements.txtfrom src.caesar_cipher import CaesarCipher
cipher = CaesarCipher(shift=3)
encrypted = cipher.encrypt("Hello World")
decrypted = cipher.decrypt(encrypted)from src.rsa_algorithm import RSA
rsa = RSA(key_size=1024)
public_key, private_key = rsa.generate_keypair()
encrypted = rsa.encrypt_string("Secret message")
decrypted = rsa.decrypt_string(encrypted)from src.cryptanalysis import PasswordAnalyzer
analyzer = PasswordAnalyzer()
analysis = analyzer.analyze_password_strength("MyPassword123!")
print(f"Score: {analysis['score']}/100")The project includes comprehensive unit tests covering:
- Algorithm correctness
- Edge cases and error handling
- Performance benchmarks
- Security validation
Run the test suite:
python tests/test_algorithms.py| Algorithm | Operation | Time (10KB) |
|---|---|---|
| Caesar Cipher | Encrypt/Decrypt | ~0.007s |
| Vigenère Cipher | Encrypt/Decrypt | ~0.010s |
| Hash SHA-256 | 1MB data | ~0.005s |
| RSA 1024-bit | Key Generation | ~0.500s |
This implementation demonstrates:
- Classical vs Modern cryptography evolution
- Symmetric vs Asymmetric encryption principles
- Cryptanalysis techniques and vulnerability assessment
- Security best practices in implementation
- Real-world applications of cryptographic algorithms
This implementation is for educational purposes only. Some algorithms (like MD5) are included for historical learning but should not be used in production environments due to known vulnerabilities.
This is an academic project. Contributions should focus on:
- Educational clarity
- Algorithm correctness
- Documentation improvements
- Test coverage enhancement
Educational use only. See individual algorithm implementations for specific notes and references.
Cryptography TP Implementation - Academic Project