Encryption and Backup Failures
| Symptom | Likely cause | Fix |
|---|---|---|
| backup cannot restore on new device | key only existed in old device secure store | design recovery password/code or document device-bound backups |
| encrypted backup opens without password | backup was not actually encrypted | add automated negative test |
| user forgot password | no recovery design | decide up front: unrecoverable, recovery code, or account recovery |
| CryptoKey export fails on web | key is non-extractable | wrap/export data key intentionally or use password-derived backup key |
| desktop vault prompts repeatedly | keychain/Stronghold password flow broken | cache only in memory and document unlock UX |
| Room DB encrypted but CSV is plaintext | export path bypassed encryption threat model | warn user or encrypt export/backup separately |
Negative Tests
Run these before shipping encrypted backup:
- Try to open backup with wrong password.
- Try to restore on a clean install.
- Try to restore after deleting local secure-store keys.
- Verify exported CSV/JSON warning copy for private data.
- Verify app behavior when key unlock is cancelled.
Warning: Do not promise recoverability unless a clean-device restore test proves it.