Professional Documents
Culture Documents
The Code Book - Simon Singh
The Code Book - Simon Singh
Final summary
The key message in this book:
For hundreds of years, militaries and governments around the world have used
encrypted messages to win wars and hide their secrets; meanwhile, codebreakers
have been honing their craft to decode messages more efficiently. But while
cryptography has a long history, the modern era and computer technology have
completely transformed the practices of both encrypting and deciphering
messages.
THE CODE BOOK – SIMON SINGH
Secret codes developed early on in human history and evolved quickly.
While secret codes might seem like a relatively modern phenomenon, the earliest known form of cryptography, that is,
the practice of concealing the meaning of a message, actually dates back to the fifth century BC! It was at this time that
Greece, faced with the constant threat of being conquered by Persia, realized that secure communication was essential.
The result was cryptography, a field that simultaneously developed two distinct branches: transposition and substitution.
Transposition works by rearranging the letters of a word or sentence to produce a cipher, a secret method of writing. For
instance, the rail fence cipher, a popular form of transposition, alternates the letters of a message in a zigzag pattern that
moves between two consecutive rows.
The other method, substitution, is a system wherein one letter stands for another. For instance, A=V, B=X and so on until
every letter of the alphabet has a substitute pair, thereby forming a cipher alphabet.Since this process forms an alphabet
that replaces the conventional one, it is referred to as a monoalphabetic cipher.
For example, one of the simplest forms of substitution is called the Caesar shift cipher, so named because it was favored
by Julius Caesar himself. It works by using the standard alphabet but shifting the letter it begins on by a set number of
characters. So, if you shifted the alphabet three places then A=D, B=E, C=F and so on.
However, simple Caesar shift ciphers only fooled dedicated adversaries for so long and eventually the keyword cipher
alphabet was formed, adding a twist to the monoalphabetic cipher. This cipher is similar to the Caesar shift except the
alphabet starts with a keyword or phrase, at which point the conventional alphabet resumes but without the letters used in
the keyword. For instance, if “Caesar” was the keyword, the alphabet would begin CAESRBDFGHIJK… Therefore A=C,
B=A, C=E, D=S, and so on.
In the sixteenth century, a new cipher emerged, one that was incorrectly believed to be
unbreakable.
1
Frequency analysis was challenging the security of the monoalphabetic cipher. In the sixteenth century, a Frenchman
named Blaise de Vigenère developed a cryptographic technique that used 26 distinct cipher alphabets in a single message
– in other words, a polyalphabetic cipher.
Vigenère’s cipher was first published in 1586 and called “Le Chiffre Indéchiffrable”, or the unbreakable cipher. It works
like this:
First you create what’s called a Vigenère square and codeword. The square contains 26 rows, each containing a cipher
alphabet shifted one place relative to the one above it. For instance, if the first row is BCDEF, the second row would be
CDEFG and so on.
The codeword is used to indicate which alphabets you are using. For example, with the codeword WHITE, you could build
a cipher that uses five different alphabets. That’s because the first letter would correspond to the 22nd cipher alphabet,
which would begin with the letter W, the second letter to the seventh alphabet, which begins with the letter H, and so on.
But while the Vigenère cipher is more secure, it isn’t practical and certainly isn’t unbreakable. It was too complex and time
consuming to gain traction with the military, whose communications depend on agility and simplicity. The popular
ciphers of the seventeenth century, like the one favored by Louis XIV, were simply enhanced monoalphabetic ciphers,
using numbers and the substitution of syllables rather than letters.
However, as telegraph communication caught on in the eighteenth century, the Vigenère cipher did too. While any
mailman could drop a letter in a box, a telegraph operator had to read a message to deliver it, which meant an obvious
decrease in privacy.
Then, in the nineteenth century, the British cryptanalyst Charles Babbage found that, even using multiple alphabets, there
were still signs and repetitions in polyalphabetic ciphers that pointed to the length of the codeword in use and enabled
deciphering.
You’ve now learned how cryptography has played a role in history, but let’s get back to basics and learn more about the
connections between cryptography and language.
Cracking the Enigma code was a huge challenge that decided the course of World War II.
By 1926, the British were keeping close tabs on German communications and began intercepting some odd ciphers. This
was the work of Enigma and it was baffling the Allied cryptanalysts. But, ironically enough, a method that the Germans
had devised to increase their security would eventually expose Enigma’s weakness.
German communications relied on two keys to send their messages. All correspondence would use a daily key, but every
message would start with a new key solely for decrypting that message. To prevent errors, the sender would repeat the
message key twice – a simple three-letter phrase that gave instructions on how to set the scrambler discs.
The Polish cryptanalyst and mathematician Marian Rejewski seized on this repetition by studying the three-letter message
keys of every intercepted message. Within a year, he’d assembled a catalog of every possible scrambler setting the Enigma
could generate – 105,456 configurations in total.
So, message keys became fingerprints that revealed the day key and Enigma settings.
However, if it weren’t for Alan Turing and the cryptanalysis team at Bletchley Park, the war might still have dragged on.
The Allies knew the Germans might recognize their folly of repeating a message key and Alan Turing was assigned to find
another way to break the Enigma cipher.
Turing, like Rejewski, went to work on old messages, identifying patterns. For instance, every morning the Germans
would broadcast a weather report. Closely examining the reports uncovered the cipher word for “weather.”
But Turing’s real genius was to mechanize Rejewski’s cataloging process, thereby connecting Enigmas electronically until
they gave the right combination to reveal the key. Turing and his team’s work gave the Allies advance knowledge of
bombing raids, and even details on the German forces the Allies would face at Normandy. It’s widely accepted that their
essential work led to a shorter war and fewer casualties.
3
Enigma marked a new phase in the development of cryptography, but the field didn’t end there. Next, we’ll explore how
modern cryptography developed, and where it’s going.
The rise of personal computers created new cryptographic methods and forms of security.
Enigma and its eventual deciphering made one thing clear: computing was the future of cryptography. As computers were
made commercially available, new forms of secure communication emerged. The expansion of commercial computers into
the businesses world in the 1960s necessitated a new form of security for financial transactions and trade negotiations.
The result was IBM’s Lucifer, a system that translates written messages into binary code, breaks it into 64 blocks and then
scrambles it 16 times according to a given key. By 1976, Lucifer was approved by the USNational Security Administration
(NSA) as the Data Encryption Standard, or DES.
But a better method for distributing keys was still missing. To this end, three cryptographers, Whitfield Diffie, Martin
Hellman and Ralph Merkle, joined forces to find a way for people to securely exchange encrypted messages over huge
distances.
Up until that point, cryptography assumed that if someone sent an encrypted message, the recipient would need the
sender’s key to decipher it. So, unless people met in person, the key would need to be mailed, thereby making it prone to
interception.
However, this team came up with another option: the Diffie-Hellman-Merkle key exchange, which works as follows:
Upon receiving an encrypted message, the recipient encrypts it again using his own key. Then, the twice-encrypted
message is returned to the sender who removes his own encryption before sending it back. Now the only encryption is the
recipient’s own and he can easily decode it.
But there’s always room for improvement, and in 1977, three scientists at MIT created the RSA cipher, made even more
secure through its use of extra safe keys based on the products of prime numbers.
These keys are especially safe because there’s no simple, general-purpose algorithm for determining a number’s prime
factors; it thus tends to be a highly laborious enterprise. For instance, while it’s not a problem to do this math on small
products like 21, whose prime factors are 3 and 7, higher numbers mean much more work.
4
But cryptographers have recognized this potential and are already working to retain their advantage. In fact, quantum
physics might also enable new ways of building extra secure ciphers and keys. For instance, physicists have already
succeeded in sending photons, which are quantum particles of light, over huge distances using fiber optic cables.
Furthermore, photons can be ordered in a way that creates perfectly random keys for the secure one-time pad cipher and
are sensitive enough to rapidly show signs of an attempted third-party interception.
Naturally, this technology could mean incredibly secure ciphers; in fact, they could be so secure that governments will
forbid the public and potential criminals from using them.