File Encryption/Decryption Tool
An easy to use tool for encrypting and decrypting files using the Advanced Encryption Standard (AES) algorithm.
Features
- AES encryption using the Pycryptodome library
- PBKDF2 key derivation with SHA256 hash and 100000 iterations
- Key generation and storage in a separate file
- File encryption and decryption using user input
- Interactive menu and ability to handle user's choices
- Input Validation
- Ability to encrypt/decrypt large files
How to use
- Clone the repository to your local machine or download the script to your computer.
- Run the script using the command
python main.py
or execute the main.exe
.
- Select the desired option from the menu:
- Generate key and encrypt a file
- Load key and decrypt a file
- If you chose to generate the key, you will be prompted to enter a password which will be used to encrypt the key
- After that enter the path of the file to encrypt/decrypt
- Wait for the encryption/decryption to finish.
- Enjoy your secure files
Note
- This script is just an example, you should use better way of storing the key and password, like using environment variable or using a service like Hashicorp's Vault.
- It is recommended to use AES-GCM which is authenticated encryption mode and also encrypt in a streaming fashion.
- The salt variable is set to a fixed value, This is not recommended for actual use