Fact-checked by Grok 2 weeks ago

Double Ratchet Algorithm

The Double Ratchet Algorithm is a cryptographic protocol that enables two parties to derive a sequence of unique symmetric keys for encrypting and authenticating messages, starting from an initial shared secret established via a key agreement mechanism such as X3DH or PQXDH. It achieves this through a combination of symmetric key derivation and asynchronous Diffie-Hellman exchanges, ensuring that each message uses a fresh, unpredictable key while maintaining security even in asynchronous communication scenarios. Developed by and Trevor Perrin in 2013 as a core component of the , the algorithm builds on concepts from the Off-the-Record (OTR) messaging protocol to address limitations in prior ratcheting schemes. It is employed in the Signal messaging application to provide for text, voice, and video communications. The protocol's design emphasizes forward secrecy, meaning that the compromise of a or long-term private keys does not reveal the content of previously exchanged messages, as each message key is derived independently and discarded after use. Additionally, it offers break-in recovery (or post-compromise security), allowing the parties to restore security for future messages after a key compromise, provided that at least one additional Diffie-Hellman exchange occurs subsequently to inject fresh entropy. At its heart, the Double Ratchet consists of three interconnected (KDF) chains: a root chain that manages the overall session state, a sending chain for the sender's keys, and a receiving chain for decryption. The symmetric-key advances these chains sequentially with each sent or received, using a one-way KDF (typically with HMAC-SHA-256) to generate the next key while rendering prior keys computationally infeasible to reverse. Interleaved with this is the Diffie-Hellman , which periodically updates the root key by computing a Diffie-Hellman from one party's key and the other's key, included in headers; this asymmetric step ensures security against device compromises and supports asynchronous key updates. These mechanisms together produce keys that are indistinguishable from random to an adversary lacking the current chain keys, as proven under standard assumptions for the underlying primitives. The algorithm's resilience has been formally analyzed in subsequent cryptographic research, confirming its security bounds against key compromise impersonation attacks and multi-user extensions, with tightness results establishing that its security loss scales linearly with the number of messages rather than exponentially. Since its introduction, the Double Ratchet has influenced secure messaging standards, including implementations in applications like WhatsApp and Google Messages, though its primary documentation and reference remain tied to Signal's open-source specifications. A revision of the specification published on November 4, 2025, incorporates post-quantum extensions using ML-KEM-based key exchanges to address quantum threats. Ongoing work focuses on further post-quantum adaptations.

History and Development

Origins and Evolution

The Double Ratchet Algorithm originated in 2013 as part of the , developed by Trevor Perrin and at (now the ). Initially named the Ratchet, it was designed to enable secure, asynchronous messaging with strong properties. The protocol's core ideas were introduced in a November 2013 blog post by Marlinspike, which outlined an advanced ratcheting mechanism for applications. The algorithm evolved from earlier cryptographic protocols, incorporating the Diffie-Hellman (DH) ratchet concept from the Off-the-Record (OTR) messaging protocol, originally proposed by Nikita Borisov, Ian Goldberg, and Eric Brewer in 2004, to provide forward secrecy through ephemeral key exchanges. It also drew on symmetric-key ratcheting techniques from protocols like the Silent Circle Instant Messaging Protocol (SCIMP) from 2012 and MinimaLT, to enable efficient key derivation for message encryption. This combination addressed limitations in prior systems, particularly by supporting asynchronous ratcheting that allows users to communicate even when offline, deriving new keys independently for sending and receiving chains. Key milestones in its development include the open-sourcing of the initial implementation in 2013 alongside the app, making the code publicly available on for community review and adoption. In February 2014, released v2, integrating the Ratchet to provide for asynchronous , marking the protocol's first widespread deployment and transitioning the app from dependency. The protocol underwent a significant update in March 2016, when renamed the overall framework from to the and specifically rebranded the ratchet mechanism as the Double Ratchet Algorithm to clarify its dual structure of symmetric and asymmetric ratchets, reducing confusion between the component and the full protocol. Later that year, in November 2016, Perrin published the of the Double Ratchet Algorithm, which has since served as the authoritative reference for implementations and influenced standards efforts, including references in IETF (MLS) drafts. The specification continued to evolve, with a major revision in November 2025 incorporating post-quantum extensions such as the Sparse Post-Quantum Ratchet and Triple Ratchet for enhanced resistance to threats.

Key Contributors

The Double Ratchet Algorithm was primarily designed by Trevor Perrin and in 2013 as part of the for the messaging application, now known as Signal. Perrin, a cryptographer and protocol designer, led the development of the mechanics, focusing on combining symmetric-key and Diffie-Hellman to achieve and post-compromise security in asynchronous messaging scenarios. His contributions included specifying the key derivation functions and message key generation processes that form the core of the algorithm's security model. Moxie Marlinspike, founder of (later rebranded as Signal Messenger), played a pivotal role in integrating the Double Ratchet into mobile messaging protocols, emphasizing practical usability alongside cryptographic strength. 's work extended the algorithm's application within the broader , ensuring seamless for real-time conversations while prioritizing user-friendly features like automatic key updates. , established by in 2013, implemented and open-sourced the protocol that year, releasing the codebase under a to foster widespread adoption and scrutiny. The algorithm draws significant influence from earlier work on the Off-the-Record (OTR) messaging protocol, particularly the Diffie-Hellman ratchet concept introduced by , Nikita Borisov, and Eric Brewer in their 2004 paper. , a prominent cryptographer and OTR co-creator, contributed foundational ideas on deniability and through , which Perrin and Marlinspike adapted and extended for the Double Ratchet's dual-ratchet structure. Post-2016, the (IETF) (MLS) working group built upon the Double Ratchet by developing ratchet trees for group messaging, standardizing extensions that enable scalable key agreement among multiple parties while preserving core security properties. The protocol, formalized in RFC 9420, incorporates asynchronous ratcheting mechanisms inspired by the Double Ratchet to support in dynamic groups. Community contributions have further refined and disseminated the algorithm through open-source implementations on platforms like , including Perrin's reference repository and associated wiki, which document variations, audits, and integrations. These efforts, involving developers from various projects, have facilitated and adaptations in diverse cryptographic libraries.

Overview and Design Principles

Core Objectives

The Double Ratchet Algorithm primarily aims to provide for messaging protocols, ensuring that communications remain confidential and accessible only to the intended recipients through the use of a key derived from an initial agreement. A key objective is achieving (FS), which protects past messages from decryption even if long-term keys or session states are compromised at a later time, by generating ephemeral keys for each message exchange. Additionally, the algorithm seeks (PCS), enabling the recovery of after a key compromise without permanently undermining future sessions, thus limiting the attacker's ability to access subsequent messages beyond a bounded period. To support real-world messaging scenarios, the Double Ratchet facilitates asynchronous communication, allowing secure exchanges even when one party is temporarily offline, through an initial such as X3DH that uses prekey bundles to enable message sending without immediate key synchronization. This design accommodates out-of-order delivery and lost messages, ensuring resilience in unreliable networks common to mobile applications. Furthermore, it incorporates objectives for detecting message reordering, deletion, or replay attacks by advancing cryptographic states in a way that invalidates outdated or tampered inputs, thereby maintaining the integrity of the conversation chain. Balancing robust with practical , the algorithm targets on resource-constrained devices such as smartphones, minimizing computational overhead while providing per-message to prevent mass decryption from single compromises. Introduced in as part of the , these objectives address the limitations of prior systems by combining symmetric and asymmetric cryptography to scale for high-volume, privacy-focused communications.

Basic Components

The Double Ratchet Algorithm relies on several fundamental building blocks to achieve its security goals in asynchronous messaging protocols. At its core are three interconnected (KDF) chains: the root chain, which manages the overall session state and is updated via Diffie-Hellman exchanges; the sending chain, which derives keys for outgoing messages; and the receiving chain, which handles decryption keys for incoming messages. These chains use a one-way KDF, such as with HMAC-SHA-256, to generate subsequent keys irreversibly. Complementing this is the symmetric-key ratchet, which advances the sending and receiving chains sequentially with each message, producing unique message keys for encryption and decryption while enabling secure key deletion for . The Diffie-Hellman (DH) ratchet is an asymmetric mechanism that employs pairs to periodically refresh the root key through DH exchanges between one party's private ratchet key and the other's public ratchet key. This introduces fresh entropy for post-compromise security and typically uses , such as , for efficient key agreement. The double ratchet integrates these mechanisms, with the symmetric-key ratchet handling efficient per-message advancements and the DH ratchet intervening to rekey the chains upon receiving a new public key, supporting asynchronous updates and overall security. The algorithm is initialized with a from an asynchronous , such as X3DH, which uses a prekey system of signed prekeys and optional one-time prekeys to allow one party to initiate a session offline.

Technical Functioning

Initialization and Key Agreement

The initialization phase of the Double Ratchet Algorithm occurs prior to message exchange and relies on the Post-Quantum Extended Diffie-Hellman (PQXDH) key agreement protocol within the broader Signal Protocol to establish an initial shared secret between two parties, Alice and Bob. PQXDH enables asynchronous setup by allowing Alice to initiate the key agreement without requiring Bob to be online at that moment. Bob publishes his public keys—a long-term identity key (IK_B), a signed prekey (SPK_B), and optionally one or more one-time prekeys (OPK_B), along with a signed last-resort post-quantum key encapsulation mechanism (PQKEM) prekey (PQSPK_B) and optionally one-time PQKEM prekeys (PQOPK_B)—to a central server, which stores them for retrieval by Alice. Alice fetches Bob's prekey bundle from the server, generates her own ephemeral key pair (EK_A), and verifies the signature on SPK_B using IK_B (and similarly for PQSPK_B) to ensure authenticity. The core of PQXDH involves computing a shared secret through a combination of classical Diffie-Hellman (DH) exchanges and a post-quantum key encapsulation, typically three or four classical DH plus one PQKEM encapsulation depending on the availability of OPK_B and PQOPK_B. In the basic three-DH case, the shared secret SK is derived as SK = KDF(DH(IK_A, SPK_B) || DH(EK_A, IK_B) || DH(EK_A, SPK_B) || PQ_shared_secret), where PQ_shared_secret is obtained via PQKEM-ENC with Bob's PQ prekey (PQSPK_B or PQOPK_B), and KDF is a such as . If an OPK_B or PQOPK_B is used, additional DH or PQKEM exchanges are incorporated, enhancing by including short-lived keys that are deleted after use. This SK serves as the input for initializing the Double Ratchet state, providing the foundation for subsequent ratcheting while the identity keys offer . Once is established, the Double Ratchet initializes by deriving the root key (RK) and initial chain keys using the HMAC-based (). For (the initiator), the process begins with generating a new DH key pair for the sending (DHs) and setting the receiving ratchet public key (DHr) to Bob's provided public key. The root key and sending chain key (CKs) are then computed as (RK, CKs) = HKDF_RK( || DH(DHs, DHr)), where HKDF_RK is a variant of HKDF that extracts two 32-byte outputs: one for RK and one for CKs. The receiving chain key (CKr) is initially set to null, along with counters for sent messages (Ns = 0), received messages (Nr = 0), previous chain length (PN = 0), and an empty message skip list (MKSKIPPED = {}). Bob's initialization mirrors this but starts from SK directly, as he responds to Alice's initial message containing her DH public key. Bob sets his sending ratchet to the DH key pair he used in PQXDH (DHs), initializes RK = , and leaves both chain keys (CKs and CKr) as null initially, with the same counter values as . This establishes symmetric sending and receiving chains: the sending chain for deriving message keys in one direction and the receiving chain for the opposite. The following outlines the initial state setup for :
RatchetInitAlice(SK, Bob's DH public key):
    Generate DH key pair DHs
    Set DHr = Bob's DH public key
    shared_secret = DH(DHs.private, DHr)
    (RK, CKs) = HKDF_RK(SK || shared_secret)
    CKr = null
    Ns = 0
    Nr = 0
    PN = 0
    MKSKIPPED = {}
For Bob, upon receiving Alice's initial message with her DH public key:
RatchetInitBob(SK, Alice's DH public key):
    DHs = Bob's existing DH key pair from PQXDH
    DHr = Alice's DH public key
    RK = [SK](/page/SK)
    CKs = null
    CKr = null
    Ns = 0
    Nr = 0
    PN = 0
    MKSKIPPED = {}
These steps ensure the ratchet begins in a synchronized state, ready for the DH ratchet to advance upon the first message exchange.

Ratcheting Mechanisms

The Double Ratchet Algorithm employs two primary ratcheting mechanisms to iteratively advance cryptographic keys, ensuring and post-compromise security during message exchanges. The symmetric-key ratchet operates on a sending or receiving to derive unique message keys for each communication, while the Diffie-Hellman (DH) ratchet periodically updates the root key and keys using ephemeral key pairs, discarding prior material to limit exposure from compromises. These mechanisms interleave to form a double structure, where symmetric ratcheting handles sequential messages and DH ratcheting introduces fresh entropy at intervals. The symmetric- ratchet advances a chain (CK) to produce a message (MK) for or decryption, using a derivation function (KDF) based on HMAC-SHA-256. Specifically, the derivation computes the next chain and message as follows: (\text{CK}_{\text{next}}, \text{MK}) = \text{KDF}_{\text{CK}}(\text{CK}) where \text{KDF}_{\text{CK}}(\text{CK}) applies HMAC-SHA-256 with the current CK as the , iterating over fixed-length constants (0x01 for the message branch and 0x02 for the next chain branch) to output 32-byte values for both. This process ensures each message uses a distinct MK, which is deleted after use to minimize storage of sensitive material, and advances the chain unidirectionally to prevent reuse. The symmetric ratchet maintains separate sending (CKs) and receiving (CKr) chains, incremented on each send or receive operation. The DH ratchet enhances security by incorporating to refresh keys, typically triggered when a party receives a message with a new public key. It begins with the generation of a fresh ephemeral (DHs) by the sender. The shared DH output is then computed as DH(DHs, DHr), where DHr is the receiver's stored public key. This output updates the root key (RK) and initializes a new receiving chain key (CKr) via: (\text{RK}_{\text{new}}, \text{CKr}) = \text{KDF}_{\text{RK}}(\text{RK}, \text{DH output}) A symmetric update follows for the sending chain: (\text{RK}_{\text{new}}, \text{CKs}) = \text{KDF}_{\text{RK}}(\text{RK}, \text{DH}(\text{new DHs}, \text{DHr})), where \text{KDF}_{\text{RK}} uses HKDF with SHA-256, taking the old RK as salt and the DH output as input key material (info application-specific). The old DHr is replaced by the new public key, and prior chain keys are discarded, providing forward secrecy by rendering past messages undecryptable even if long-term keys are compromised. DH ratchets occur asynchronously, with the receiver advancing upon detecting a new key in the message header. To handle out-of-order message delivery, the algorithm supports skipping ahead in the receiving up to a limit (MAX_SKIP, typically 1000) to derive message keys for delayed packets without reordering requirements. Upon receiving a message with number Nr and prior chain length PN, if Nr exceeds the current receiving number (state.Nr), the system iterates KDF_CK on CKr until reaching Nr, storing intermediate MKs in a skipped keys (MKSKIPPED) indexed by the DH identifier and message number. for this skipping is:
def SkipMessageKeys(state, until):
    if state.Nr + MAX_SKIP < until:
        raise [Error](/page/Error)()  // Skip limit exceeded
    if state.CKr is not None:
        while state.Nr < until:
            state.CKr, mk = KDF_CK(state.CKr)
            state.MKSKIPPED[(state.DHr, state.Nr)] = mk
            state.Nr += 1
This accommodates network delays while bounding computational cost and storage. DH ratchet messages include an encrypted header to convey the new public key and chain metadata securely. Header encryption uses AES-256 in CBC mode for confidentiality, combined with HMAC-SHA-256 for authentication. A header key (HK) and next header key (NHK) are derived via \text{KDF}_{\text{RK-HE}}(\text{RK}, \text{DH output}), producing an 80-byte output: 32 bytes for the AES encryption key, 32 bytes for the HMAC authentication key, and 16 bytes for the (IV). The plaintext header (public key, message number Ns, and prior chain length PS) is encrypted as enc_header = AES-CBC-Encrypt(encryption_key, IV, header), with HMAC computed over associated data and the ciphertext for verification. Upon successful decryption, the receiver rotates HK to the precomputed NHK. The advancement steps integrate these mechanisms during send and receive operations. On sending (RatchetEncrypt), the symmetric sending chain advances: CKs, = KDF_CK(CKs); Ns increments; the message body is encrypted with , and the header (if DH ratchet) is prepared accordingly. On receiving (RatchetDecrypt), if a new DH public key is present, DHRatchet is invoked to update DHr, RK, CKs, and CKr; otherwise, SkipMessageKeys handles any gap to Nr, deriving = KDF_CK(CKr) for the current message, followed by decryption and incrementing Nr. These steps ensure keys evolve progressively, with DH ratchets resetting chains for amplification.

Message Processing

In the Double Ratchet Algorithm, message encryption begins by deriving a message key from the current sending chain key using a , specifically with HMAC-SHA-256, which also advances the chain key to produce a new one for the next message. The 32-byte message key is expanded via HKDF-SHA-256 into an 80-byte value (32-byte AES-256 key, 32-byte HMAC-SHA-256 key, 16-byte ). The payload is then encrypted using AES-256 in mode with padding using the derived key and IV, and an authentication tag is computed using the derived HMAC key, truncated to 128 bits (16 bytes) to ensure integrity. This process is encapsulated in the RatchetEncrypt , which advances the symmetric-key for each outgoing message to generate unique keys, thereby providing for subsequent communications. When sending a , the symmetric is advanced by applying the to the current chain key, optionally triggering a Diffie-Hellman if the receiving chain has been exhausted or if a new key pair is generated to refresh the session. The resulting is paired with a header that includes the sender's current Diffie-Hellman public key (if a DH step is performed), the previous chain length (PN) indicating the position of the prior chain, and the current number (N) denoting the position within the current chain. This header, encoded as associated data, is prepended to the and authenticated alongside the . On the receiving end, the RatchetDecrypt procedure first inspects the header to determine the appropriate chain for decryption; if the message aligns with the current receiving chain, it derives the message key from the chain key using the same , decrypts the with AES-256-CBC, and verifies the HMAC-SHA-256 . Upon successful decryption and authentication, the receiving chain key is advanced via the symmetric step. If decryption fails—due to an outdated chain or —the algorithm attempts to skip ahead in the chain by deriving and storing skipped message keys (up to a limit of MAX_SKIP, typically 1000) in a indexed by the sender's public key and message number, or it performs a DH ratchet if a new public key is present in the header. To handle desynchronization, such as when too many messages are skipped or chains diverge significantly, the receiving party stores provisional skipped keys for potential future decryption; if the skip limit is exceeded or persistent failures occur, the is reset through a new Diffie-Hellman exchange initiated in a subsequent , reestablishing synchronized chains. This mechanism, which leverages the ratchet advancement processes detailed elsewhere, ensures that messages can be processed even in asynchronous environments with delayed or reordered deliveries.

Security Properties

Forward Secrecy and Post-Compromise Security

The Double Ratchet Algorithm provides , ensuring that past messages remain secure even if an adversary compromises a party's long-term keys or current session state at a later time. This property is achieved through the use of ephemeral key pairs in the Diffie-Hellman (DH) ratchet and the symmetric-key ratchet, where new message keys are derived for each transmission using a (KDF) that prevents backward computation. Specifically, old chain keys are deleted after use, making it computationally infeasible to recover prior message keys from subsequently derived ones, as the ratcheting process introduces fresh via one-way functions. In addition to FS, the algorithm ensures post-compromise security (PCS), which allows to be restored for messages following a temporary compromise of a party's state, such as exposure of private keys. This is facilitated by the DH ratchet mechanism, where receiving a with a new public key triggers the generation of fresh root and chain keys from an uncompromised ephemeral private key, effectively evicting the attacker's knowledge and rekeying the session to a clean state. The symmetric-key complements this by advancing chain keys forward in a one-way manner, limiting the attacker's ability to persist beyond the current chain. A key aspect of PCS in the Double Ratchet is its self-healing property, where security recovers automatically after a compromise without requiring explicit intervention, provided the adversary does not actively interfere. If multiple messages are missed due to the compromise, the next successful DH ratchet step—triggered by an incoming message with a new ephemeral public key—overwrites the compromised state with new, unpredictable keys derived from added entropy. This healing occurs after the next DH ratchet step, assuming passive adversary behavior post-exposure. Despite these strengths, the Double Ratchet has limitations in extreme compromise scenarios; furthermore, if chain keys are stolen without a concurrent DH ratchet, an attacker can decrypt messages until the next DH step occurs, highlighting the protocol's reliance on periodic asymmetric advances for full recovery. Compared to a single symmetric-key ratchet, which offers only by advancing keys in one direction but fails to recover from compromises affecting future messages, the Double Ratchet provides stronger PCS through its combination of symmetric and DH ratchets. This dual approach enables bidirectional key evolution and to , allowing the to "heal" and maintain for ongoing communications.

Authentication and Integrity

The Double Ratchet Algorithm provides implicit of messages through keys derived from ratchet chains, which are securely tied to Diffie-Hellman (DH) exchanges between the communicating parties. During initialization and subsequent steps, each party generates ephemeral DH key pairs, and the shared secrets computed from these exchanges are input into key derivation functions (KDFs) to produce chain keys. These chain keys then yield unique message keys for each transmission, ensuring that only the legitimate recipient—who possesses the corresponding private keys and can recompute the shared secrets—can derive the correct message key and decrypt the content. This mechanism authenticates the sender implicitly, as an adversary lacking the private keys cannot forge valid message keys without solving the DH problem. Explicit integrity protection is achieved using schemes, specifically AES-128 in mode combined with -SHA256 message authentication codes (s) applied to the and associated data such as the message number. The sender computes the MAC over the encrypted message and includes it in the message structure; upon receipt, the recipient verifies the MAC using the derived message key before decryption. If the MAC fails , decryption is aborted, preventing the of modified or tampered messages. This construction ensures resistance to alterations during transmission, with the HMAC providing under the second preimage property of SHA-256. Additionally, the protocol's design avoids long-term signatures on individual messages, enabling : a party can deny authorship of a message since anyone with temporary access to the session keys could generate a valid transcript indistinguishable from one produced by the claimed sender. Replay attacks are thwarted through the use of message counters embedded in headers and the one-way nature of the process. Each includes a sequential message number () and the length of the previous chain (), allowing the recipient to track the expected order and detect duplicates or out-of-sequence deliveries. Skipped message keys are temporarily stored up to a limit (MAX_SKIP) to handle minor desynchronizations, but the ratchet's forward progression—advancing chain keys irreversibly via KDFs—prevents key reuse even if counters are manipulated. The server's role is limited to relaying opaque between endpoints without access to any cryptographic keys, thereby preserving end-to-end and ensuring that intermediaries cannot inspect, modify, or forge content.

Formal Analyses and Proofs

Early Security Models

The initial formal security analysis of the Double Ratchet Algorithm appeared in the 2016 specification document, with informal discussions of (FS) and post-compromise security (PCS). These discussions relied on the irreversibility of the ratcheting operations, asserting that the one-way nature of the key derivation functions and Diffie-Hellman exchanges prevents an adversary from recovering prior session keys even after compromising long-term secrets or current states. Specifically, the symmetric-key ratchet ensures that advancing the chain discards previous keys, while the Diffie-Hellman ratchet introduces fresh that cannot be reversed, thereby limiting compromise to future messages only. In 2017, Cohn-Gordon, Cremers, and colleagues conducted the first symbolic analysis of the , including its Double Ratchet component, using the ProVerif tool to model it as a multi-stage in an asynchronous setting. Their model proved under the assumption of honest Diffie-Hellman oracles, demonstrating that past s remain secure against adversaries controlling the network and compromising endpoints at any time. However, the analysis highlighted gaps in modeling asynchronous environments, where reordering or delays could affect forward security due to stored keys if an adversary exploits skipped ratchet steps before a compromise. The work emphasized session uniqueness by modeling each ratchet advancement as generating distinct, unlinkable keys, but noted that the symbolic abstraction simplified assumptions about delivery, potentially overlooking real-world desynchronization. Building on these foundations, Dodis et al. in 2019 introduced modular computational security notions tailored to the Double Ratchet, defining it within a multi-stage adversary framework that captures continuous key evolution. They proved security under the Decisional Diffie-Hellman (DDH) assumption, establishing key independence where each message key is indistinguishable from random and independent of prior or future keys, even against adaptive corruptions. This model formalized session uniqueness by treating ratchet chains as ephemeral sessions, ensuring that compromised states do not link across chains due to fresh Diffie-Hellman inputs. Nonetheless, early proofs, including theirs, inadequately addressed message gaps—scenarios where skipped messages lead to desynchronized ratchets—potentially weakening PCS if gaps allow adversaries to inject or withhold messages before recovery.

Recent Provable Security Results

In recent years, formal analyses of the Double Ratchet (DR) algorithm have advanced toward more comprehensive security proofs, particularly in the universally composable (UC) framework. A key contribution is the development of the functionality F_DR, which captures the DR's achievement of forward secrecy (FS) and post-compromise security (PCS) against adaptive adversaries in a multi-session setting. This UC definition addresses limitations in prior models by incorporating session identifiers, message ordering, and out-of-order delivery, enabling a modular proof that the DR realizes F_DR assuming the underlying continuous key agreement (CKA) and forward-secure authenticated encryption with associated data (FS-AEAD) primitives are secure. The proof demonstrates that the DR protocol securely handles concurrent sessions and adversary corruption of long-term keys, providing a stronger foundation for composable security in end-to-end encrypted messaging systems. Building on this, analyses have focused on session handling and specific attack models. In a 2023 study using the prover, researchers formally verified the DR's security in the presence of session management layers, identifying potential PCS violations due to session reactivation and skipped messages in asynchronous communication, and proving soundness of fixes against clone attacks. The model accounts for skipped messages and asynchronous communication, showing that the DR maintains and even under adaptive corruptions with proper isolation, though it highlights potential PCS violations if sessions are not properly isolated. This work extends earlier game-based proofs by automating verification for realistic protocol implementations, confirming against a broad class of adversaries. Tight security bounds have also been established in the CKA security model. A 2024 proof demonstrates that the DR's multi-session security reduces tightly to the security of its CKA and FS-AEAD components under one-way security assumptions, with the adversary's advantage bounded by O(q \log q), where q is the number of queries. This bound improves upon looser prior reductions by accounting for key-checking attacks and providing concrete security estimates suitable for practical parameter choices. The analysis assumes standard primitives like Diffie-Hellman and AES-GCM, ensuring the DR's efficiency does not compromise provable guarantees. Logic-based has complemented these efforts by targeting specific threats. A 2025 event verifies the against replay and man-in-the-middle (MITM) attacks using the framework, modeling message flows as events to detect inconsistencies in key derivations and authentications. The confirms that the ratcheting mechanisms prevent unauthorized message injection or decryption, even with desynchronized chains. These classical proofs establish robust security.

Applications and Implementations

In Messaging Protocols

The Double Ratchet Algorithm forms the foundation of the , which has provided for private one-on-one chats and group calls in the Signal messaging application since its initial deployment in 2013. Developed by , the algorithm enables secure key derivation and message encryption between parties, ensuring that only the communicating devices can access conversation content. WhatsApp adopted the , incorporating the Double Ratchet Algorithm, in 2016 to enable for all chats, including one-to-one conversations and group messaging through mechanisms like sender keys that leverage principles; more recently, in compliance with the European Union's , WhatsApp began rolling out features in November 2025, enabling end-to-end encrypted messaging with select third-party applications such as BirdyChat and Haiket. This rollout secured communications for over a billion users by default, applying the algorithm to text, voice, and media exchanges. Facebook Messenger integrated the Double Ratchet via the Signal Protocol in its Secret Conversations feature launched in 2016, allowing users to opt into end-to-end encrypted private messaging with features like self-destructing messages. The implementation ensures that encrypted sessions remain secure even across devices, with keys managed solely by the endpoints. Other applications have similarly incorporated the Double Ratchet for robust encryption: enabled it by default in version 6.0 released in 2016 for one-on-one and group interactions; began using it for chats in 2021, providing default on ; and Wire employs a variant called , based on the Double Ratchet, for secure team and personal communications since its 2015 launch. The algorithm also supports federated environments, such as the Matrix protocol, where bridges adapt the Double Ratchet from Signal integrations to enable secure, decentralized cross-network messaging without compromising encryption. This flexibility allows the Double Ratchet to facilitate interoperability in open ecosystems while maintaining its core security guarantees. The adoption across these platforms stems from the algorithm's proven forward secrecy and post-compromise security properties.

Adoption and Performance Considerations

The Double Ratchet Algorithm has achieved widespread adoption in end-to-end encrypted messaging systems, serving billions of users globally through major applications. , which integrates the incorporating the Double Ratchet, reported over 3 billion monthly active users as of March 2025. Signal, the protocol's originator, maintains approximately 70 million monthly active users in 2025. Open-source libraries implementing the algorithm, such as libsignal, are available in languages including and , enabling developers to integrate it into diverse platforms and applications. The algorithm demonstrates efficient performance in real-world deployments, with symmetric ratcheting operations imposing minimal computational overhead suitable for resource-constrained devices. Diffie-Hellman ratcheting, however, introduces higher during periodic due to the cost of computations, potentially impacting user experience in high-volume messaging scenarios. Key in Double Ratchet-based systems presents practical challenges, as prekeys must be stored on central servers to facilitate asynchronous messaging, exposing metadata about user relationships and communication patterns to potential leaks or . Frequent ratcheting for also contributes to battery drain on devices through repeated cryptographic derivations, necessitating optimizations in implementations. For interoperability, the Double Ratchet has informed the design of the (MLS) protocol (RFC 9420, 2023) that extends ratcheting mechanisms to support secure group messaging across different services. Regarding vulnerabilities, the core Double Ratchet Algorithm has withstood extensive without major breaks. Implementations remain at risk of side-channel attacks, including timing vulnerabilities in the key derivation function, which require constant-time coding practices to mitigate.

Post-Quantum Extensions

Introduction to SPQR

The Sparse Post-Quantum Ratchet (SPQR) was announced by Signal on October 2, 2025, as a novel extension to the aimed at providing quantum-resistant security enhancements. This third ratchet layer builds upon the existing Double Ratchet framework by incorporating to address vulnerabilities posed by threats, such as the potential for adversaries to harvest encrypted data today and decrypt it later using advanced quantum algorithms. SPQR employs CRYSTALS-Kyber, standardized as ML-KEM by NIST, for post-quantum key encapsulation mechanisms (KEMs). This integration forms a hybrid-secure system where ML-KEM handles the quantum-safe key exchanges within the , ensuring that session keys remain protected even against quantum adversaries capable of breaking classical . The design features a chunked structure, which divides large key material into smaller chunks using codes (e.g., the 1184-byte encapsulation key into 37 chunks and the 1088-byte into 34 chunks, requiring any 10 for ) to facilitate efficient and . Complementing this, sparse advancements optimize bandwidth by incrementally sending key components—starting with minimal initial data (e.g., 64 bytes) followed by parallel bulk transfers—thereby minimizing the overhead of frequent quantum key generation, which can be computationally intensive. The primary goals of SPQR are to deliver quantum-safe (FS) and (PCS), protecting message chains from both future quantum decryption of past sessions and recovery from device compromises. By infrequently to balance robust security and practical performance, SPQR reduces communication costs while maintaining hybrid security guarantees against harvest-now-decrypt-later attacks. This approach ensures that the protocol remains efficient for real-world messaging applications without sacrificing the core principles of the original Double Ratchet in the quantum era.

Integration and Benefits

The integration of the Sparse Post-Quantum Ratchet (SPQR) into the Double Ratchet Algorithm forms a Triple Ratchet structure, which combines the original symmetric-key ratchet, the Diffie-Hellman (DH) ratchet, and the new component. Outputs from these three ratchets are mixed using the key derivation function to produce hybrid encryption keys, ensuring that the resulting security inherits the strengths of both classical and post-quantum mechanisms. This hybrid approach maintains the forward secrecy (FS) and post-compromise security (PCS) properties of the Double Ratchet while adding quantum resistance. SPQR integrates by running in parallel with the Double Ratchet to form a Triple Ratchet structure, where the outputs from the symmetric-key , DH ratchet, and are mixed using . It employs ML-KEM for post-quantum key encapsulation in addition to the elliptic curve Diffie-Hellman exchanges. During ratchet steps, the sender encapsulates a using the recipient's ML-KEM public key, which is included in message headers, and the recipient decapsulates to derive the corresponding key material. This process occurs sparsely—only on select messages—to balance security and efficiency, with the encapsulated and associated data enabling continuous quantum-secure key agreement. The primary benefits of this integration include provable quantum-resistant FS and PCS, grounded in the IND-CCA2 security of ML-KEM, which protects against chosen-ciphertext attacks even in the presence of quantum adversaries. Additionally, the design ensures with the classical Double Ratchet mode through a downgrade mechanism, allowing legacy clients to interoperate without immediate upgrades. This hybrid setup provides a gradual transition to post-quantum security without disrupting existing deployments. SPQR was rolled out in the Signal messaging app by late 2025, enhancing for millions of users against potential quantum threats. A production-ready implementation is available on , facilitating adoption in other protocols. One notable drawback is the increased size of message headers due to ML-KEM public keys and ciphertexts, approximately 1 each for ML-KEM-768 parameters (1184 bytes for encapsulation keys and 1088 bytes for ciphertexts). This overhead is mitigated by SPQR's sparse , which limits full updates to infrequent intervals, and techniques like chunking and erasure codes to reduce bandwidth impact during transmission.

References

  1. [1]
    Signal >> Specifications >> The Double Ratchet Algorithm
    The Double Ratchet algorithm is used by two parties to exchange encrypted messages based on a shared secret key. Typically the parties will use some key ...KDF chains · Symmetric-key ratchet · Diffie-Hellman ratchet · Double Ratchet
  2. [2]
    [PDF] The Double Ratchet Algorithm - Signal
    The Double Ratchet algorithm was designed by Trevor Perrin and Moxie Mar- ... The authors of these papers, Benedikt Auerbach, Yevgeniy Dodis, Daniel Jost,.
  3. [3]
    [PDF] A More Complete Analysis of the Signal Double Ratchet Algorithm
    The goal of the double ratchet is to provide distinct message keys to encrypt/decrypt each new message. For each message the same message key is derived by ...<|control11|><|separator|>
  4. [4]
    [PDF] On the Tight Security of the Double Ratchet - Cryptology ePrint Archive
    Firstly, a continuous key agreement (CKA) scheme, which captures the asymmetric ratchet of the Double. Ratchet and generalises its continuous Diffie-Hellman key ...
  5. [5]
    Signal >> Blog >> Advanced cryptographic ratcheting
    Nov 26, 2013 · A ratcheting protocol that combines the best of a DH ratchet's “future secrecy” properties with the optimal “forward secrecy” properties from a hash ratchet.Missing: Double Algorithm
  6. [6]
    The New TextSecure: Privacy Beyond SMS - Signal
    Feb 24, 2014 · Today's release of TextSecure is the final step in the transition from a private SMS app to a private asynchronous IM app that does not depend on SMS/MMS.
  7. [7]
    Signal on the outside, Signal on the inside
    Mar 30, 2016 · We're renaming Axolotl to Signal Protocol. The implementations have been renamed, so there are open source Signal Protocol libraries available.
  8. [8]
    Open Whisper Systems partners with WhatsApp to provide end-to ...
    Nov 18, 2014 · For the past three years, we've been developing a modern, open source, strong encryption protocol for asynchronous messaging systems, designed ...
  9. [9]
    [PDF] Off-the-Record Communication, or, Why Not To Use PGP
    We present a protocol for secure online com- munication, called “off-the-record messaging”, which has properties better-suited for casual conversation than do ...
  10. [10]
    RFC 9420: The Messaging Layer Security (MLS) Protocol
    The protocol uses "ratchet trees" for deriving shared secrets among a group of clients. · Ratchet trees allow a group to efficiently remove any member by ...
  11. [11]
    trevp/double_ratchet: Double Ratchet Algorithm - GitHub
    Double Ratchet Algorithm. Contribute to trevp/double_ratchet development by creating an account on GitHub.Missing: contributions | Show results with:contributions
  12. [12]
    [PDF] Security Notions, Proofs, and Modularization for the Signal Protocol
    Mar 27, 2019 · At its core it uses the concept of “double ratcheting,” where every message is encrypted and authenticated using a fresh symmetric key; it has ...
  13. [13]
    [PDF] The X3DH Key Agreement Protocol - Signal
    Nov 4, 2016 · This document describes the “X3DH” (or “Extended Triple Diffie-Hellman”) key agreement protocol. X3DH establishes a shared secret key ...Missing: original | Show results with:original
  14. [14]
    Specifications >> The X3DH Key Agreement Protocol - Signal
    Nov 4, 2016 · X3DH establishes a shared secret key between two parties who mutually authenticate each other based on public keys.Missing: original | Show results with:original
  15. [15]
  16. [16]
    [PDF] A Formal Security Analysis of the Signal Messaging Protocol
    Oct 27, 2016 · TextSecure's combined ratchet was referred to as the “Axolotl Ratchet ... two asymmetric ratchets in a single Double Ratchet protocol. This ...
  17. [17]
    A Formal Security Analysis of the Signal Messaging Protocol
    Oct 27, 2016 · We conduct a formal security analysis of Signal's initial extended triple Diffie-Hellman (X3DH) key agreement and Double Ratchet protocols as a multi-stage ...Missing: ProVerif | Show results with:ProVerif
  18. [18]
    The Double Ratchet: Security Notions, Proofs, and Modularization ...
    Oct 30, 2018 · At its core it uses the concept of double ratcheting, where every message is encrypted and authenticated using a fresh symmetric key.
  19. [19]
    A More Complete Analysis of the Signal Double Ratchet Algorithm
    Mar 18, 2022 · In this work, we develop a new Universally Composable (UC) definition F_DR that we show is provably achieved by the DR protocol.
  20. [20]
    [PDF] Formal Analysis of Session-Handling in Secure Messaging - USENIX
    Aug 9, 2023 · For instance, the Double Ratchet (DR) protocol is a core com- ponent of the Signal protocol library, and is used by many secure messaging apps ...
  21. [21]
    On the Tight Security of the Double Ratchet - Cryptology ePrint Archive
    Oct 10, 2024 · We show that multi-session security of the Double Ratchet can be tightly reduced to the multi-session security of CKA and FS-AEAD, capturing the same strong ...
  22. [22]
    Formal Analysis of Ratchet Protocols Based on Logic of Events - MDPI
    Ratchet protocols are a class of secure protocols based on ratcheting encryption mechanisms, widely employed in instant messaging. Against the backdrop of ...
  23. [23]
    end-to-end encryption - WhatsApp Blog
    Apr 5, 2016 · End-to-end encryption on WhatsApp means only the sender and receiver can read messages, and it's on by default for all communication.
  24. [24]
    [PDF] Messenger Secret Conversations Technical Whitepaper - Facebook
    May 18, 2017 · Messages in Secret Conversations are encrypted end-to- end between the sender and the recipient using the Signal Protocol and its open-source ...
  25. [25]
    Facebook Messenger deploys Signal Protocol for end-to-end ...
    Jul 8, 2016 · Facebook Messenger has started rolling out Secret Conversations, a feature that enables end-to-end encryption for conversations within Messenger.
  26. [26]
    Signal partners with Microsoft to bring end-to-end encryption to Skype
    Jan 11, 2018 · Private Conversations in Skype will allow more users to take advantage of Signal Protocol's strong encryption properties for secure communication.
  27. [27]
    [PDF] Viber Encryption Overview
    Starting with Viber 6.0, all of Viber's core features are secured with end-to-end encryption: calls, one-on-one messages, group messages, media sharing and ...Missing: 2016 | Show results with:2016
  28. [28]
    Use end-to-end encryption in Google Messages
    End-to-end encryption works for both 1:1 chats and groups when all conversation participants use Google Messages with RCS chats turned on.
  29. [29]
    EMS launches fully managed Matrix bridging for Signal - Element
    Oct 6, 2021 · The bridge also breaks end-to-end encryption for the bridged rooms as it needs to adapt Signal's Double-Ratchet to Matrix's Olm/Megolm. Only ...
  30. [30]
  31. [31]
    Signal User Statistics: How Many People Use Signal? - Backlinko
    Jun 23, 2025 · Signal has 70-100 million monthly active users. Signal app downloads reached 193.8 million as of early June 2025. Signal has 50 full-time ...
  32. [32]
    signalapp/libsignal: Home to the Signal Protocol as well as ... - GitHub
    The underlying implementations are written in Rust: libsignal-protocol: Implements the Signal protocol, including the Double Ratchet algorithm. A replacement ...Issues 8 · Security · Pull requests 0 · Actions
  33. [33]
    draft-ietf-mls-protocol-20 - The Messaging Layer Security (MLS ...
    In this document, we specify a key establishment protocol that provides efficient asynchronous group key establishment with forward secrecy and post-compromise ...
  34. [34]
    [PDF] Towards Leakage-Resilient Ratcheted Key Exchange
    Feb 25, 2025 · and exploring alternate notions of leakage and performance/security trade-offs. ... The Double Ratchet Al- gorithm. https : / / signal ...
  35. [35]
    Signal Protocol and Post-Quantum Ratchets
    Oct 2, 2025 · After its publication in 2013, the open source Signal Protocol was adopted not only by the Signal application but also by other major messaging ...
  36. [36]
    Triple Ratchet: A Bandwidth Efficient Hybrid-Secure Signal Protocol
    Jan 17, 2025 · In this work we design a new Signal-based, hybrid-secure secure messaging protocol, which significantly reduces the communication complexity of PQ3.Missing: SPQR | Show results with:SPQR
  37. [37]
    Signal >> Specifications >> The ML-KEM Braid Protocol
    Sep 26, 2025 · While messaging protocols such as the Double Ratchet [2] provide ratcheted message authentication through the use of AEAD or explicit MACs on ...
  38. [38]
    Provides SPQR, a chunked post-quantum ratchet usable in ... - GitHub
    SPQR is a Rust implementation of Signal's post-quantum secure ratchet protocol. It can be used with a messaging protocol to provide post-quantum Forward ...