This is a Flask-based web application that allows users to securely encrypt and decrypt files using the Fernet symmetric encryption algorithm. The app provides an intuitive web interface for file uploads, encryption, decryption, and secure downloads.
- File Encryption: Upload a file and encrypt it using a unique key.
- File Decryption: Upload an encrypted file and decrypt it using the correct key.
- Automatic Key Generation & Storage: Generates a new key for each encryption and securely stores it.
- Secure File Handling: Uses secure filenames and enforces size restrictions (max 16MB).
- Error Handling: Provides user-friendly error messages for invalid operations.
- Logging: Maintains logs of encryption and decryption activities.
Ensure you have the following installed:
- Python 3.7+
- pip (Python package manager)
- Clone the Repository:
git clone https://github.com/your-repo/Enclypt.git cd Enclypt - Create a Virtual Environment (Recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install Dependencies:
pip install -r requirements.txt
- Set Up Environment Variables:
Create a
.envfile and define:SECRET_KEY=your_random_secret_key PORT=7500 # Optional, defaults to 7500 - Run the Application:
python app.py
- Open your browser and navigate to:
http://127.0.0.1:7500
- Navigate to the Encrypt page.
- Upload a file (max 16MB).
- The app generates an encrypted file and provides a unique key.
- Download the encrypted file and securely save the key.
- Navigate to the Decrypt page.
- Upload the encrypted file.
- Enter the correct key.
- Download the decrypted file.
flask-encryptor/
│── app.py # Main Flask application
│── requirements.txt # Dependencies
│── templates/ # HTML templates
│── static/ # Static files (CSS, JS)
│── uploads/ # Stores encrypted/decrypted files
│── keys/ # Stores encryption keys
│── logs/ # Stores logs
- Key Management: Keys are stored in the
keys/folder. Users must securely store their key ID to decrypt files. - Size Restrictions: Files larger than 16MB are not allowed to prevent DoS attacks.
- Logging: Logs are maintained for security monitoring.
- Implement scheduled cleanup for temporary files.
- Add user authentication for secure file handling.
- Use a database for better key management.
This project is licensed under the MIT License.
