A lightweight Python command-line application that securely encrypts and decrypts files using the Fernet symmetric encryption algorithm from the cryptography library.
- 🔒 Encrypt files securely using Fernet encryption
- 🔓 Decrypt encrypted files
- 🔑 Generate new encryption keys
- 🆔 KEYID verification to prevent using the wrong key
- 📝 Logging of encryption and decryption operations
- ✅ Unit tests using pytest
- 🎨 Colored terminal output using Colorama
FileEncrypt-Mini/
│
├── keys/
│ └── encrypted.key
│
├── logs/
│ └── app.log
│
├── samples/
│ ├── note.txt
│ ├── note.txt.encrypted
│ └── note.txt.decrypted
│
├── src/
│ ├── encrypt.py
│ ├── decrypt.py
│ ├── key_manager.py
│ ├── logger.py
│ └── utils.py
│
├── tests/
│
├── main.py
├── requirements.txt
├── README.md
├── LICENSE
└── .gitignore
git clone https://github.com/yourusername/FileEncrypt-Mini.git
cd FileEncrypt-MiniWindows
python -m venv .venv
.venv\Scripts\activateLinux/macOS
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtStart the application:
python main.pyMenu:
1. Encrypt File
2. Decrypt File
3. Generate New Key
4. Exit
Place files to encrypt inside the samples/ folder.
Encrypted files are saved as:
filename.ext.encrypted
Decrypted files are saved as:
filename.ext.decrypted
Each encrypted file stores a short KEYID generated from the encryption key.
Before decrypting, the application verifies that the current key matches the stored KEYID.
This helps prevent accidental decryption attempts using the wrong encryption key.
pytestAdd screenshots of:
- Main menu
- Successful encryption
- Successful decryption
- Wrong key error
- Python 3
- cryptography (Fernet)
- Colorama
- pathlib
- logging
- hashlib
- pytest
- Password-protected encryption
- Drag-and-drop file selection
- GUI using Tkinter or CustomTkinter
- Encrypt multiple files at once
- Key backup and restore
- Support for folders
This project is licensed under the MIT License.