A comprehensive encryption/decryption tool that combines multiple cipher algorithms for enhanced security:
- Affine Cipher
- Vigenere Cipher
- Transposition Cipher
- XOR-based Stream Cipher
- Dual Interface:
- Interactive Terminal Menu
- Modern Web Interface
- Input Validation:
- Real-time validation for all inputs
- Clear error messages
- Helpful guidance for valid values
- Multiple Cipher Layers:
- Affine Cipher with coprime key validation
- Vigenere Cipher with alphabetic key
- Transposition Cipher using Vigenere key length
- XOR-based Stream Cipher for additional security
- Python 3.7 or higher
- pip (Python package installer)
- Terminal/Command Prompt
- Web browser (for web interface)
- Clone or download this repository:
git clone <repository-url>
cd ultimate-cipher- Create a virtual environment:
For Windows:
# Create virtual environment
python -m venv venv
# Activate virtual environment
.\venv\Scripts\activate
# If you encounter execution policy error, run PowerShell as Administrator and execute:
Set-ExecutionPolicy RemoteSignedFor macOS/Linux:
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate- Install required packages:
pip install -r requirements.txt-
Activate the virtual environment (if not already activated):
- Windows:
.\venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Run the terminal interface:
python menu_cli.py- Follow the interactive menu:
- Choose operation (Encrypt/Decrypt)
- Enter text to process
- Provide encryption/decryption keys:
- Affine key 'a' (must be coprime with 26)
- Affine key 'b' (0-25)
- Vigenere key (alphabetic characters only)
- XOR key (any text)
-
Activate the virtual environment (if not already activated)
-
Run the Flask application:
python app.py- Open your web browser and navigate to:
http://localhost:5000
- Use the web form to:
- Enter text to process
- Select operation (Encrypt/Decrypt)
- Provide required keys
- View results with original and processed text
- Key 'a': Must be coprime with 26
- Valid values: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25
- Key 'b': Any number between 0 and 25
- Key must contain only alphabetic characters (A-Z, a-z)
- Case insensitive
- No spaces or special characters allowed
- Any text can be used as key
- Longer keys provide better encryption
# Start the terminal interface
python menu_cli.py
# Example inputs:
Text: Hello World
Affine key 'a': 5
Affine key 'b': 8
Vigenere key: SECRET
XOR key: MyXORKey- Start the web server:
python app.py- Fill in the web form with the same example values as above
- Click "Process" to see the results
- This is a demonstration tool and should not be used for sensitive data
- The web interface uses a default secret key - change it in production
- Keys should be kept secure and not shared
- Longer keys generally provide better security
-
If you see "Permission denied" when activating venv:
- Run PowerShell as Administrator
- Execute:
Set-ExecutionPolicy RemoteSigned
-
If Flask shows "No module named 'flask'":
- Ensure virtual environment is activated
- Run:
pip install -r requirements.txt
-
If web interface shows CSRF error:
- Clear browser cache
- Restart Flask application
MIT License - Feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit a Pull Request.