💻

Desktop Required

This interactive demo needs a larger screen to display the protocol sequence diagrams and key inspector side-by-side. Please open it on a larger screen.

Signal Protocol Interactive Demo

Mode:
Speed: 1x

Legend

About

Interactive walkthrough of the Signal Protocol's X3DH key agreement and Double Ratchet, for those already familiar with primitives like Diffie-Hellman and authenticated encryption. All cryptography is simulated locally with human-readable keys.

Built for educational purposes. Does not cover post-quantum variants (PQXDH, Triple Ratchet). More features will be added. Please consult the official documentation for reference.

Thanks to Daniel Collins and Loïs Huguenin-Dumittan for their valuable feedback.

Color Coding

Identity Keys (IK)
Signed PreKeys (SPK)
One-Time PreKeys (OPK) / Chain Keys (CK)
Ephemeral Keys (EK) / DH Keys
Root Key (RK)
Message Keys (MK)

Abbreviations

X3DHExtended Triple Diffie-Hellman (key agreement)
DHDiffie-Hellman key exchange
KDFKey Derivation Function
HKDFHMAC-based KDF
AEADAuthenticated Encryption with Associated Data
IKIdentity Key (long-term)
SPKSigned PreKey (medium-term, signed by IK)
OPKOne-Time PreKey (single use)
EKEphemeral Key (per-session)
SKShared Secret (from X3DH)
RKRoot Key (root chain state)
CKChain Key (send/recv chain state)
MKMessage Key (per-message encryption key)
DHsDH ratchet sending key pair (own key)
DHrDH ratchet received key (other party's key)
PNPrevious chain length (for skipped keys)
A
Signal Demo
Turn off Bob's phone
Demo Mode
🔒
Welcome, Alice
Register to generate your identity keys and start end-to-end encrypted messaging with Bob.
This is a dummy registration button to start showing what happens in the protocol. No information is requested from the user. Normally you use a phone number to authenticate yourself to the service provider (Signal/WhatsApp etc.).
B
Bob
Tap to chat
0
🔒 Messages are end-to-end encrypted
Playing...
Key State
Alice's Keys
Not registered
Server Storage
No bundles stored
Bob's Keys
Not registered