A minimal, elegant web app to encrypt and decrypt English messages using a custom reversible cipher.
- Frontend: HTML, CSS, JavaScript (Fetch API)
- Backend: Python (Flask)
- Storage: None (stateless)
Encryption steps:
- Replace vowels: a→@, e→3, i→!, o→0, u→∪ (case-insensitive)
- Reverse every 3rd word (per line)
- Shift code points by +3 (keeps newlines)
- Insert a single random salt symbol between words: " space space "
Decryption reverses the above in reverse order.
Notes:
- Multiple spaces are normalized to single spaces during encryption.
- Newlines are preserved; salts are inserted only within each line.
- Create a virtual environment and install dependencies:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt- Start the Flask server:
python -m app.app- Open the app: http://127.0.0.1:5000/
app/– Flask app and cipher logicapp.py– Flask routes (UI + APIs)cipher.py– Encryption/decryption logic
templates/index.html– UIstatic/css/styles.css– Stylesstatic/js/app.js– Frontend logic
POST /api/encrypt– body:{ "text": "..." }→{ "encrypted": "..." }POST /api/decrypt– body:{ "text": "..." }→{ "decrypted": "..." }
MIT