A comprehensive collection of cryptographic algorithms implemented in Python, featuring both encryption and decryption capabilities with file-based input/output and visualization.
- Overview
- Algorithms Implemented
- Features
- Project Structure
- Installation
- Usage
- Algorithms Description
- License
This repository contains implementations of various classical and modern cryptographic algorithms. Each implementation includes proper visualization and demonstrates encryption/decryption processes through file-based operations, making it easy to understand how these algorithms work in practice.
-
CryptoBasics - Classical Cryptography
- 1.1. Caesar Cipher
- 1.2. Mono Alphabetic Substitution Cipher
- 1.3. Columnar Transposition Cipher
-
DES - Data Encryption Standard
-
Triple DES - Triple Data Encryption Standard
-
AES - Advanced Encryption Standard
-
RSA - Rivest–Shamir–Adleman Public-Key Cryptosystem
-
Diffie-Hellman Algorithm - Key Exchange Protocol
-
Man in the Middle Attack - Demonstration on Diffie-Hellman Key Exchange
- ✅ File-based I/O: Read plaintext from input files and write ciphertext to output files
- ✅ Encryption & Decryption: Complete implementation of both processes
- ✅ Visualization: Clear demonstration of cryptographic processes
- ✅ Educational: Well-structured code suitable for learning purposes
- ✅ Multiple Algorithms: Classical to modern cryptographic techniques
Security and Privacy Sessional/
│
├── CryptoBasics/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ └── ciphertext.txt
│
├── DES Data Encryption Standard/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ └── ciphertext.txt
│
├── Triple DES/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ └── ciphertext.txt
│
├── AES Advanced Encryption Standard/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ ├── ciphertext.txt
│ └── aes_debug_log.txt
│
├── RSA/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ └── ciphertext.txt
│
├── Diffie Hellman Algorithm/
│ ├── encription_main.py
│ ├── plaintext_sender.txt
│ ├── plaintext_receiver.txt
│ └── ciphertext.txt
│
└── Man in the Middle Attack/
├── encription_main.py
├── Alice_Inbox.txt
├── Bob_Inbox.txt
├── Darth_Receiving.txt
└── Darth_Sending.txt
- Python 3.x
- Required Python packages (install using pip):
pip install pycryptodomegit clone https://github.com/yourusername/cryptography-algorithms.git
cd cryptography-algorithmsEach algorithm is contained in its own directory with a main Python file (encription_main.py) and associated text files for input/output.
- Navigate to the desired algorithm directory
- Edit the
plaintext_sender.txtfile with your message - Run the encryption/decryption script:
python encription_main.py- View the results in the output files
cd "CryptoBasics"
python encription_main.pyThe program will:
- Read plaintext from
plaintext_sender.txt - Encrypt the message
- Write ciphertext to
ciphertext.txt - Decrypt the ciphertext
- Write decrypted text to
plaintext_receiver.txt
Classical Cryptography Techniques:
- Caesar Cipher: Substitution cipher that shifts letters by a fixed number
- Mono Alphabetic Substitution: Each letter is replaced by another letter according to a key
- Columnar Transposition: Characters are rearranged based on a columnar pattern
A symmetric-key algorithm that uses a 56-bit key to encrypt 64-bit blocks of data through 16 rounds of permutation and substitution.
An enhancement of DES that applies the DES cipher algorithm three times to each data block, providing stronger encryption.
Modern symmetric encryption standard using key sizes of 128, 192, or 256 bits. Considered highly secure and widely used today.
An asymmetric cryptographic algorithm using public and private keys. Based on the mathematical difficulty of factoring large prime numbers.
A key exchange protocol that allows two parties to establish a shared secret key over an insecure channel.
A demonstration of security vulnerabilities in the Diffie-Hellman key exchange, showing how an attacker (Darth) can intercept communications between Alice and Bob.
This project is open-source and available for educational purposes.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
For questions or suggestions, please open an issue in this repository.