A modern web application for encrypting and decrypting text using the Hill Cipher algorithm. This tool provides an intuitive interface for matrix-based cryptography operations.
- Text to number conversion using A=0, B=1, ..., Z=25 mapping
- Support for variable size key matrices (2x2 to 5x5)
- Automatic padding with 'X' for incomplete blocks
- Real-time matrix validation
- Modular arithmetic operations (mod 26)
- Visual feedback for successful encryption
- Support for decrypting Hill Cipher encrypted text
- Automatic matrix inverse calculation
- Matrix invertibility checking
- Error handling for non-invertible matrices
- Input validation for matrix dimensions
- Clear visual feedback for results
-
Enter your plaintext (only letters A-Z are accepted)
-
Select matrix size (2-6)
-
Enter your key matrix values row by row
-
Click "Encrypt" to get your ciphertext
- Enter the ciphertext
- Select the same matrix size used for encryption
- Enter the same key matrix used for encryption
- Click "Decrypt" to recover the plaintext
- Clone the repository:
git clone https://github.com/yourusername/hill-cipher-app.git
cd hill-cipher-app
- Run the application:
python app.py
- Open your browser and navigate to:
http://localhost:5000
- Python 3.x
- Flask
- NumPy
- The application uses NumPy for efficient matrix operations
- Modular arithmetic is implemented for all operations (mod 26)
- Matrix invertibility is checked before processing
- Determinant calculations are performed with proper modular arithmetic
- Invalid matrix dimensions
- Non-invertible matrices
- Invalid input characters
- Matrix parsing errors
- Server communication errors
Feel free to submit issues and enhancement requests!