What Cryptography Is Trying To Do
August 25, 20265 min readbeginner
Cryptography is the practice of hiding information so that only the person you meant to read it can read it. That is the whole goal.
Cryptography is the practice of hiding information so that only the person you meant to read it can read it. That is the whole goal. Everything else in this chapter is machinery built in service of it.
01.Three people
Cryptographers have told the same story with the same cast since the 1970s, and it is worth adopting because it makes every later question easy to phrase.
Alice wants to send Bob a message. Between them is a channel that is not private. It might be a postal system, a radio link, or a fibre-optic cable running under an ocean. Listening to that channel is Eve, the eavesdropper, who hears every single bit that Alice sends and can store all of it forever.
Alice scrambles her message before sending it. Bob unscrambles it at the other end. Eve, hearing the scrambled version, learns nothing useful. The scrambling is called encryption, the unscrambling is called decryption, and the piece of secret information that makes both work is called a key.
02.The smallest possible example
Here is an encryption scheme you can do in your head. Alice and Bob agree in advance on a number between and . To encrypt, Alice shifts every letter of her message forward by places in the alphabet, wrapping around from Z back to A. To decrypt, Bob shifts every letter back by .
Take and the message HELLO. Shifting H forward by three gives K. E gives H. L gives O. L gives O. O gives R. Alice sends KHOOR.
Bob knows , shifts each letter back by three, and reads HELLO. Eve sees KHOOR and, if she genuinely does not know , sees a five-letter word that could be almost anything.
Notice what the wrap-around is. Shifting Z forward by three has to land on C, which means the alphabet is being treated as the integers modulo . Writing A as and Z as , encryption is
and decryption is
This is the arithmetic from Modular Arithmetic, doing its first job. The cipher itself is ancient and hopelessly weak, since Eve can simply try all twenty-six values of , but its shape is the shape of everything that follows. One key, used by both parties, applied forward to encrypt and backward to decrypt.
03.Symmetric cryptography, and what it needs
A scheme where Alice and Bob use the same key for both directions is called symmetric cryptography, or sometimes shared-key cryptography. The shift cipher is symmetric. So is AES, the algorithm your laptop actually uses, which is enormously stronger but structurally the same in this one respect. There is one key. Both parties have it. Anybody who obtains it can read everything.
Modern symmetric encryption is very good. Nobody expects AES with a 256-bit key to be broken by classical or quantum computers in any timeframe worth planning around. If the only problem in cryptography were scrambling messages, the field would have been finished decades ago.
The problem is the assumption hiding in the phrase agree in advance.
04.The problem symmetric cryptography cannot solve
For Alice and Bob to use a shared key, they must already share it. Somebody has to carry it from one to the other, and that carrying cannot happen over the eavesdropped channel, because Eve would hear the key and then read everything encrypted under it.
In a small closed organisation this is manageable. Two embassies can exchange a book of keys by diplomatic courier once a year. A bank branch can be issued a key when it opens. Historically this is exactly how it was done, with physical delivery of key material by trusted human beings.
Now count how badly that scales. In a group of people where every pair wants to talk privately, each pair needs its own key, so the number of keys is
For that is keys, which is tedious but possible. For it is . For the Internet, where is in the billions and the pairs are not known ahead of time, the number is meaningless. You buy something from a shop whose website you had never heard of ten seconds earlier. No courier visited you. No key was agreed in advance. And yet the connection is private.
So the central puzzle of twentieth-century cryptography is this one sentence:
How can Alice send Bob a key over an open channel that Eve is listening to, without Eve also obtaining the key?
Stated plainly it sounds impossible, and for a long time serious people believed it was. Everything Alice sends, Eve hears. Whatever procedure Alice follows to build a secret with Bob, Eve can follow along, because she has seen every input.
The resolution arrived in the mid-1970s, and it is the subject of the next note. It does not cheat, and it does not depend on Eve being lazy or under-resourced. It depends on there being arithmetic that is easy to do and hard to undo.