A production-grade Python desktop security utility designed to protect local filesystem assets through authenticated symmetric encryption. This application features a responsive graphical user interface (GUI) built with Tkinter, an independent cryptographic engine, and structured diagnostic logging.
Cryptographic Logic
- Encryption: Plaintext + Secret Key ──> Ciphertext
- Decryption: Ciphertext + The Same Secret Key ──> Plaintext
🚀 Key Features
- Tkinter Desktop Interface: A clean, responsive graphical user interface (GUI) featuring native operating system file pickers, adaptive grid scaling, custom active-state color transitions, and interactive status alerts.
- Decoupled Architecture: Complete separation of concerns between the visual presentation layer (
CryptoAppGUI) and the core backend processing algorithms (MyCryptoProcessor).
- Authenticated Encryption (AES-128): Leverages the robust Fernet specification—built on AES in CBC mode with a 128F-bit key—ensuring absolute data confidentiality and cryptographic integrity.
- Dual-Target Logging Framework: Replaced volatile terminal prints with a native logging configuration that simultaneously outputs real-time console metrics and records permanent audit traces to
crypto_app.log.
- Runtime Error Resilience: Engineered strict path-cleaning, string sanitization routines, and granular try-except validation scopes to prevent path-traversal crashes and handle missing files gracefully.
- UX Safety Gates (Input Constraining): Implemented separate input-constrained directory browsers. The plaintext selector restricts views to
.txt files, while the ciphertext selector filters exclusively for .encrypted files, eliminating accidental selection errors completely.
🛠️ Technical Stack
- Language: Python 3.x
- GUI Framework: Tkinter / TTK (Native Components)
- Cryptographic Engine: cryptography (Fernet Specification)
- Logging Engine: logging (Native Component)
📦 Installation & Setup
-
Clone the Repository:
git clone https://gitlab.com/rejithregi-group/SecurityProject.git
cd SecurityProject
-
Install Dependencies:
pip install -r requirements.txt
🖥️ Usage & Workflow
Run the application window from your terminal:
python FileEncryptionDecryptionTool.py
Typical Operational Workflow
- Generate New Key: Click the blue button to generate a secure
.key file. Save it safely via the native OS prompt. Warning: Losing this key means your encrypted data cannot be recovered.
- Encrypt Target File: Click "Browse..." on the Target Plaintext File row (strictly filtered for
.txt), choose your encryption master key, and hit the green execution button. The app outputs a protected copy with a .encrypted suffix.
- Decrypt Target File: Click "Browse..." on the dedicated Target Encrypted File row (strictly filtered for
.encrypted files), choose your matching validation key, and execute the charcoal button to safely restore your plain text asset back to your disk.
🔒 Security Operations & Audit
This utility actively implements automated diagnostics to keep developer trails clear:
- System Integrity Checking: All file interactions run inside safe context managers (
with open) to ensure data block flushing and secure memory cleanup loops.
- Audit Logging: Every session transaction, key path mapping, and operational cipher outcome maps explicitly inside a persistent file named
crypto_app.log.
👨💻 Author
📜 License
This project is licensed under the MIT License.