A simple and educational Python implementation of the Caesar Cipher encryption algorithm. This project demonstrates left and right shifting encryption and decryption using basic character manipulation and modular arithmetic.
It is created as a learning and academic project to understand how classical cryptography works internally, not as a production-ready security system.
caesar-cipher-python/
โ
โโโ assets/ # Screenshots
โโโ app.py # Basic CLI version
โโโ interactive.py # Rich-powered CLI
โโโ requirements.txt # Dependencies
โโโ LICENSE
โโโ README.md- User can choose:
Lโ Left ShiftRโ Right Shift
- Demonstrates both encryption directions for learning clarity
- Encrypts alphabetic characters using a shift key
- Preserves uppercase and lowercase letters
- Keeps spaces and special characters unchanged
- Automatically decrypts using the opposite shift direction
- Verifies correctness of the algorithm
- Clean and readable logic
- Uses modular arithmetic (
% 26) - Ideal for beginners in cryptography
- No external dependencies
- Beautiful colored terminal UI using Rich
- Structured panels for output display
- Interactive prompts with validation
- Enhanced user experience compared to standard CLI
- ๐งผ Basic CLI โ Lightweight, no dependencies
- ๐จ Rich CLI โ Enhanced UI with colors and panels
| Technology | Role |
|---|---|
| Python 3 | Core programming language |
| ord() / chr() | Character-to-ASCII conversion |
| Modular Arithmetic | Circular alphabet shifting |
| Rich | Styled CLI, colors, panels |
This project is built to:
- Understand classical cryptography
- Learn Caesar Cipher encryption & decryption
- Practice modular arithmetic concepts
- Visualize left vs right shifting
- Strengthen Python string manipulation skills
โ ๏ธ This project is intended strictly for learning and demonstration purposes.
git clone https://github.com/ShakalBhau0001/caesar-cipher-python.gitcd caesar-cipher-pythonpip install richOR
pip install -r requirements.txtpython app.pypython interactive.py- Enter a message
- Enter a shift key (integer)
- Choose direction:
Lfor Left ShiftRfor Right Shift
- View encrypted and decrypted output
Enter message: HELLO
Enter shift key: 3
Choose direction (L = Left, R = Right): R
Encrypted Message: KHOOR
Decrypted Message: HELLO- Not secure for real-world use
- Classical cipher (easily breakable)
- No brute-force protection
- CLI-based interaction only
- Add brute-force mode
- Add English frequency scoring
- Add input validation for shift values
- Add file encryption support
- Create GUI version
This implementation is created for educational and learning purposes only. The Caesar Cipher is a historically important but insecure encryption method and must not be used to protect real-world sensitive data.
Developer: Shakal Bhau
GitHub: ShakalBhau0001
If you like this project, consider giving it a โญ on GitHub!
