Signal
End-to-endThe messenger whose protocol WhatsApp and others build on.
- How
- Signal Protocol with PQXDH (post-quantum since 2023) and the Triple Ratchet (SPQR, 2025).
- Keys
- Only on your devices.
An interactive field guide to encryption
Encryption turns a message into noise that only the right key can turn back. Type below and watch it happen, then explore nearly 4,000 years of secret writing and the systems that guard your chats, your laptop and your bank account today.
Edit a single letter. Its 16-byte block, and every block after it, changes completely.
Chapter 01
Every encryption system has three parts: a message, a method, and a key. The method can be public. Only the key has to stay secret.
Plaintext is the readable message. Ciphertext is the scrambled result. The cipher is the recipe that turns one into the other, and the key is the secret setting that makes your scrambling different from everyone else's.
With the right key, encrypting and decrypting take microseconds. Without it, undoing the scramble should take longer than the age of the universe. That gap is the whole idea.
In 1883 Auguste Kerckhoffs set the rule every modern system still follows: assume the enemy knows exactly how your cipher works. AES, the cipher in the demo above, is published for anyone to study. All of its strength lives in the key. This is Kerckhoffs’s principle.
Alice sends Bob a message across the internet, where Eve can copy anything that passes. Both keys start out the same. Press Send, then change Bob’s key and send again.
writes the message
AES-256 with Alice’s key
Eve copies every byte
with Bob’s key
reads the result
Only the intended people can read it.
Your chats, medical records, the files on your laptop.
Any change on the way is detected.
A bank transfer can’t be edited from 100 to 10,000 in transit.
You know who you are really talking to.
The browser padlock proves the site is really your bank’s domain.
The sender can’t later deny sending it.
Digitally signed contracts and software updates.
Without encryption, anyone on the same café Wi-Fi could read your passwords, a stolen laptop would hand over every file, and a database breach would leak card numbers in the clear. Encryption doesn’t stop the theft. It makes what the thief takes useless.
There are two families of encryption. Symmetric encryption uses one shared key. Public-key encryption uses a pair: a public key that locks and a private key that unlocks. Real apps use both. Step through each to see who holds which key.
All three turn text into gibberish, and people mix them up constantly. Only one of them keeps a secret.
Use each for its job. Encoding makes data safe to transmit, as in email attachments and web addresses. Hashing checks integrity and stores passwords. Encryption keeps secrets.
Chapter 02
Every cipher lasted until someone found its weakness, and every break taught the next generation what not to do. Filter by era, and jump into the labs to try the ciphers yourself.
Chapter 03
Before computers, encryption was done with pencils, discs and machines. Every cipher in this chapter was eventually broken. Breaking them yourself is the fastest way to see what makes modern encryption strong.
A transposition cipher: the letters stay the same but change places. The writer wraps a strip around a rod and writes along it, one row per face. Unwound, the strip shows a jumble. Only a rod of the same thickness lines the letters up again.
Shift every letter a fixed number of places. The outer ring is the plain alphabet and the inner ring the cipher alphabet. Turn the wheel, then attack: with only 25 possible keys, a computer tries them all in an instant.
This message was encrypted with a random substitution: every letter swapped for another. That allows 4 × 1026 possible keys, far too many to try. But English has a fingerprint. E is the most common letter, then T, A and O. Compare the bars, type your guesses into the key below, and look for short words like THE and AND.
A keyword chooses a different Caesar shift for each letter, so the same plain letter turns into different cipher letters. That flattens the frequency fingerprint, and for three centuries people called it unbreakable. Each letter comes from the table: row = key letter, column = message letter.
Below is a long message encrypted with a secret keyword. If the keyword has L letters, every L-th letter was shifted by the same amount. Split the text into L columns and each column is just a Caesar cipher. The right L makes every column look like English again, which shows up as a high index of coincidence: the chance that two random letters from a column match.
A faithful model of the three-rotor Enigma I used by the German army, including ring settings, the plugboard and the famous double-step. Press a key and the current runs through the plugboard, three rotors and a reflector, then back out to light a lamp. The right rotor turns with every key press, so the same letter never encrypts the same way twice in a row. While the machine is on screen you can also type on your own keyboard.
Enigma is its own inverse. Set the same start position, type the ciphertext, and the plaintext lights up. With 3 of 5 rotors and 10 plugboard cables there were about 158,962,555,217,826,360,000 possible daily settings.
The flaw: because of the reflector, a letter can never encrypt to itself. Codebreakers combined that with predictable phrases, such as the weather reports sent every morning, to rule out settings on the Bombe.
Computers encrypt bits. XOR (⊕) outputs 1 when two bits differ and 0 when they match. XOR a message with random key bits and you get ciphertext; XOR again with the same key and the message returns. If the key is truly random, as long as the message and never reused, this is mathematically unbreakable.
XOR rules: 0⊕0=0, 0⊕1=1, 1⊕0=1, 1⊕1=0. Applying the same key twice cancels it out.
During the Cold War some Soviet one-time pad pages were produced twice. US codebreakers in the Venona project exploited the duplicates for decades. Reuse is fatal because XORing two ciphertexts cancels the key, leaving message 1 ⊕ message 2. Guess a likely word in one message and part of the other appears.
Chapter 04
Modern ciphers work on bits instead of letters. They are designed so that no shortcut beats trying every key, and with 2128 possible keys that is hopeless. These are the building blocks inside every secure app.
AES, the Advanced Encryption Standard, protects most of the world’s data. It encrypts 16 bytes at a time, arranged as a 4×4 grid called the state, through 10 rounds for a 128-bit key. Each round applies four simple steps. Step through them and watch your text dissolve.
A good cipher hides every trace of its input. Change one bit of the plaintext and roughly half of the 128 output bits flip, with no visible pattern. Click any square in the plaintext to flip that bit.
AES only encrypts 16-byte blocks, so a mode decides how to handle longer data. ECB mode encrypts every block on its own, so identical blocks produce identical ciphertext. CBC first mixes each block with the previous ciphertext block. Both pictures use real AES-128 with the same key. Draw on the left and watch.
Real systems use modes such as GCM, or CBC with a random IV. Adobe learned this the hard way in 2013: its leaked user database stored passwords with 3DES in ECB mode, so everyone with the same password had the same ciphertext.
How can two strangers agree on a secret key while Eve hears every word? Whitfield Diffie and Martin Hellman published the answer in 1976. The classic explanation uses paint: mixing colours is easy, but separating a mixture back into its parts is practically impossible.
Swap paint for modular arithmetic. Computing ga mod p is quick. Working backwards from the result to a, the discrete logarithm problem, is hopeless when p is hundreds of digits long.
Real systems use primes over 600 digits long, or elliptic curves such as X25519 that give the same protection with 32-byte keys. Every HTTPS connection and every WhatsApp chat starts with Diffie–Hellman exchanges like this one.
RSA rests on one fact: multiplying two primes is instant, but splitting the product back into its primes is extremely hard when the numbers are hundreds of digits long. Build a tiny key pair, use it, then break it.
Tiny keys fall instantly. How fast does the work grow? This page times a simple factoring method on bigger and bigger numbers.
Serious attackers use the far smarter number field sieve. From 2020 the record was RSA-250, an 829-bit number that took about 2,700 CPU core-years. In September 2026 it fell twice: RSA-260 (862 bits) on the 3rd and RSA-896 (896 bits) on the 19th, both run on idle data-centre GPUs with software written with help from AI agents. RSA-896 took about 30 GPU-years. Standard 2048-bit keys remain far out of reach of classical computers, but 1024-bit keys now look within reach of anyone with a large GPU fleet.
A hash turns any input into a fixed 256-bit fingerprint. The same input always gives the same fingerprint, a tiny change gives a completely different one, and there is no way back. That makes hashes ideal for checking downloads and storing passwords.
A site should never store your password, only a hash of it. When you log in, it hashes what you typed and compares. Adding a random salt for each user and a deliberately slow hash makes a stolen database very expensive to crack.
Chapter 05
You use encryption hundreds of times a day without noticing. Here is what actually happens inside three systems you have probably used today, followed by a tour of the rest.
WhatsApp uses the Signal Protocol. Each phone makes its own keys and the server only relays ciphertext. Every message gets a brand-new key from a ratchet, and each key is deleted after use. This demo really encrypts with AES-256-CBC and HMAC-SHA256, the building blocks named in WhatsApp’s security white paper. Send a few messages from either phone, then try the attacks below.
This is everything the server gets: sender, recipient, time and a blob of ciphertext.
What stays private: message text, photos, voice notes, calls and statuses. Group chats use sender keys, so one encrypted copy fans out to every member. Chat backups can be end-to-end encrypted too, with a password, a 64-digit key or, since late 2025, a passkey. WhatsApp also checks security codes automatically through a system called key transparency.
What doesn’t: end-to-end encryption hides content, not metadata. The service can still see who you talk to, when and how often. It also can’t protect messages on a phone that is unlocked in someone else’s hands, or backups you left unencrypted.
BitLocker encrypts an entire Windows drive, so a stolen laptop is a useless brick. Since Windows 11 version 24H2, clean installs on most modern PCs switch on Device Encryption, a simplified BitLocker, automatically. The clever part is unlocking: a security chip called the TPM hands over the key only if the start-up process looks exactly as it did when the key was sealed.
Sectors 2 and 5 hold identical data. The XTS mode mixes each sector’s number into its encryption, so once encrypted they look completely different.
48 digits in 8 blocks. Each block is a multiple of 11, a built-in typo check.
Defaults: software BitLocker uses XTS-AES-128. New PCs with crypto-offload chips (starting with Intel Core Ultra series 3) use hardware-accelerated BitLocker with XTS-AES-256, and keep the bulk key wrapped in hardware so it never sits in normal memory.
Know where your recovery key is. A firmware update, a TPM reset or moving the drive can all trigger the recovery screen. If the key was saved to your Microsoft account, it is listed there. Without it, the data is gone for good. That is the point.
Every time you see the padlock, your browser and the server have just run this handshake. In a single round trip they agree on fresh keys and the server proves who it is. Step through it, and turn on Eve’s view to see what someone on the same café Wi-Fi learns.
The same few building blocks appear everywhere. The key question for any service is who holds the keys. With end-to-end encryption, only the people talking do. With encryption “at rest”, the company holding your data usually holds the keys too.
The messenger whose protocol WhatsApp and others build on.
Apple’s messaging and calls between Apple devices.
The modern replacement for SMS.
Meta’s chat app.
iPhone Data Protection and Android file-based encryption.
The Mac equivalent of BitLocker.
The link between your device and the router.
An encrypted tunnel to a VPN server.
One vault for all your logins.
Sign-in without passwords.
Tap to pay.
Google Drive, OneDrive, Dropbox and similar, by default.
Gmail, Outlook and friends.
Ownership, not secrecy.
Eight ordinary moments, and what an attacker would get from each. Flip the switch to imagine a world without encryption.
Thief copies the storage chip: 9f3a 71c0 e2d8 … unreadableThief copies the storage chip: every photo, chat and saved password
Server sees: 1 message, 212 bytes of ciphertextServer sees: “Running late. The house key is under the mat.”
Snooper sees: news.example, 2.1 MB, encryptedSnooper sees: every page, search and form you submit
Network sees: your bank’s domain and traffic sizesNetwork sees: account number, balance and password
Skimmer gets: a one-time code, useless if replayedSkimmer gets: your card number, ready to clone
Fake site gets: a signature valid only for the real site, only nowFake site gets: a reusable password
Data-centre intruder finds: encrypted blobsData-centre intruder finds: every photo in full resolution
Thief gets: a drive full of noiseThief gets: every file, copied in minutes
Chapter 06
Modern encryption is rarely broken by mathematics. Attackers go after short keys, weak passwords, buggy code and human mistakes instead.
Every extra bit doubles the number of possible keys. Pick a key length and an attacker to see how long an average search takes. On average the right key turns up halfway through.
Passwords are the weakest key in most systems because people choose them. Type one for a rough estimate; it never leaves this page. Attackers try common passwords, words and patterns first, so the estimate penalises them.
Her cipher swapped letters for symbols and fell to frequency analysis. Her decrypted letters approving the Babington plot led to her execution.
LessonA weak cipher can be worse than none. It made her write openly.
The machine was strong but its operators were predictable: repeated message keys, stock phrases, and a design where no letter could stand for itself.
LessonProcedures and people are part of the cipher.
Under wartime pressure, Soviet one-time pad pages were duplicated. US analysts spent decades matching the reused pages and exposed spy networks.
Lesson“Unbreakable” only holds if you follow every rule.
The first Wi-Fi security standard combined the RC4 cipher with short, repeating 24-bit values. Researchers broke it in 2001, and later tools cracked networks in minutes.
LessonA good cipher can fail inside a bad protocol.
About 150 million accounts leaked. Passwords were encrypted with 3DES in ECB mode instead of hashed, and password hints sat in plain text beside them. Identical passwords had identical ciphertext, so the hints solved them like a crossword.
LessonHash passwords with a salt. Never just encrypt them.
A missing length check in OpenSSL let anyone read chunks of a server’s memory, including private keys and passwords. A large share of the web’s secure servers had to be patched and their certificates replaced.
LessonThe math was fine. The code wasn’t.
Most real attacks go around encryption entirely: phishing pages that trick you into typing a password, malware that reads the screen before anything is encrypted, weak or reused passwords, and unlocked phones left on tables. The strongest cipher can’t help if the attacker is reading over your shoulder.
Strong encryption protects everyone, including criminals. Governments and privacy advocates have argued about what to do with that fact since the 1990s.
History so far: the US Clipper chip (1993–96) was abandoned after a flaw was found. In 2016 the FBI sought a court order forcing Apple to help unlock a terrorist’s iPhone, then dropped the case after a third party got in. Similar proposals keep returning in the US, UK, EU and elsewhere.
Chapter 07
Real cryptography, running in your browser. These tools use Web Crypto, the engine built into your browser that also secures HTTPS. Nothing you type is sent anywhere.
Seal a message with a password using AES-256-GCM. The key is derived from your password with 600,000 rounds of PBKDF2, which makes guessing slow. Copy the sealed text, send it through any app, share the password another way, and your friend can open it on this page.
A real elliptic-curve Diffie–Hellman exchange on the P-256 curve. Each person generates a key pair. The private halves are created non-extractable, so not even this page’s own code can read them, yet Alice and Bob still compute the same secret.
A real ECDSA signature on P-256, the same kind that signs software updates and TLS certificates. Alice signs with her private key. Anyone with her public key can check it, and any change to the message breaks the signature.
Encoding changes how bytes are written, not who can read them. Every format below can be reversed by anyone.
Chapter 08
A large enough quantum computer would break the public-key cryptography that protects almost everything today. That machine doesn’t exist yet. The switch to quantum-safe encryption has already started.
It factors numbers and solves discrete logarithms fast. That breaks RSA, Diffie–Hellman and elliptic curves, the methods used for key exchange and signatures almost everywhere.
It speeds up brute-force search, roughly halving a key’s effective length. AES-128 would fall to about 64-bit strength in theory. AES-256 stays comfortably safe.
An attacker can record encrypted traffic today and keep it until a quantum computer exists. Secrets that must stay secret for 10 or 20 years are already exposed.
| Algorithm | Used for | Against a large quantum computer | Status in 2026 |
|---|---|---|---|
| RSA | Signatures, older key exchange | Broken | NIST’s draft plan: deprecate after 2030, disallow after 2035 |
| Elliptic curves (X25519, P-256, ECDSA) | Key exchange, signatures, crypto wallets | Broken | Same timeline; being paired with post-quantum algorithms |
| AES-128 | Encrypting data | Weakened | Still acceptable; AES-256 preferred for long-lived secrets |
| AES-256, ChaCha20 | Encrypting data | Safe | Recommended |
| SHA-256, SHA-3 | Hashing | Safe | Recommended |
| ML-KEM (FIPS 203) | Key exchange | Designed to resist | Standard since August 2024; on by default in Chrome, Edge and Firefox; used by Signal and iMessage |
| ML-DSA, SLH-DSA (FIPS 204, 205) | Signatures | Designed to resist | Standards since August 2024; certificates are still migrating |
| HQC | Backup key exchange | Designed to resist | Selected March 2025; final standard pending |
| FN-DSA (Falcon, FIPS 206) | Compact signatures | Designed to resist | Draft standard |
Michele Mosca’s rule of thumb: if the years your data must stay secret (x) plus the years it takes to move to quantum-safe encryption (y) add up to more than the years until a large quantum computer exists (z), you already have a problem. Nobody knows z, so try different guesses.
Chapter 09
Twelve questions covering the whole guide. Each answer comes with a short explanation.
Chapter 10
Terms with a dotted underline anywhere in the guide show these definitions when you hover over or tap them.
Facts checked in September 2026. The simulations are teaching models: the AES, SHA-256, XTS and Enigma engines are checked against official test vectors, while the WhatsApp and BitLocker walkthroughs simplify the real protocols.