The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography by Simon SinghThe Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography by Simon Singh

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

bySimon Singh

Paperback | August 29, 2000

Pricing and Purchase Info

$17.35 online 
$20.00 list price save 13%
Earn 87 plum® points

Prices and offers may vary in store


In stock online

Ships free on orders over $25

Available in stores


In his first book since the bestselling Fermat's Enigma, Simon Singh offers the first sweeping history of encryption, tracing its evolution and revealing the dramatic effects codes have had on wars, nations, and individual lives. From Mary, Queen of Scots, trapped by her own code, to the Navajo Code Talkers who helped the Allies win World War II, to the incredible (and incredibly simple) logisitical breakthrough that made Internet commerce secure, The Code Book tells the story of the most powerful intellectual weapon ever known: secrecy.

Throughout the text are clear technical and mathematical explanations, and portraits of the remarkable personalities who wrote and broke the world's most difficult codes. Accessible, compelling, and remarkably far-reaching, this book will forever alter your view of history and what drives it.  It will also make you wonder how private that e-mail you just sent really is.
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.
Title:The Code Book: The Science of Secrecy from Ancient Egypt to Quantum CryptographyFormat:PaperbackDimensions:432 pages, 7.99 × 5.16 × 0.89 inPublished:August 29, 2000Publisher:Knopf Doubleday Publishing GroupLanguage:English

The following ISBNs are associated with this title:

ISBN - 10:0385495323

ISBN - 13:9780385495325

Look for similar items by category:


Rated 5 out of 5 by from Math made amazing The Code Book is a perfect blend of history and mathematics as Singh breaks down the methodology used to make and break the most famous (or infamous) codes and ciphers in human history, and succinctly describes whats on the horizon in regards to electronic and quantum encryption. A simply delightful read.
Date published: 2017-09-08
Rated 5 out of 5 by from Great Non-Fiction Read. I bought this book last year, as I wanted to start reading more non-fiction. I finished the book in a week. I really enjoyed it. When I reached the end, where it went into the quantum, I was amazed. The history portions of the book are very well written and interesting. I plan on re-reading this book.
Date published: 2017-07-09
Rated 5 out of 5 by from Singh explains how cryptography changed history and why we need to understand it more than ever. As much anthropology as cryptography, Singh not only makes cryptography interesting & decipherable, but takes the reader on a picaresque historical ride, & in the process shows how codes have changes the course of human history, & how they will continue to do so as they become more necessary to our computer driven existence.
Date published: 2009-08-07
Rated 5 out of 5 by from Superb A great read. Simon Singh has the uncanny ability to take complex concepts and make them understandable and infinitely entertaining.
Date published: 2009-03-11
Rated 4 out of 5 by from Exercise Your Brain The Code Book is an excellent primer for the history and how-to's of encryption. Although now a little dated (the final chapter about computers and internet could use a second edition!), this book is still worth a read. The challenges in the appendices are intriguing and I'm still working away trying to break the codes. The Code Book starts out very strong and interesting and for the most part continues strong. A short lag in the middle, but if you're a history buff it will certainly captivate your interest. All in all a very good, interesting and brain teasing book.
Date published: 2008-11-19
Rated 5 out of 5 by from Loved It What a fantastic book. It's not often that a book inspires me to pick up another book at the same time - a workbook in fact! I found myself trying the ciphers and scribbling out secret messages. The final chapter on quantum cryptography went way over my head, but the other chapters were real page-turners.
Date published: 2007-11-01
Rated 5 out of 5 by from Perfect for the uninitiated Excellent read. Captivating from beginning to end, this book is perfect for anyone interested by the subject but without any knowledge on it. The author's simple explanations help the reader fully understand the impact of cryptography. The history of codemaking and codebreaking through the centuries is related in this book in a clear and fascinating way, which makes the story that much more interesting.
Date published: 2002-10-01
Rated 4 out of 5 by from what a code book !! I personally like this book very much because it not only provides audiences with a very thorough introduction of the evolution of codes, but it also signifies to the audiences how crucial the role of the secret code plays in the rise and fall of a nation or a battle. And the most important of all is that the ways the secret codes are invented or implemented in the practice have always been related to the history of all civilizations. For instance, one chapter of the book mentions how archaeologists in 19th century tried to decipher those ancient pre-Hellenic languages which were found on the unearthed artifacts. However, the author used too many professional linguistic jargon when he was presenting his words in this chapter, which I found it hard to follow. But, this is possibly due to my lack of linguistic background. At the very last part of the book, which I enjoy the most, it talks about the revolutionary discovery of the public encryption key. That was very amazing, because the author did a good job to let his readers understand and feel appreciated how important the breakthrough was. I will certainly recommend my friends about this book.
Date published: 2001-06-05
Rated 5 out of 5 by from Excellent historical presentation This book is an excellent source of not only historical facts about the science of cryptography and codes it is an amazingly entertaining text on how to understand them. After reading this book my interest has been sparked. I am now consumed with the ideas of cryptography and am very appreciative of how the author was able to explain them in layman's terms. Get this book!
Date published: 2001-01-12
Rated 5 out of 5 by from Singh does it again I loved "Fermat's Last Theorem" and I absolutely love this book. Singh is an extraordinary mathematician, and does an excellent job of introducing the novice to the wonderful world of cryptoanalysis!
Date published: 2000-12-15
Rated 5 out of 5 by from S UHYA JMNJ! A wonderful book on the past, present, and future of cryptography. The book is a fairly simple read but very engaging. As well as explaining the science of cryptography, Singh details the way in which the challenge of creating and breaking ciphers has impacted history. And although the ten ciphers presented in the book have recently all been broken, they still present a test for would be cryptanalysts. You'll even learn how to decipher this review's title.
Date published: 2000-12-04

Read from the Book

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 WritingSome 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.

From Our Editors

As proven throughout the years, secrecy is the greatest weapon of all. Simon Singh examines this fascinating subject in The Code Book. Readers will learn about the effects codes had and continue to have on wars and nations. Singh examines the Navajo Code Talkers, who played an important role in the Allies winning the Second World War, and the logistical breakthrough that secures Internet commerce. It contains mathematical and technological explanations for writing code and information on the people who broke the most difficult codes.

Editorial Reviews

"It would be hard to imagine a clearer or more fascinating presentation. . . . Mr. Singh gives cryptography not only its historical dimension but its human one." --The New York Times"Entertaining and satisfying. . . . Offers a fascinating glimpse into the mostly secret competition between codemakers and codebreakers."        --USA Today  "A good read that, bless it, makes the reader feel a bit smarter when it's done. Singh's an elegant writer and well-suited to the task of leading the mathematically perplexed through areas designed to be tricky."        --Seattle Weekly  "An absorbing tale of codemaking and codebreaking over the centuries." --Scientific American"Singh spins tales of cryptic intrigue in every chapter." --The Wall Street Journal"Brings together...the geniuses who have secured communications, saved lives, and influenced the fate of nations. A pleasure to read." --Chicago Tribune"Enthralling...commendably lucid...[Singh's] book provides a timely and entertaining summary of the subject." --The Economist

Employee Review

This book covers the mathematics and applications of cryptography from its conception to its present day usage. The author discussing topics such as stenography, different methods of encryption, cryptanalysis, cryptography and its effect on history (particularly World War II. The truly great thing about this book is that you don't have to have advanced knowledge of higher mathematics to enjoy it. Singh concentrates mainly on the concepts and theory of codes, and the great surprise is that the math is surprisingly simple. This book is classed under history, but I wold highly recommend it to anyone interested in math, computer science or espionage as well.