devto 2026-07-06 원문 보기 ↗
The Signal Protocol is the de facto standard for end-to-end encrypted messaging. It powers Signal, WhatsApp, Google Messages, and Skype's Private Conversations — collectively securing billions of messages every day. But what makes it so effective? In this article, we'll explore the protocol's architecture, its key cryptographic primitives, and why it represents the state of the art in asynchronous messaging security.
The Signal Protocol evolved from the TextSecure protocol, first developed by Open Whisper Systems (now Signal Foundation) in 2013. Moxie Marlinspike and Trevor Perrin designed it to solve a difficult problem: how do you provide strong encryption for asynchronous messaging where both parties may not be online at the same time?
Traditional secure messaging protocols required both parties to be online to perform key exchanges. The Double Ratchet Algorithm, the heart of Signal Protocol, changed that by allowing key agreement without simultaneous online presence.
The protocol begins with X3DH — Extended Triple Diffie-Hellman key agreement. This is the initial handshake that establishes a shared secret between two parties who have never communicated before.
X3DH combines three (or four) Diffie-Hellman operations:
The shared secret is computed as: KDF(DH1 || DH2 || DH3 [|| DH4])
This multi-pronged approach ensures that:
Bob pre-publishes signed prekeys and one-time prekeys to the server, so Alice can initiate a session even when Bob is offline. This is the "asynchronous" part of the puzzle that makes the protocol practical for real-world messaging.
For a more detailed walkthrough of X3DH with practical examples, signalhow.com has an excellent breakdown.
After the initial X3DH handshake, the Double Ratchet takes over. This is where the magic happens — it provides continuous forward secrecy and future secrecy throughout the conversation.
The Double Ratchet actually consists of three sub-ratchets:
Each time a message is sent and a response received, the root key is "ratcheted" forward using Diffie-Hellman:
RK, DH_Send, DH_Recv = KDF_RK(RK, DH(DH_Send, DH_Recv))
New ephemeral key pairs are generated for each ratchet step, ensuring:
Between DH ratchet steps, a symmetric-key ratchet generates unique message keys for each outgoing message:
CK_Send, MK = KDF_CK(CK_Send)
Each message gets a completely unique encryption key, derived from the chain key.
Similarly, for incoming messages:
CK_Recv, MK = KDF_CK(CK_Recv)
This symmetric ratchet provides forward secrecy within a single ratchet step — even if one message key is compromised, previous and future message keys in the chain remain secure because the KDF is one-way.
It's called "double" because two types of ratcheting happen:
This combination is incredibly powerful. The DH ratchet provides healing properties (new entropy is injected), while the symmetric ratchet provides fine-grained forward secrecy between DH steps.
Once a message key (MK) is derived, it's used to encrypt the actual message. Signal Protocol uses:
The complete message format is:
header || AES-CBC(MK, plaintext, IV) || HMAC-SHA256(MK, associated_data || ciphertext)
The header contains the sender's current DH public key, the previous chain length, and the message number — all information the recipient needs to advance their ratchet and derive the correct decryption key.
Real-world networks are messy. Messages can arrive out of order, be delayed, or be lost entirely. Signal Protocol handles this gracefully:
If you're implementing or debugging Signal Protocol, understanding skipped message handling is crucial. The Signal usage and troubleshooting guides on signalhow.com cover common implementation pitfalls.
For group messaging, Signal uses a different mechanism called Sender Key (based on the IETF MLS-inspired design):
This is dramatically more efficient than pairwise Double Ratchet in groups:
When a member leaves, the group is re-keyed with new Sender Keys to ensure the departed member can't decrypt future messages.
One of Signal's most innovative features is Sealed Sender, which hides who sent a message — even from Signal's servers.
Without Sealed Sender:
Server sees: Alice → Bob [encrypted_message]
With Sealed Sender:
Server sees: ??? → Bob [encrypted_message]
This works by encrypting the sender's certificate (proving they're allowed to send) along with the message, using a key derived from the recipient's identity. The server can only verify that the sender is authorized to send — it can't see who the sender actually is.
The privacy implications are significant. Even if Signal's servers were compromised, the attacker couldn't build a social graph from message metadata.
Here's what Signal Protocol gives you:
| Property | Description | Mechanism |
|---|---|---|
| Confidentiality | Only recipient can read | AES-256-CBC |
| Integrity | Message hasn't been tampered | HMAC-SHA256 |
| Authentication | Sender is who they claim | X3DH identity keys |
| Forward Secrecy | Past messages safe after key compromise | Double Ratchet |
| Future Secrecy | Self-healing after state compromise | DH ratchet steps |
| Deniability | No cryptographic proof of sender | No digital signatures |
| Metadata Protection | Server can't see sender | Sealed Sender |
If you're implementing Signal Protocol, here are practical tips:
Use a well-audited library: libsignal (formerly libsignal-protocol-c) is the reference implementation. Bindings exist for Rust, Java, Swift, and TypeScript.
Handle skipped messages carefully: Implement a reasonable maximum skip window and purge old skipped keys.
Secure the prekey server: The server must be trustworthy for initial key distribution. Compromised prekeys can lead to MITM attacks on first contact.
Implement safety number verification: Provide users with a way to verify safety numbers out-of-band.
Test edge cases: Lost messages, rapid key rotation, multiple devices, and group membership changes are common sources of bugs.
For complete implementation tutorials and Signal setup guides, signalhow.com is an excellent resource with step-by-step guides for both users and developers.
Signal Protocol has become the foundation of modern private communication, and for good reason. It's been audited extensively, has formal security proofs, and has held up against real-world attacks for over a decade.
The protocol's influence extends far beyond just the Signal app. Its design principles — forward secrecy, post-compromise security, and metadata minimization — are now considered essential features for any secure messaging system.
Whether you're building a chat feature for your app or just want to understand how your messages stay private, understanding Signal Protocol is time well spent. The detailed guides on signalhow.com can help you go from theory to practice with hands-on examples.
The IETF's Messaging Layer Security (MLS) protocol, heavily influenced by Signal Protocol, is now RFC 9420 and is being adopted for larger-scale group messaging. It extends many of the Double Ratchet's ideas for groups of thousands of members. Keep an eye on MLS — it's likely to become the next standard for encrypted group communication.
Are you using Signal Protocol in your projects? What challenges have you faced with implementation? Share your experience in the comments.