First, a Secure Handshake (X3DH)
Before any messages are sent, Signal establishes a shared secret using X3DH. This lets Alice set up a secure channel even if Bob is offline.
- Bob uploads a "prekey bundle" to the server (his Identity Key, a Signed Prekey, and One-Time Prekeys).
- Alice fetches this bundle, generates her own keys, and performs 3-4 Diffie-Hellman (DH) calculations.
- The results are combined to create the very first Root Key.
This simulation starts after X3DH is complete. Alice and Bob now share their first Root Key and are ready to chat.
Alice
Watch the packets fly!
Colored boxes = keys
Watch them animate!
Bob
How It Works
- Symmetric-key Ratchet: Each message advances the sender's Sending Chain Key. The receiver's Receiving Chain advances to decrypt.
- DH Ratchet: When someone replies, they generate a new Diffie-Hellman keypair. This creates a new Root Key, which re-seeds both Sending and Receiving Chains.
- The Result: Forward Secrecy (past messages stay safe) + Post-Compromise Security (future messages heal after a breach).
Event Log
Simulation Ready. It's Alice's turn to talk.
What Makes This Special?
Forward Secrecy
Even if an attacker steals today's keys, they cannot decrypt yesterday's messages. Each message key is derived and then discarded.
Post-Compromise Security
If keys are stolen, the conversation heals itself after a single round-trip. The DH Ratchet introduces fresh entropy from new DH keypairs.
The Future: Post-Quantum Signal
Quantum computers threaten to break today's elliptic-curve cryptography. Signal is ready with PQXDH and the Triple Ratchet:
- PQXDH: Combines quantum-resistant ML-KEM with the existing X3DH in a hybrid design.
- Triple Ratchet: Runs both classic (ECDH) and post-quantum (ML-KEM) ratchets in parallel. An attacker must break both systems.
- Verified From The Start: The new protocol was co-designed with formal verification using tools like ProVerif and F*.