A Streamlit-based web application for secure symmetric file encryption and decryption named CipherVault. The application allows users to encrypt raw file contents and decrypt them back to their original form using Fernet symmetric cryptography.
-
🔒 Symmetric file encryption using Fernet cryptography
-
🔓 File decryption back to original form
-
🔑 Session-based secret key generation and management
-
🔄 One-click key regeneration capability
-
📂 Support for text-based file formats (
.txt,.csv,.log,.json) -
⬇️ Automated file renaming and downloading for encrypted and decrypted files
-
🌐 Streamlit-based responsive web interface
-
🎨 Custom CSS styling for interactive layout
-
Python
-
Streamlit
-
cryptography (Fernet)
-
CSS
-
Git & GitHub
Basic_File_Encryption_Decryption/
│
├── app.py
├── README.md
├── requirements.txt
│
└── venv/
Note:
venv/should not be uploaded to GitHub.
The application follows these basic steps:
-
The user launches the Streamlit web application.
-
A random Fernet secret key is generated and stored in the session state.
-
The user selects either the Encrypt File or Decrypt File tab.
-
To encrypt:
-
The user uploads a valid file (
.txt,.csv,.log,.json). -
The file is converted into bytes and encrypted using Fernet cryptography.
-
The encrypted output file is downloaded with an
encrypted_prefix.
- To decrypt:
-
The user uploads an encrypted file.
-
The application attempts decryption using the active session key.
-
The restored original content is downloaded with a
decrypted_prefix.
The application implements Fernet symmetric encryption, which includes:
-
AES-128 in CBC mode for encryption
-
HMAC-SHA256 for message authentication and integrity verification
-
PKCS7 Padding for standardized block formatting
-
Encrypted files can only be decrypted using the exact key active during encryption.
-
Regenerating the secret key invalidates previous keys, making previously encrypted files unrecoverable unless the matching key is preserved.
git clone https://github.com/your-username/Basic_File_Encryption_Decryption.git
cd Basic_File_Encryption_Decryption
On Windows:
python -m venv venv
venv\Scripts\activate
pip install streamlit cryptography
Then generate the requirements file:
pip freeze > requirements.txt
Activate the virtual environment:
venv\Scripts\activate
Run the Streamlit app:
python -m streamlit run app.py
Alternatively, run
streamlit run app.pyif Streamlit is registered in your PATH.
The application will run locally and automatically open in your web browser:
http://localhost:8501
-
Navigate to the Encrypt File tab.
-
Upload a file (e.g.,
data.txt). -
Click Encrypt Content.
-
Download the resulting encrypted file (
encrypted_data.txt).
-
Navigate to the Decrypt File tab.
-
Upload
encrypted_data.txt. -
Click Decrypt Content.
-
Download the restored file (
decrypted_data.txt).
After making changes to the project:
git status
git add .
git commit -m "Update project files"
git push
Ensure temporary files or virtual environments are excluded via .gitignore.
- User key input/passphrase derivation using PBKDF2
- Support for arbitrary file types (PDF, images, archives)
- Key exporting and manual key loading features
- User authentication and cloud file storage support
- File hashing (SHA-256) display before and after processing
ayasree biswas
This project is intended for educational and project-development purposes.