-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
cspp:phase:2CSPP Phase 2: Master Key Infrastructure & Local EncryptionCSPP Phase 2: Master Key Infrastructure & Local Encryption
Milestone
Description
XChaCha20-Poly1305 block-level AEAD implementation of redb's StorageBackend trait.
- Implement
EncryptedBackendstruct wrapping aFile,XChaCha20Poly1305cipher, and logical length - 64-byte file header: magic (
COVE), version, salt, logical length, reserved - Each 4096-byte logical block stored as 4136 bytes on disk: 24-byte random nonce + 4096-byte ciphertext + 16-byte Poly1305 tag
- Block index included as AAD to prevent block swap attacks
- Implement all
StorageBackendtrait methods:len(),read(),write(),set_len(),sync_data() - Partial writes trigger read-decrypt-modify-encrypt-write cycle
- Sparse block handling: all-zero disk blocks return plaintext zeros on read
- Public API:
create(path, key, salt),open(path, key),read_salt(path),is_encrypted(path)
Files: rust/src/database/encrypted_backend.rs (new), rust/src/database.rs (add pub mod)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cspp:phase:2CSPP Phase 2: Master Key Infrastructure & Local EncryptionCSPP Phase 2: Master Key Infrastructure & Local Encryption
Type
Projects
Status
Todo