X3DH lets someone start an end-to-end encrypted conversation even when the recipient is offline. It combines several Diffie-Hellman exchanges, using public keys prepared in advance, to create shared keying material for the first message. section 10.4.2
The handshake builds on three kinds of keys:
- Identity keys represent users over the long term, but cannot provide forward secrecy by themselves. section 10.4.2
- One-time prekeys are ephemeral public keys uploaded in advance, used once, and deleted afterward to add forward secrecy while the recipient is offline. section 10.4.2
- Signed prekeys provide a fallback when one-time prekeys run out; rotating them periodically limits how long that fallback remains current. section 10.4.2
- The sender retrieves a prekey bundle, performs the relevant exchanges, concatenates their outputs, and passes them through a KDF for the initial message. section 10.4.2
Figure 10.12 Building on figure 10.10, to send a message to Bob, Alice fetches a prekey bundle containing Bob’s long-term key, Bob’s signed prekey, and optionally, one of Bob’s one-time prekeys. After performing different key exchanges with the different keys, all outputs are concatenated and passed into a KDF to produce an output used in a subsequent post-X3DH protocol to encrypt messages to Bob.
Trace the practical flow from fetching a recipient’s prekey bundle through deriving material for the initial encrypted message. section 10.4.2
