Glossary
What is the Double Ratchet algorithm?
The Double Ratchet is an algorithm that derives a new encryption key for every message, giving conversations forward secrecy and post-compromise security.
Two "ratchets" turn together: a symmetric-key ratchet advances with each message, and a Diffie-Hellman ratchet mixes in fresh key material whenever the conversation changes direction. Each key is used once and thrown away.
This is the same algorithm that secures Signal. PrivaMesh keeps it (paired with AES-256-GCM and message padding) so that a leaked key can neither unlock your past messages nor keep an attacker in your future ones.
The algorithm was published by Trevor Perrin and Moxie Marlinspike as part of the Signal Protocol, and it is now the de facto standard for secure messaging - used by Signal, WhatsApp, and PrivaMesh among others. It has been formally analysed in the academic literature, which is a meaningful distinction from bespoke protocols.
The symmetric ratchet advances a chain key through a KDF for each message in a run, giving forward secrecy within that run. The Diffie-Hellman ratchet turns whenever the conversation changes direction, mixing in fresh entropy from a new key exchange. That second ratchet is what provides post-compromise security, sometimes called self-healing.
Post-compromise security is the property that gets undersold. If an attacker briefly obtains your keys, the next time your contact replies, a new DH exchange injects material the attacker never saw, and they are locked out again. Recovery is automatic and requires no action from either party.
Primary sources
- The Double Ratchet algorithmThe specification for the per-message ratchet that provides forward secrecy and post-compromise security.
- RFC 5869: HKDFThe key derivation function the ratchet uses to advance chain keys.