The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography

The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography

by Simon Singh


$16.76 $17.00 Save 1% Current price is $16.76, Original price is $17. You Save 1%.
View All Available Formats & Editions
Choose Expedited Shipping at checkout for guaranteed delivery by Thursday, February 21

Product Details

ISBN-13: 9780385495325
Publisher: Knopf Doubleday Publishing Group
Publication date: 08/29/2000
Edition description: Reprint
Pages: 432
Sales rank: 59,086
Product dimensions: 5.20(w) x 8.00(h) x 0.86(d)

About the Author

Simon Singh received his Ph.D. in physics from Cambridge University. A former BBC producer, he directed and co-produced an award-winning documentary film on Fermat's Last Theorem that aired on PBS's Nova series and formed the basis of his bestselling book, Fermat's Enigma. He lives in London.

Read an Excerpt

On the morning of Wednesday, 15 October 1586, Queen Mary entered the crowded courtroom at Fotheringhay Castle. Years of imprisonment and the onset of rheumatism had taken their toll, yet she remained dignified, composed and indisputably regal. Assisted by her physician, she made her way past the judges, officials and spectators, and approached the throne that stood halfway along the long, narrow chamber. Mary had assumed that the throne was a gesture of respect towards her, but she was mistaken. The throne symbolised the absent Queen Elizabeth, Mary's enemy and prosecutor. Mary was gently guided away from the throne and towards the opposite side of the room, to the defendant's seat, a crimson velvet chair.

Mary Queen of Scots was on trial for treason. She had been accused of plotting to assassinate Queen Elizabeth in order to take the English crown for herself. Sir Francis Walsingham, Elizabeth's Principal Secretary, had already arrested the other conspirators, extracted confessions, and executed them. Now he planned to prove that Mary was at the heart of the plot, and was therefore equally culpable and equally deserving of death.

Walsingham knew that before he could have Mary executed, he would have to convince Queen Elizabeth of her guilt. Although Elizabeth despised Mary, she had several reasons for being reluctant to see her put to death. First, Mary was a Scottish queen, and many questioned whether an English court had the authority to execute a foreign head of state. Second, executing Mary might establish an awkward precedent — if the state is allowed to kill one queen, then perhaps rebels might have fewer reservations about killing another, namely Elizabeth. Third, Elizabeth and Mary were cousins, and their blood tie made Elizabeth all the more squeamish about ordering her execution. In short, Elizabeth would sanction Mary's execution only if Walsingham could prove beyond any hint of doubt that she had been part of the assassination plot.

The conspirators were a group of young English Catholic noblemen intent on removing Elizabeth, a Protestant, and replacing her with Mary, a fellow Catholic. It was apparent to the court that Mary was a figurehead for the conspirators, but it was not clear that she had actually given her blessing to the conspiracy. In fact, Mary had authorised the plot. The challenge for Walsingham was to demonstrate a palpable link between Mary and the plotters.

On the morning of her trial, Mary sat alone in the dock, dressed in sorrowful black velvet. In cases of treason, the accused was forbidden counsel and was not permitted to call witnesses. Mary was not even allowed secretaries to help her prepare her case. However, her plight was not hopeless because she had been careful to ensure that all her correspondence with the conspirators had been written in cipher. The cipher turned her words into a meaningless series of symbols, and Mary believed that even if Walsingham had captured the letters, then he could have no idea of the meaning of the words within them. If their contents were a mystery, then the letters could not be used as evidence against her. However, this all depended on the assumption that her cipher had not been broken.

Unfortunately for Mary, Walsingham was not merely Principal Secretary, he was also England's spymaster. He had intercepted Mary's letters to the plotters, and he knew exactly who might be capable of deciphering them. Thomas Phelippes was the nation's foremost expert on breaking codes, and for years he had been deciphering the messages of those who plotted against Queen Elizabeth, thereby providing the evidence needed to condemn them. If he could decipher the incriminating letters between Mary and the conspirators, then her death would be inevitable. On the other hand, if Mary's cipher was strong enough to conceal her secrets, then there was a chance that she might survive. Not for the first time, a life hung on the strength of a cipher.

The Evolution of Secret Writing

Some of the earliest accounts of secret writing date back to Herodotus, 'the father of history' according to the Roman philosopher and statesman Cicero. In The Histories, Herodotus chronicled the conflicts between Greece and Persia in the fifth century bc, which he viewed as a confrontation between freedom and slavery, between the independent Greek states and the oppressive Persians. According to Herodotus, it was the art of secret writing that saved Greece from being conquered by Xerxes, King of Kings, the despotic leader of the Persians.

The long-running feud between Greece and Persia reached a crisis soon after Xerxes began constructing a city at Persepolis, the new capital for his kingdom. Tributes and gifts arrived from all over the empire and neighbouring states, with the notable exceptions of Athens and Sparta. Determined to avenge this insolence, Xerxes began mobilising a force, declaring that 'we shall extend the empire of Persia such that its boundaries will be God's own sky, so the sun will not look down upon any land beyond the boundaries of what is our own'. He spent the next five years secretly assembling the greatest fighting force in history, and then, in 480 bc, he was ready to launch a surprise attack.

However, the Persian military build-up had been witnessed by Demaratus, a Greek who had been expelled from his homeland and who lived in the Persian city of Susa. Despite being exiled he still felt some loyalty to Greece, so he decided to send a message to warn the Spartans of Xerxes' invasion plan. The challenge was how to dispatch the message without it being intercepted by the Persian guards. Herodotus wrote:

As the danger of discovery was great, there was only one way in which he could contrive to get the message through: this was by scraping the wax off a pair of wooden folding tablets, writing on the wood underneath what Xerxes intended to do, and then covering the message over with wax again. In this way the tablets, being apparently blank, would cause no trouble with the guards along the road. When the message reached its destination, no one was able to guess the secret, until, as I understand, Cleomenes' daughter Gorgo, who was the wife of Leonides, divined and told the others that if they scraped the wax off, they would find something written on the wood underneath. This was done; the message was revealed and read, and afterwards passed on to the other Greeks.
As a result of this warning, the hitherto defenceless Greeks began to arm themselves. Profits from the state-owned silver mines, which were usually shared among the citizens, were instead diverted to the navy for the construction of two hundred warships.

Xerxes had lost the vital element of surprise and, on 23 September 480 bc, when the Persian fleet approached the Bay of Salamis near Athens, the Greeks were prepared. Although Xerxes believed he had trapped the Greek navy, the Greeks were deliberately enticing the Persian ships to enter the bay. The Greeks knew that their ships, smaller and fewer in number, would have been destroyed in the open sea, but they realised that within the confines of the bay they might outmanoeuvre the Persians. As the wind changed direction the Persians found themselves being blown into the bay, forced into an engagement on Greek terms. The Persian princess Artemisia became surrounded on three sides and attempted to head back out to sea, only to ram one of her own ships. Panic ensued, more Persian ships collided and the Greeks launched a full-blooded onslaught. Within a day, the formidable forces of Persia had been humbled.

Demaratus' strategy for secret communication relied on simply hiding the message. Herodotus also recounted another incident in which concealment was sufficient to secure the safe passage of a message. He chronicled the story of Histaiaeus, who wanted to encourage Aristagoras of Miletus to revolt against the Persian king. To convey his instructions securely, Histaiaeus shaved the head of his messenger, wrote the message on his scalp, and then waited for the hair to regrow. This was clearly a period of history that tolerated a certain lack of urgency. The messenger, apparently carrying nothing contentious, could travel without being harassed. Upon arriving at his destination he then shaved his head and pointed it at the intended recipient.

Secret communication achieved by hiding the existence of a message is known as steganography, derived from the Greek words steganos, meaning 'covered', and graphein, meaning 'to write'. In the two thousand years since Herodotus, various forms of steganography have been used throughout the world. For example, the ancient Chinese wrote messages on fine silk, which was then scrunched into a tiny ball and covered in wax. The messenger would then swallow the ball of wax. In the fifteenth century, the Italian scientist Giovanni Porta described how to conceal a message within a hard-boiled egg by making an ink from a mixture of one ounce of alum and a pint of vinegar, and then using it to write on the shell. The solution penetrates the porous shell, and leaves a message on the surface of the hardened egg albumen, which can be read only when the shell is removed. Steganography also includes the practice of writing in invisible ink. As far back as the first century ad, Pliny the Elder explained how the 'milk' of the thithymallus plant could be used as an invisible ink. Although transparent after drying, gentle heating chars the ink and turns it brown. Many organic fluids behave in a similar way, because they are rich in carbon and therefore char easily. Indeed, it is not unknown for modern spies who have run out of standard-issue invisible ink to improvise by using their own urine.

The longevity of steganography illustrates that it certainly offers a modicum of security, but it suffers from a fundamental weakness. If the messenger is searched and the message is discovered, then the contents of the secret communication are revealed at once. Interception of the message immediately compromises all security. A thorough guard might routinely search any person crossing a border, scraping any wax tablets, heating blank sheets of paper, shelling boiled eggs, shaving people's heads, and so on, and inevitably there will be occasions when the message is uncovered.

Hence, in parallel with the development of steganography, there was the evolution of cryptography, derived from the Greek word kryptos, meaning 'hidden'. The aim of cryptography is not to hide the existence of a message, but rather to hide its meaning, a process known as encryption. To render a message unintelligible, it is scrambled according to a particular protocol which is agreed beforehand between the sender and the intended recipient. Thus the recipient can reverse the scrambling protocol and make the message comprehensible. The advantage of cryptography is that if the enemy intercepts an encrypted message, then the message is unreadable. Without knowing the scrambling protocol, the enemy should find it difficult, if not impossible, to recreate the original message from the encrypted text.

Although cryptography and steganography are independent, it is possible to both scramble and hide a message to maximise security. For example, the microdot is a form of steganography that became popular during the Second World War. German agents in Latin America would photographically shrink a page of text down to a dot less than 1 millimetre in diameter, and then hide this microdot on top of a full stop in an apparently innocuous letter. The first microdot to be spotted by the FBI was in 1941, following a tip-off that the Americans should look for a tiny gleam from the surface of a letter, indicative of smooth film. Thereafter, the Americans could read the contents of most intercepted microdots, except when the German agents had taken the extra precaution of scrambling their message before reducing it. In such cases of cryptography combined with steganography, the Americans were sometimes able to intercept and block communications, but they were prevented from gaining any new information about German spying activity. Of the two branches of secret communication, cryptography is the more powerful because of this ability to prevent information from falling into enemy hands.

In turn, cryptography itself can be divided into two branches, known as transposition and substitution. In transposition, the letters of the message are simply rearranged, effectively generating an anagram. For very short messages, such as a single word, this method is relatively insecure because there are only a limited number of ways of rearranging a handful of letters. For example, three letters can be arranged in only six different ways, e.g. cow, cwo, ocw, owc, wco, woc. However, as the number of letters gradually increases, the number of possible arrangements rapidly explodes, making it impossible to get back to the original message unless the exact scrambling process is known. For example, consider this short sentence. It contains just 35 letters, and yet there are more than 50,000,000,000,000,000,000,000,000,000,000 distinct arrangements of them. If one person could check one arrangement per second, and if all the people in the world worked night and day, it would still take more than a thousand times the lifetime of the universe to check all the arrangements.

Table of Contents

Chapter 1: The Cipher of Mary Queen of Scots
Chapter 2: Le Chiffre Indechiffrable
Chapter 3: The Mechanisation of Secrecy
Chapter 4: Cracking the Enigma
Chapter 5: The Language Barrier
Chapter 6: Alice and Bob Go Public
Chapter 7: Pretty Good Privacy
Chapter 8: A Quantum Leap into the Future
The Cipher Challenge
Further Reading

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

Code Book 4.4 out of 5 based on 0 ratings. 54 reviews.
David9 More than 1 year ago
Quite a good job at making crypto accessible, with fascinating anecdotes on everything from lost civilizations to fainting frenchmen. And, as with Fermat's Last Theorem, Singh has a knack of bringing out the depth and color of the people and crises in espionage and modern tech. The book mostly follows wars, and is not shy to report the more gruesome fates befalling those who trusted their spy code tricks. The geniuses and the subterfuge they wreak are actually fun to follow and Singh gently explains how their magic actually worked. Criticisms: Some of the claims about perfect security in the last chapter seemed premature. The flow between some chapters is disjointed, but it's entertaining and covers a very broad subject in satisfying depth. My day job is modifying security software and it was very cool to read the story behind DH key exchange. DH was completely mind-blowing when I first understood it. Singh put me in the room as the college kids were discovering it. And that was thrilling to me. Almost every chapter in this book weaves a good story, connecting you to the protagonists and spectating over their epic battles of mind against mind. Singh has put a lot of time and research into this book and it shows admirably. I liked it.
ashishg on LibraryThing 8 months ago
An unputdownable story of evolution of coding and decoding methods with fascinating tales which changed the world and introduction to mind of geniuses who contributed to making and breaking ciphers. Interesting read for curious and mathematically inclined reader, with hints to making your own code language. Information about modern day cryptography which secures our internet connected world is just marvellous.
CKmtl on LibraryThing 8 months ago
An excellent introduction to cryptography, its history and evolution. It may not delve as deeply into the subject of modern encryption as some formal textbooks and scholarly works, but this is to be expected. This is a book for the curious layperson, not the established mathematician / computer scientist.Singh series of challenges is included, based on the approaches to cryptography detailed throughout the book. While I haven't attempted them (yet), they look to be an interesting opportunity to put theory into practice.
JBD1 on LibraryThing 8 months ago
A very good outline of codes and cryptography.
JohnMunsch on LibraryThing 8 months ago
An interesting analysis of codes and ciphers. Both their making and breaking are discussed and placed well into historical context. A well written book that makes lots of cryptography that would likely be impenetrable to the average person simple enough to understand (or at least I thought so). I highly recommend this book as my only complaint about it was that it hadn't been revised to talk about more recent systems like elliptical curve encryption.
SeriousGrace on LibraryThing 8 months ago
Much like how Mark Kurlansky makes a subject like salt interesting, Simon Singh makes all things code fascinating. From the very beginning The Code Book was informative and interesting. Peppered with photographs and diagrams, The Code Bookrecounted the events in history where the ability to break a code (or not) meant life or death. Beginning with Queen Mary of Scot's attempted plot to murder Queen Elizabeth on through the first and second World Wars. The only time I really got bogged down was, of course, when Singh would get a little too detailed with mathematical explanations of more difficult codes and ciphers.
melydia on LibraryThing 8 months ago
A history of cryptography from ancient Egypt through quantum computing. My favorite parts were about WWII, with Turing and the Navajo Codetalkers. Some parts were a touch slow - cryptography isn't nearly as thrilling as the activities associated with it - but by and large it was an informative read. My only real complaint was how long it took me to read. Though Singh's text was thorough and readable as ever, it took me nearly a month to finish. I think I just wasn't in the right mood for a math book.
lyzadanger on LibraryThing 8 months ago
A totally consumable rampage through millennia of cryptographic techniques, nicely synthesized with historical vignettes and biographies of interesting folks. Especially compelling for the layperson is the linguistic/logical puzzle of secret writing before about WWI, when codebreaking coups involved graspable, but brilliant breakthroughs. The same technology that revolutionized life in the early 20th century also changed cryptography forever: now the problems have more of a mathematical (theory) and engineering (implementation) bent, though the true game-changers are still concepts that anyone can understand (and Singh almost flawlessly explains).The only downside here is not the fault of the book--it was published in 1999 and is feeling dated. I found myself skimming the last 1/3 or so of the book, which focuses on computer encryption, concerned that I'd confuse myself (I'm a Web developer by trade) with respect to the encryption technologies I use now. I would pay Singh cold hard cash to release an updated version of this sui generis survey of this fascinating subject. I'd love to keep reading the story from where he left off.
davidpwhelan on LibraryThing 8 months ago
Simon Singh is a gifted writer and this is a terrific example of his work. Singh takes you through the history of cryptography and encipherment by looking first at the codemakers and then the codebreakers, turnabout, as encryption improved over centuries. The text is written in an engaging, story-oriented manner so even technical concepts are accessible. I have returned to this book for the enjoyment of reading it, even though I'm familiar now with the concepts he covers. It's a great resource for anyone interested in how current computer encryption works and how it evolved to its current state.
Garp83 on LibraryThing 8 months ago
Some of us never gave codes more than a passing thought beyond the comedy of Ralphie Parker¿s Little Orphan Annie Decoder Ring in the movie A Christmas Story. Many of us never suspected that code-making and code-breaking have been such powerful forces in our own history, from the decipherment of ancient languages to the defeat of Nazi Germany to the development of the modern computer. An exhaustive study, yet never tedious, Singh¿s talented prose transmits his own powerful fascination and enthusiasm for the theme to the reader, striking just the right balance in the challenge of coherently presenting the complexity of the subject while formulating its elucidation for a mass audience.
jeff.maynes on LibraryThing 8 months ago
Simon Singh's book on the history of cryptography is a brilliant work of popular science and history. The aim of the book is to take us from the days of simple hidden messages, through the invention of increasingly complex substitution ciphers, modern codes and into the types of codes (and methods of breaking them) that we might see in the future. As someone with an interest and history and puzzles, this book was an absolute delight.There are two things in particular that Singh does very well. First, he masterfully layers the increasingly complex codes one on top of the other. This allows him to take the time to explain each idea clearly, and then use the prior codes to introduce the new ones. It is easy to imagine an author losing the audience very quickly in a work like this. If one does not understand the notion of a 'key' in some of the earlier substitution ciphers, then the RSA encryption standard will be utterly incomprehensible. That is, even if the central idea of RSA was explained clearly, it still rests on the ideas that came before it. Losing the readers at any stage along the way could have resulted in an overly complicated second half. Singh hits a pitch perfect pace. He typically provides an initial explanation of idea in cryptographic terms, before using simply toy analogies, before returning to the more complex explanation. As a result, the toy analogies are frequently illuminating (the reader knows what to look for). It was also never plodding. There was no point in the text where I found the ideas or explanations difficult to follow, and the questions I had were based on the subject matter, and not Singh's presentation of it. This is a book that any reader will learn a great deal from.The second thing that Singh does very well is situate the codes historically. Each of these codes is tied to an interesting story - whether a treasure hunt or the execution of a monarch. Singh is able to weave these stories into the tale of the codes, which makes for compelling reading at two levels. I have a great interest in Turing in my professional work, and I was delighted to see his moving story recounted here. The high stakes of codebreaking adds a real sense of urgency to the more technical discussions covering the back and forth between codemakers and codebreakers to develop ever better codes.Indeed, the only chapter that did not quite hold up to the same quality as the rest of the book was his coverage of the political debates surrounding encryption. It is indeed a really interesting issue whether encryption is a bastion of free speech, or a tool to enable illegal and violent acts. Singh wants to stay above the fray, and just outline the two positions. All we end up getting is a rather simple overview of the conflict. This is a philosophical and moral question, and requires a different approach. Indeed, I would have preferred Singh to take a stance on the question. It would have helped him get into the details of the arguments, which would have been more illuminating (even if the reader disagrees) than the "one side says x, one says x" approach he adopts.Despite my quibbles with this chapter, I found this to be an admirable work of pop science and history. Singh tells a fascinating story in a way that does not oversimplify. At the same time, he is able to explain the subject matter clearly. Any reader with an interest in history, puzzles or codes will find a lot to enjoy in The Code Book.
scott.r on LibraryThing 8 months ago
Useful introduction to ciphers and the people who have been making and breaking them for centuries. Engaging and educational, with just a tad too much technical detail (for my taste) in a few chapters. Entered my awareness through unrelated recommendations and proved on the mark. Makes me want to reread Cryptonomicon.
markgalassi on LibraryThing 8 months ago
Very nicely written, does a good job of making a technically difficult topic interesting and accessible.
heidilove on LibraryThing 8 months ago
winderful intro, history and primer.
billmcn on LibraryThing 10 months ago
This is a thoroughly accessible account of the history of cryptography. Its coverage of the evolution of ever more sophisticated pre-twentieth century ciphers is particularly clear. The chapter on hieroglyphics seemed a bit of a digression to me but no doubt others enjoy it. There's a long section on the decoding of the Enigma machine, which is a treat for those of us enamored with the romance of Bletchley Park.
acrn on LibraryThing 10 months ago
Incredibly intelligent and easy to read book. Singh's style is fresh, and believe, you can read this book in a couple of days. And then read it again.
delphica on LibraryThing 10 months ago
(#19 in the 2003 Book Challenge)The author explains various code and cipher methods by examining famous codes throughout history, including the Mary Queen of Scots conspiracy, Enigma, and modern internet security. This is the kind of thing that I love, only I SUCK at math so I usually pick up books like this and then can't get through them. Even with this, I started skimming over the mathy parts, and then I said to myself "self, you're a reasonably bright person, let's just try reading them" and lo and behold, the author did an amazing job of explaining the theory behind the coding in such a way that any idiot off the street (that would be me) can understand the basic gist of it. It was a very good mix of light theory and interesting political/historical anecdotes.Grade: ARecommended: To people who think Godel, Esher, and Bach looks interesting, but can never make it past the second chapter.
lmarin on LibraryThing 10 months ago
I actually don't own this book but borrowed it from jmservat a while back. It is a fascinating and readable introduction to cryptography. I actually could not put it down!At the end of the book there is also some alledgedly very difficult code to break and the author is (was?) offering a reward for whom could crack it.
ORFisHome on LibraryThing 10 months ago
Very different than my normal reading, but vastly interesting. I'm so glad that I branched out to read it and would highly recommend it from a scientific and historical standpoint.
parelle on LibraryThing 11 months ago
One of my favorite, if not my favorite non-fiction book. An easily accessible, non-mathmatical these on coding. And for the historian in me, lots of information on the people involved.
Go4Jugular More than 1 year ago
This is an interesting book that takes the reader in chronologic order, from the very first simple substitution codes through to theoretical coding methods yet to be developed. Real-life stories of the use of codes throughout history are interspersed amongst the progression of code making and code breaking techniques. It is fascinating to hear how first the code makers, then the code breakers, alternate supremacy as their respective techniques advance. It is a veritable parade of truly clever and talented practitioners of the science. I gave this less than a perfect score only because the mathematics get increasingly challenging as technology advances, and it takes a fairly dedicated reader to push through to the end.
Anonymous More than 1 year ago
Not too technical. Singh does a great job of telling the story of secret messages, providing just the right amount of detail.
Anonymous More than 1 year ago
Anonymous More than 1 year ago
I had always wondered how they did these things and the book was supremely informative. I am not a mathematician or a linguist but the methodology was explained so thoroughly and clearly that it was like reading a crime novel. Also, I had always been baffled about Linear B and had wondered if there was a Linear A (which there is). I would recommend the book to those that like to resolve crossword puzzles and that type of problems.
Anonymous More than 1 year ago
This book is pretty good and told me about a lot of fun encyrption codes.