v0.0.12: Encrypted backup/restore + history module

Protocol:
- history.rs: derive_history_key (HKDF from seed, info="warzone-history")
- encrypt_history / decrypt_history (ChaCha20-Poly1305, WZH1 magic)
- 2 new tests (roundtrip + wrong seed), total 19/19

CLI:
- `warzone backup [output.wzb]` — exports all sessions + pre-keys
  as encrypted blob (only your seed can decrypt)
- `warzone restore <input.wzb>` — imports backup, merges (no overwrite)
- Backup format: WZH1 magic + nonce + encrypted JSON

Storage:
- export_all() — dumps sessions + pre-keys as base64 JSON
- import_all() — merges backup data (skip existing entries)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 12:59:54 +04:00
parent fff443bb6d
commit 653c6c050b
5 changed files with 160 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ members = [
]
[workspace.package]
version = "0.0.11"
version = "0.0.12"
edition = "2021"
license = "MIT"
rust-version = "1.75"