SecureFlow is a zero-knowledge personal security vault consisting of a Windows Desktop client, an Android companion app, and a shared AWS S3 cloud vault. It securely manages passwords (credentials), TOTP authenticator keys (2FA), and critical files (PDFs, images).
SecureFlow splits responsibilities between a desktop engine and a mobile companion:
┌──────────────────────────────┐
│ Windows Desktop App │
│ (Python & CustomTkinter) │
└──────────────┬───────────────┘
│
[Boto3 Encrypted Uploads]
│
▼
┌──────────────────────────────┐
│ AWS S3 Sync Vault │
│ (Zero-Knowledge Cloud Sync) │
└──────────────┬───────────────┘
│
[Dart S3 Encrypted Downloads]
│
▼
┌──────────────────────────────┐
│ Android Mobile App │
│ (Flutter & Dart) │
└──────────────────────────────┘
- Zero-Footprint Encryption: Files decrypted on both platforms never touch the physical disk in plaintext form. They are decrypted directly into RAM buffers, displayed in-memory, and immediately zeroed out when closed.
- Cryptographic Parity: Both clients implement identical key derivation and encryption formats:
- KDF: HKDF-SHA256 (32-byte salt, info parameter:
b"SecureFlow session key"). - Cipher: AES-256-GCM (12-byte random IV, 16-byte authentication tag).
- KDF: HKDF-SHA256 (32-byte salt, info parameter:
- In-Memory Security: RAM variables holding master key material are scrubbed directly using raw memory operations (
ctypes.memsetin Python,fillRange(0)in Dart) to mitigate cold-boot or memory dump attacks.
We have stabilized the system and resolved key cross-platform synchronization blockers:
- Dynamic Cloud Re-Encryption: Desktop files encrypted in Mode H (Hardware port mode) are transparently translated in RAM to Mode M (Software/Mock secret mode) before being uploaded to S3. This ensures they can be opened by the mobile device without a physical ESP32 hardware attachment.
- S3 Path Escaping Fix: Resolved a path double-escaping bug in the Flutter AWS S3 client where component encoding corrupted subfolder slash paths (
/), returning403 Forbiddenerrors. - NFC Decapsulation Rigor: Replaced the custom NDEF text reader in Flutter with a robust UTF-8/UTF-16 decoder that strips null paddings, stopping pairing mismatches and "InvalidCipherTextException" crashes when using NFC tags.
- Mobile Bulk Sync: Implemented a "SYNC ALL" button in the mobile document vault screen to allow one-click bulk uploading of local unsynced files.
- Keystroke Dynamics EDR: The desktop client features a passive background intrusion detection agent (
global_agent.py) that monitors key-press intervals, feeds a trained Isolation Forest model, and locks the vault if typing patterns diverge from the owner's baseline.
All files stored locally in the vault or synced to the cloud follow the V3 binary envelope layout:
┌──────────────┬──────────────┬──────────────────────┬──────────────────────┬──────────────────────┐
│ Magic (4B) │ Mode (1B) │ Handshake Nonce(32B) │ File Nonce (12B) │ Ciphertext + Tag │
│ "SFV3" │ 'M' or 'H' │ HKDF Salt / IV │ AES-GCM IV │ Variable + 16B │
└──────────────┴──────────────┴──────────────────────┴──────────────────────┴──────────────────────┘
- Windows OS
- Python 3.13 (or 3.10+)
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables in a local
.envfile (copied from.env.example):AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_REGION=ap-south-1 S3_BUCKET_NAME=your_bucket_name
- Initialize the local Mock hardware secret:
- Create
mock_hardware_secret.txtin the root folder. - Enter a high-entropy secret string (e.g.,
SecureFlow-Mock-Secret-Change-Me-Use-High-Entropy).
- Create
- Run the main desktop app:
python main.py
- Run the active intrusion detection background agent:
python global_agent.py
Verify file decryption integrity directly from the command line:
python verify_parity.py SecureFlow_Vault/example.pdf.enc