1.9 KiB
1.9 KiB
Zero Knowledge Cloud Backup - Implementation Summary
Status: COMPLETE & DEPLOYED ✅
1. Security Architecture (Zero Knowledge)
- Principle: The server never sees your private keys.
- Cloud Backups: Default to Messages Only. The payload contains encrypted message history but explicitly excludes the key pairs needed to decrypt them.
- Local Backups: Must be used to backup Keys + Messages. This is the only way to restore your identity (Subjective Identity).
- Encryption: All data is encrypted client-side using Argon2id (password derivation) and AES-GCM (content encryption) before leaving the device.
2. Frontend Implementation (Flutter)
- Service: Rebuilt
LocalKeyBackupService.dartto handle the dual-mode backup logic. - UI:
- Added toggle for "Cloud" vs "Local" backup.
- "Secure Mode" indicator when uploading to cloud (confirming keys are excluded).
- Explicit warning: "NOT RECOMMENDED for cloud backups. Keep keys local."
3. Backend Implementation (Go)
- Endpoints:
POST /backups/uploadandGET /backups/downloadare active. - Storage: Stores opaque
encrypted_blob,salt,nonce, andmac. - Database:
- Applied migration
000003_e2ee_backup_recovery. - Created tables:
cloud_backups,backup_preferences,user_devices.
- Applied migration
4. Deployment Details
- Server:
194.238.28.122 - Service:
sojorn-api(Restarted at ~01:55 server time) - Database: Migrations applied successfully via
migrate-linuxtool.
5. How to Test
- Create Identity Backup: Go to "Full Backup & Recovery" -> Select "Local File" -> "Export Backup". Save this file safely!
- Cloud Upload: Switch to "Cloud Backup" -> Encrypt with password -> "Upload Backup".
- Restore Flow:
- Wipe app / New Device.
- Step 1: "Import Backup" using your Local File (Restores Identity/Keys).
- Step 2: "Download & Restore" from Cloud (Restores Message History).