Museum chapter · Cryptography
In 1882, Frank Miller described a way to protect telegraph messages using secret numbers that were never reused. In 1919, Gilbert Vernam received a patent for a system that combined each telegraph signal with a signal from a key tape. The receiver used a matching tape to recover the original message. Read the historical research on Miller’s 1882 method or see Vernam’s original patent.
Try the idea with a coin. Flip it four times. Write 0 for heads and 1 for tails. If the coin is fair and the flips are independent, every four-bit sequence has the same chance of appearing. Now imagine you could use those four bits to hide a message. What would someone learn if they intercepted it?
Try it with four bits
Your message is 1010 and your secret key is 0110. Compare the bits one at a time. Write 0 when they match and 1 when they differ. This operation is called XOR. The result is 1100, the encrypted message.
The recipient combines 1100 with the same key, 0110, and gets 1010 back. An interceptor who sees only 1100 has no way to tell whether the message was 1010, encrypted with 0110, or 0011, encrypted with 1111. Every possible four-bit message has exactly one key that produces the same intercepted result.
Why the pad is used once
This is the idea behind a one-time pad. To keep the message perfectly secret, the key must be uniformly random, independent of the message, at least as long as the message, kept secret, and used only once. The receiver needs a copy of that secret key, which becomes impractical as messages grow.
Try reusing 0110 to encrypt 0011. You get 0101. Now combine the two encrypted messages, 1100 and 0101. The key cancels out, leaving 1001, which tells the interceptor exactly where the original messages differed. If they know one of the messages, they can recover the other.
Can someone change the message?
Go back to the four-bit message. An interceptor who cannot read it can still change a bit in transit. With this simple XOR scheme, every bit they flip in the ciphertext also flips in the recovered message. Secrecy and integrity are two separate jobs.
Try it: change 1100 to 1101. What does the recipient get?
Combining 1101 with the original key 0110 gives 1011. The last bit changed. The one-time pad gives the recipient no signal that anything went wrong.
Where computers get their randomness
A computer can collect uncertainty from a source such as electronic noise. A cryptographic random generator uses that input to produce bits for tasks such as generating keys. Its output must be hard to predict even when an observer knows how the generator works. A sequence can look irregular and still be easy to predict if it was generated from a known value.
Cloudflare’s wall of lava lamps
In Cloudflare’s San Francisco lobby, a camera watches a wall of lava lamps. As the wax heats up and cools, blobs rise, stretch and split. Their shapes are hard to predict from one frame to the next. The camera also picks up tiny variations from its own sensor.
Cloudflare calls this system LavaRand. It mixes data from the camera with randomness from its computers. The lamps add an independent source of uncertainty to the generators that produce random values for cryptography. A blob in a lamp never becomes a key by itself. Read how Cloudflare built LavaRand.
From the coin toss to HTTPS
You enter a URL in your browser. The browser has never met this server, and the two of them need a way to talk privately. A typical new HTTPS connection using TLS 1.3 brings together three jobs.
Agree on a secret. The browser and server exchange public information and use it to derive shared secrets. Someone who merely records the exchange should be unable to derive those same secrets.
Check the server’s identity. The browser checks that the server’s certificate is valid for the hostname and chains back to a trusted authority. The server signs part of the handshake to prove it holds the private key associated with that certificate.
Protect the conversation. Both sides derive keys for the connection. When they send HTTP data, authenticated encryption keeps the contents private and adds a tag that lets the receiver detect changes. A record whose tag fails verification is rejected.
Try it: if the certificate is valid for a different hostname, what should the browser do?
It should reject the connection as a trusted connection to the name you typed. The certificate check answers a specific question: whether this server can authenticate itself for that hostname. It does not tell you whether the site’s claims are true.
Explore the museum’s history of SSL, TLS and the browser padlock. For the protocol itself, see RFC 8446, the TLS 1.3 specification.
What quantum computing changes
The HTTPS handshake brings public-key and symmetric cryptography together. Quantum computing changes the security of these two parts in different ways.
A quantum computer manipulates qubits. For some problems, a quantum algorithm makes useful patterns easier to detect. On a sufficiently large, reliable quantum computer, Shor’s algorithm could solve the mathematical problems behind RSA and today’s elliptic-curve cryptography. That would threaten key exchange and digital signatures built on those methods, even when their keys were generated with good randomness.
Symmetric encryption faces a different problem. Grover’s quantum algorithm can reduce the work of searching for a key in theory, so key length matters. A correctly used one-time pad goes further. The intercepted bits reveal nothing about the message, even to someone with a quantum computer.
Post-quantum cryptography uses math designed to resist both conventional and quantum attacks. It runs on ordinary computers. One example is ML-KEM, a standard for establishing a shared key across a public connection. That key still needs to be protected, and cryptographic systems still depend on unpredictable randomness. Read the NIST standard for ML-KEM.
Go back to the coin. Suppose someone watched all four flips. With the encrypted message 1100 and the key 0110, they can recover 1010 as easily as the intended recipient. A modern cipher can protect far more data than the length of its key, but it still needs a key that an outsider cannot predict or feasibly guess.
Further reading NIST on sources of entropy and NIST on cryptographic random generators.