This is a beginner-friendly Python project that demonstrates how to encrypt a text file using the cryptography.fernet module.
The script generates a secret key, saves it in a separate file, and then encrypts the contents of data.txt.
Only someone with the secret key can decrypt the file and read its contents.
- Generates a unique encryption key for every run
- Stores the key in a separate file (
File_key) - Encrypts the content of
data.txtsecurely - Beginner-friendly code with comments
- Python 3.7+
cryptographylibrary
Install the library with:
pip install cryptography