A simple yet secure web application built using Flask and Fernet encryption from the cryptography library. Users can enter text to encrypt or decrypt messages in a clean and minimal UI. This project is ideal for anyone learning about web security and Python-based cryptography.
📘 Read the Build Journey on My Blog
- Python 3.x
- Flask
- Cryptography (Fernet)
- python-dotenv
- HTML/CSS (Jinja2)
- Render for deployment
git clone https://github.com/your-username/encryption-tool.git
cd encryption-toolpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in your project root directory with the following content:
SECRET_KEY=your_fernet_generated_key_here
FLASK_SECRET_KEY=your_flask_secret_key_hereTo generate keys:
Fernet key:
from cryptography.fernet import Fernet
print(Fernet.generate_key().decode())Flask-secret-key
python -c "import secrets; print(secrets.token_hex(32))"- Encryption: Enter plain text and click Encrypt.
- The text is encoded and encrypted using Fernet symmetric encryption.
- Decryption: Paste the encrypted text and click Decrypt. If valid, it shows the original message.
encryption-tool/
│
├── templates/
│ └── index.html
├── .env
├── .gitignore
├── requirements.txt
├── simple_encryptor.py # Optional helper module
└── web_app.py # Main Flask app
Name: Mugeha
LinkedIn: https://www.linkedin.com/in/mugeha-jackline
Email: mugehajacky@gmail.com
This project is licensed under the MIT License.


