A modern, cross-platform GUI application for encrypting and decrypting messages using various cryptographic ciphers. Features a responsive design that works seamlessly across Windows, macOS, and Linux.
- 🔒 Caesar Cipher: A substitution cipher that shifts letters by a fixed number of positions
- 🔑 Vigenère Cipher: A polyalphabetic substitution cipher using a keyword
- 🧮 Affine Cipher: A monoalphabetic substitution cipher with a mathematical function
- 📐 Hill Cipher: A polygraphic substitution cipher based on linear algebra
- 🔄 Substitution Cipher: A cipher that replaces each letter with a unique substitution
- 🎲 One-Time Pad (OTP): A symmetric encryption algorithm using a random key
- Modern GUI: Beautiful, dark-themed interface using CustomTkinter
- Cross-platform compatibility: Works seamlessly on Windows, macOS, and Linux
- Enhanced security: Removed dangerous
eval()calls with safe parsing functions - Better error handling: Comprehensive input validation and user-friendly error messages
- Responsive design: Adaptive window sizing and layout
- Multi-line text support: Text areas for longer messages
- Keyboard shortcuts: Ctrl+Enter to perform actions, Ctrl+C to copy results
- Copy to clipboard: Easy result copying functionality
- Real-time help: Dynamic key format hints based on selected cipher
- Status feedback: Real-time status updates and operation feedback
- Python 3.8 or higher
- Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+, etc.)
Windows:
# Double-click run.bat or run in Command Prompt:
run.batLinux/macOS:
# Make the script executable and run:
chmod +x run.sh
./run.sh-
Clone the repository:
git clone https://github.com/AlexBesios/CyberSecurityProject.git cd CyberSecurityProject -
Create and activate virtual environment:
Windows:
python -m venv venv venv\Scripts\activate
Linux/macOS:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python App.py
- Launch the application using one of the methods above
- Select a cipher from the dropdown menu
- Choose the action (Encrypt or Decrypt)
- Enter your message in the text area
- Enter the key according to the format hint shown
- Click "Perform" or press Ctrl+Enter
- Copy the result using the copy button or Ctrl+C
| Cipher | Key Format | Example |
|---|---|---|
| Caesar | Integer | 3 |
| Vigenère | Keyword (letters only) | KEY |
| Affine | Two integers separated by comma | 5,8 |
| Hill | Square matrix in JSON format | [[3, 2], [5, 7]] |
| Substitution | Dictionary mapping | {'a': 'm', 'b': 'n', 'c': 'o'} |
| OTP | String (≥ message length) | MYSECRETKEY |
- Message:
Hello World! - Key:
3 - Action: Encrypt
- Result:
Khoor Zruog!
- Message:
ATTACK AT DAWN - Key:
LEMON - Action: Encrypt
- Result:
LXFOPV EF RNHR
- Message:
HELLO - Key:
[[3, 2], [5, 7]] - Action: Encrypt
- Result:
dldck
- ✅ Removed dangerous
eval()calls - ✅ Implemented safe JSON parsing for complex keys
- ✅ Added comprehensive input validation
- ✅ Enhanced error handling with specific error messages
- ✅ Added type hints throughout the codebase
- ✅ Improved code structure and modularity
- ✅ Comprehensive documentation and comments
- ✅ Added unit tests for all cipher functions
- ✅ Modern, intuitive interface design
- ✅ Cross-platform compatibility
- ✅ Responsive layout that adapts to screen size
- ✅ Real-time help and feedback
- ✅ Keyboard shortcuts for power users
Run the test suite to verify all cipher implementations:
python test_ciphers.pyCyberSecurityProject/
├── App.py # Main GUI application
├── Ciphers.py # Cipher implementations
├── requirements.txt # Python dependencies
├── test_ciphers.py # Test suite
├── run.bat # Windows launcher
├── run.sh # Linux/macOS launcher
└── README.md # This file
- customtkinter: Modern GUI framework
- numpy: Numerical operations for Hill cipher
- Pillow: Image processing support
- ttkthemes: Additional theme support
-
"Module not found" errors
- Ensure virtual environment is activated
- Run
pip install -r requirements.txt
-
GUI doesn't appear on Linux
- Install tkinter:
sudo apt-get install python3-tk - Ensure X11 forwarding if using SSH
- Install tkinter:
-
Font rendering issues on Linux
- Install DejaVu fonts:
sudo apt-get install fonts-dejavu
- Install DejaVu fonts:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests for new features
- Run the test suite:
python test_ciphers.py - Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Create a Pull Request
This project is open source and available under the MIT License.
- PhyniX - Initial development
- AlexBesios - Enhancements and modernization
- Thanks to the cryptography community for cipher algorithms
- CustomTkinter team for the modern GUI framework
- NumPy developers for numerical computation support
Made with ❤️ by PhyniX and AlexBesios