This project is a Python-based File Encryption and Decryption tool developed as part of the Codveda Technologies Python Development Internship. The application uses the Fernet encryption algorithm from the Cryptography library to securely encrypt and decrypt text files. A sample text file is encrypted into an encrypted file and then decrypted back to verify that the original content is restored successfully.
- Encrypt text files securely using the Fernet algorithm.
- Decrypt encrypted files back to their original content.
- Generate and store a secure encryption key.
- Create encrypted and decrypted output files.
- Handle invalid file paths and decryption errors gracefully.
- Python
- Cryptography Library (Fernet)
- File Handling
- Visual Studio Code
- Secure file encryption
- Secure file decryption
- Automatic secret key generation
- File validation
- Error handling
- Command-line interface
- Supports text file encryption and decryption
- encrypt_decrypt.py – Main Python application
- sample.txt – Sample input file
- sample.txt.enc – Encrypted output file
- sample.txt.dec – Decrypted output file
- secret.key – Encryption key generated by the application
- Encrypts sample.txt into sample.txt.enc
- Decrypts sample.txt.enc into sample.txt.dec
- Restores the original file content successfully
The secret.key file is generated automatically when the program runs for the first time. The same key must be used to decrypt previously encrypted files.