0Pricing
Cryptology Academy · Lesson

End-to-End Encryption in Modern Messaging

Examine the Signal Protocol that powers WhatsApp and Signal — forward secrecy, ratchets, and sealed sender.

End-to-End Encryption in Modern Messaging is a free Cryptology Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Signal Protocol Overview

The Signal Protocol is the cryptographic foundation behind Signal, WhatsApp, and other secure messengers. It combines two algorithms: X3DH for establishing an initial shared secret when the recipient is offline, and the Double Ratchet for deriving a new encryption key for every single message. The result is strong confidentiality and forward secrecy that is transparent to the user.

X3DH: Extended Triple Diffie-Hellman

X3DH allows two parties to establish a shared secret even when one is offline. It uses four Diffie-Hellman computations combining long-term identity keys, medium-term signed prekeys, and one-time prekeys. The server stores prekeys uploaded by the recipient in advance. The sender performs X3DH using those keys, derives a shared secret, and sends an encrypted initial message without waiting for the recipient to come online.

The Double Ratchet Algorithm

After X3DH establishes the initial shared secret, the Double Ratchet takes over for ongoing conversation. It combines a Diffie-Hellman ratchet that advances whenever new DH keys are exchanged, and a symmetric key ratchet that advances with every single message. Each message is encrypted with a unique key that is immediately deleted after use, so capturing one message key does not compromise any other message.

Forward Secrecy in Practice

Forward secrecy means that if an attacker records encrypted traffic today and later compromises your long-term private key, they still cannot decrypt the old messages. The Double Ratchet achieves this because the per-message keys are ephemeral and deleted immediately. Only a device that participated in the conversation at the time can decrypt past messages, and only if it has not deleted them locally.

Break-In Recovery

The Double Ratchet also provides break-in recovery, sometimes called post-compromise security. If an attacker momentarily compromises a device and reads its current keys, the next DH ratchet step will generate new keys that the attacker cannot predict. Future messages become secure again without any manual intervention, unlike systems where a single key compromise exposes all subsequent messages.

WhatsApp Adopts Signal Protocol

In 2016 WhatsApp completed a full rollout of Signal Protocol end-to-end encryption across all its platforms, covering over one billion users at the time. This was the largest deployment of end-to-end encryption in history. The integration was developed in partnership with Open Whisper Systems, the organisation behind Signal. WhatsApp's implementation was independently audited and confirmed correct.

Sealed Sender: Hiding Message Metadata

Even with encrypted content, the Signal Protocol originally revealed to the server who was sending messages to whom. Sealed sender is an extension that encrypts the sender identity inside the message envelope. The server only knows the recipient, not the sender, reducing metadata available to the server or anyone who subpoenas server records. The recipient decrypts the outer envelope to learn who sent the message.

Disappearing Messages and Ephemeral Keys

Disappearing messages add a timer after which messages are deleted from both sender and recipient devices. Combined with the Double Ratchet's ephemeral keys, this means that even forensic examination of a seized device at a later date may find no recoverable plaintext. Signal's Note to Self feature and disappearing message defaults encourage minimal data retention as a privacy practice.

iMessage: A Hybrid Approach

Apple's iMessage uses end-to-end encryption when both parties have iMessage enabled, falling back to SMS when one does not. iMessage stores encrypted message keys in iCloud Keychain, allowing multi-device access but also meaning Apple can technically access messages if compelled and if iCloud backup is enabled. Unlike Signal, iMessage does not use the Double Ratchet, so it lacks the same forward secrecy guarantees.

Why Group Messaging Is Harder to Secure

In a two-party conversation the Double Ratchet is efficient. In a group of N members, every message must be encrypted separately for each member, or a shared group key must be managed. Managing group keys securely is complex: when a member leaves, all remaining members must refresh their keys (known as post-compromise security for groups). The Messaging Layer Security protocol (MLS/RFC 9420) addresses this with logarithmic complexity key updates.

Comparing Signal, WhatsApp, and Telegram

Signal is fully open source, collects minimal metadata, and uses the Signal Protocol throughout. WhatsApp uses Signal Protocol for messages but is owned by Meta and collects significant metadata. Telegram uses a custom MTProto protocol only in Secret Chats; regular chats are not end-to-end encrypted and are stored on Telegram servers. For maximum privacy, Signal with disappearing messages is the recommended choice.

Signal Protocol Properties

What property of the Double Ratchet ensures that capturing one message's key does not expose other messages?

End-to-End Encryption: Key Takeaways

The Signal Protocol combines X3DH for offline key agreement and the Double Ratchet for per-message key derivation. Forward secrecy protects past messages; break-in recovery protects future messages after a compromise. WhatsApp deployed this at scale in 2016. Group messaging requires more complex key management protocols like MLS. Metadata protection requires additional techniques like sealed sender.

Frequently asked questions

Is the “End-to-End Encryption in Modern Messaging” lesson free?

Yes — the full text of “End-to-End Encryption in Modern Messaging” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “End-to-End Encryption in Modern Messaging”?

Examine the Signal Protocol that powers WhatsApp and Signal — forward secrecy, ratchets, and sealed sender. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “End-to-End Encryption in Modern Messaging” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Email Is Inherently Insecure
  2. PGP and GPG Encryption for Email
  3. S/MIME in Enterprise Email
  4. End-to-End Encryption in Modern Messaging
← Back to Cryptology Academy