Status: Prototype / Deployed Security Level: AES-128 Encryption + HMAC-SHA256 Integrity Check Classification: CONFIDENTIAL // NOFORN
The Secure Data Transmission System (SDTS) is a specialized secure communication tool designed for defense and intelligence operations. Unlike standard QR code generators, this system prioritizes the CIA Triad (Confidentiality, Integrity, Availability) to ensure sensitive data cannot be intercepted, read, or tampered with during transmission.
This tool allows officers to encrypt mission-critical intelligence into a QR code, which can only be decrypted by authorized personnel possessing the specific decryption key. It includes military-grade tamper detection to prevent "Man-in-the-Middle" attacks.
- Uses AES-128 (Fernet) symmetric encryption to lock raw data.
- Data is completely unreadable (ciphertext) to any standard QR scanner.
- Key Derivation: Uses PBKDF2 (Password-Based Key Derivation Function 2) with 100,000 iterations to derive cryptographically strong keys from user passwords.
- Implements HMAC-SHA256 digital signatures.
- Before encryption, the system generates a cryptographic "fingerprint" of the message.
- Defense Mechanism: If an enemy modifies the QR code image or the ciphertext string by even one byte, the system detects the signature mismatch and immediately rejects the decryption with a SECURITY ALERT.
- Auto-generates professional "TOP SECRET" PDF Mission Reports.
- Includes timestamps, unique Mission IDs, and official watermarks for physical dispatch.
- Audit Logging: Every encryption and decryption attempt is logged in a secure
security_audit.logfile. - Tracks IP Addresses, Timestamps, and Status (Success/Failure/Tampering) for post-mission analysis.
- The interface is built with embedded CSS, ensuring the tool looks modern and functions perfectly even in air-gapped environments (no internet connection).
- Framework: Django 5.0 (Python)
- Cryptography:
cryptography(Fernet, HAZMAT primitives) - Computer Vision:
opencv-python(For reading QR codes from uploaded images) - Document Generation:
reportlab(For PDF Report generation) - QR Processing:
qrcode[pil],numpy - Frontend: HTML5, CSS3 (Custom Dark/Light Mode, Offline-Ready)
- Python 3.10 or higher
- pip (Python Package Installer)
git clone [https://github.com/yourusername/secure-qr-system.git](https://github.com/yourusername/secure-qr-system.git)
cd secure-qr-systemIt is recommended to use a virtual environment to manage dependencies.
# Windows
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install django cryptography qrcode[pil] opencv-python-headless numpy reportlab whitenoisepython manage.py migratepython manage.py runserverAccess the application at: http://127.0.0.1:8000/
- Navigate to the Generate page.
- Enter the Mission Title (e.g., Operation Alpha) and Confidential Data.
- Set a strong Encryption Key (Password).
- Click Generate Secure QR.
- Output: You can download the raw QR image or the Classified PDF Report.
- Navigate to the Decrypt page.
- Upload the QR code image OR Paste the ciphertext string.
- Enter the shared Encryption Key.
- Click Unlock Data.
- Output: You can download the raw QR image or the Classified PDF Report.
- Success: The original message is displayed.
- Failure: "Decryption Failed: Incorrect Password."
- Alert: "SECURITY ALERT: Integrity Check Failed!" (If data was tampered with).
secure-qr-system/
βββ django_qr/
β βββ forms.py # Input validation forms
β βββ utils.py # CORE LOGIC: Encryption, HMAC, PDF Gen, Logging
β βββ views.py # Handles requests and connects UI to Logic
β βββ urls.py # Routing
β βββ settings.py # Configuration
βββ media/ # Stores generated QRs and PDFs
βββ templates/ # HTML Interface
β βββ base.html # Main layout with Offline CSS
β βββ generate_qr.html # Encryption Interface
β βββ decrypt.html # Decryption Interface
β βββ qr_result.html # Success Page
βββ security_audit.log # (Created automatically) Logs all actions
βββ manage.py
Salt Management: This prototype uses a static salt for key derivation to ensure portability for demonstration purposes. In a production environment, a unique, random salt would be generated per user and stored in a secure database to prevent rainbow table attacks.
Key Management: The system relies on the user remembering the password. Keys are not stored on the server; if the password is lost, the data is unrecoverable.
This project is developed for educational and demonstration purposes, specifically targeting Defense Technology applications.