Consumer Messaging Platform — WhatsApp-Class System  ·  View 12 of 23

End-to-End Encryption Architecture

From device key material through asynchronous session setup to per-message ratcheting — and where the platform sits, which is outside the trust boundary.

Editable source SVG draw.io All views
Device key material
Device key material
Identity Key Pair
Curve25519, long lived
Identity Key Pair...
Signed Prekey
Rotated weekly
Signed Prekey...
One-time Prekeys
100 per device
One-time Prekeys...
Key distribution
Key distribution
Key Distribution Service
Public keys only
Key Distribution Service...
Prekey Store
Consumed once
Prekey Store...
Safety Number
Out-of-band verify
Safety Number...
Session setup
Session setup
X3DH Handshake
Works while offline
X3DH Handshake...
Root & Chain Keys
Root & Chain Keys
Message encryption
Message encryption
Double Ratchet
New key per message
Double Ratchet...
Sender Key
Group messages
Sender Key...
Media Key
Per blob, AES-256
Media Key...
Transport
Transport
Ciphertext + Header
Ratchet counters
Ciphertext + Header...
Platform
Cannot decrypt
Platform...
Recipient
Recipient
Plaintext in Secure Store
SQLCipher on device
Plaintext in Secure Store...
Ratchet Step
Out-of-order tolerant
Ratchet Step...
key change warning
key change warning
End-to-End Encryption Architecture
End-to-End Encryption Architecture
Security / platform
Security / platform
Application we own
Application we own
Data store
Data store
External / third party
External / third party
failure / alternate
failure / alternate
The platform holds no private key and no plaintext at any point on this path.
The platform holds no private key and no plaintext at any point on this path.
v 1.0 · owner Platform Architecture · date 2026-08
v 1.0 · owner Platform Architecture · date 2026-08
Text is not SVG - cannot display

Protocol choices

  • X3DH for asynchronous session setup so a peer need not be online
  • Double Ratchet for forward secrecy and post-compromise recovery per message
  • Sender Keys for groups, media keys per blob, all under the same identity key

Key management

  • Identity keys are long-lived and hardware-backed where the device supports it
  • Signed prekeys rotate weekly; one-time prekeys are consumed once and replenished
  • Key Distribution stores public material only and can be fully rebuilt from devices

Threat position

  • A full compromise of the platform yields ciphertext and metadata, not messages
  • Safety numbers give users an out-of-band check against a key substitution attack
  • A key change raises a visible warning rather than being silently accepted