Expand description
Forward security by erasure, for data that is already at rest.
§What this can and cannot do
For a single stored ciphertext, forward secrecy is impossible. The message key must be recoverable from the recipient’s secret; if that secret still exists when an attacker who already copied the ciphertext obtains it, the ciphertext falls. No protocol avoids this — a sender’s ephemeral key buys authentication, not forward secrecy.
What is achievable is forward security in the Canetti–Halevi–Katz sense: give the recipient a sequence of keys, one per epoch, and let them erase each secret once its window closes. A ciphertext written to epoch n becomes permanently unreadable — by anyone, including the recipient — the moment epoch n’s secret is erased. Compromise tomorrow does not reach it.
The guarantee is therefore entirely about erasure, and it is only as good as the erasure is. This crate zeroizes its own copy; it cannot promise anything about backups, swap files, filesystem snapshots or an SSD’s wear-levelling. Those are the honest limits, and callers must be told them.
§Why epochs are not derived from the master seed
The obvious design — derive epoch n from the identity seed — provides no forward security at all: anyone who later obtains the seed re-derives every epoch, erased or not. So epoch secrets here are independent random keys. The chain stores only public keys and a hash chain that binds them in order, so a recipient can prove which key was current at a given epoch without being able to recover an erased one.
Structs§
- Epoch
Chain - The recipient’s own view: public history plus whichever secrets survive.
- Epoch
Record - The public, shareable record of one epoch.
Enums§
Functions§
- decode_
records - encode_
records - Encodes the public history. Secrets are never encodable — there is no method that could serialise one, so a chain cannot be backed up into a form that silently defeats erasure.
- erase_
bytes - Zeroizes a buffer that held epoch material. Exposed so callers handling raw bytes have the same erasure discipline available.
- recipient_
for - Convenience for a sender: the epoch to encrypt to and the key to use.
Type Aliases§
- Epoch
Number - Epoch numbering starts at zero and only ever increases.