Modern Cryptography · 6.3

💬 End-to-End Encryption

How Signal, WhatsApp, and iMessage keep messages from everyone — including themselves⏱ ~2 min

📫E2EE = only the sender and recipient have keys

With regular email, your email provider can read every message. It's like sending postcards — the postal service can read them. End-to-end encryption is like putting your postcard in a locked envelope where only you and the recipient have the key. Not the email server, not the app company, not law enforcement (without your key). Even if the provider is hacked or subpoenaed, they only have encrypted data.

The Signal Protocol

The Signal Protocol (designed by Moxie Marlinspike and Trevor Perrin, 2013) is the gold standard for secure messaging. It is used by Signal, WhatsApp (2B+ users), Google Messages (RCS), and Facebook Messenger. It provides E2EE with Forward Secrecy and Break-in Recovery — properties no previous messaging system had.

PropertyWhat It MeansHow Signal Achieves It
E2EEServer cannot read messagesServer only sees ciphertext; keys never leave devices
Forward SecrecyPast messages safe if key is stolen todayEphemeral ECDH keys ratcheted for every message
Break-in RecoveryFuture messages safe even after compromiseDouble Ratchet algorithm changes keys after every message
DeniabilityRecipient cannot prove to a third party that you sent a messageMessages use ECDH-derived shared secrets, not asymmetric signatures

The Double Ratchet Algorithm

The Double Ratchet combines two key-derivation ratchets that advance with each message:

  • Symmetric Ratchet (KDF Chain): each message derives the next encryption key from the previous one via HKDF. Knowing one key gives forward secrecy for previous messages but not the keys ahead.
  • Diffie-Hellman Ratchet: periodically, both parties perform a new ECDH exchange (using new ephemeral keys sent with messages). This provides break-in recovery — even if one set of keys is compromised, the next DH exchange restores security.
  • Together: every single message has a unique encryption key. Compromise one → the attacker gets that one message. Past messages are protected by forward secrecy. Future messages are protected by break-in recovery.

iMessage, WhatsApp — E2EE vs Backup Pitfalls

⚠ WarningWhatsApp encrypts messages in transit with the Signal Protocol — but by default backs up chats to Google Drive or iCloud in plaintext (or with a key stored by Google/Apple). E2EE is broken by the backup. To maintain true E2EE: enable WhatsApp's End-to-End Encrypted Backup (which generates a local key you must save). iMessage is E2EE on-device but iCloud backup of messages is accessible to Apple unless you enable Advanced Data Protection.
🧠Quick Checkfirst try = +5 XP

End-to-end encryption means…

0 XP🔥 0 days