Skip to content

feat: Secure backup & encrypted export options (#126)#763

Open
wocaoac-cpu wants to merge 1 commit intorohitdash08:mainfrom
wocaoac-cpu:feature/secure-backup-export
Open

feat: Secure backup & encrypted export options (#126)#763
wocaoac-cpu wants to merge 1 commit intorohitdash08:mainfrom
wocaoac-cpu:feature/secure-backup-export

Conversation

@wocaoac-cpu
Copy link
Copy Markdown

Summary

Implements issue #126 — Secure backup & encrypted export options.

What's included:

  • AES-256-GCM encryption with PBKDF2-HMAC-SHA256 key derivation (600,000 iterations)
  • POST /backup/export — Export all user data (categories, expenses, recurring, bills) as encrypted JSON
  • POST /backup/export/csv — Export expenses as encrypted CSV
  • POST /backup/import — Decrypt and import with intelligent merge (category matching, expense deduplication)
  • GET /backup/history — List past backup operations
  • 18 tests covering all endpoints, crypto, auth, and edge cases
  • Full documentation in docs/backup-encryption.md

Security design:

  • Password-derived key (never stored server-side)
  • Random salt + nonce per export (unique ciphertext every time)
  • Self-describing envelope format with version and KDF params
  • Minimum 8-character backup password enforced

Files changed:

  • packages/backend/app/routes/backup.py — New route module (4 endpoints)
  • packages/backend/app/routes/__init__.py — Register blueprint
  • packages/backend/requirements.txt — Added cryptography==43.0.0
  • packages/backend/tests/test_backup.py — 18 tests
  • docs/backup-encryption.md — Full documentation

Closes #126

- AES-256-GCM encryption with PBKDF2 key derivation (600k iterations)
- POST /backup/export - encrypted JSON export of all user data
- POST /backup/export/csv - encrypted CSV export of expenses
- POST /backup/import - decrypt and import with intelligent merge
- GET /backup/history - list past backup operations
- 18 tests covering all endpoints, crypto, auth, edge cases
- Full documentation in docs/backup-encryption.md
@wocaoac-cpu wocaoac-cpu requested a review from rohitdash08 as a code owner April 3, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secure backup & encrypted export options

1 participant