[Skip to content]

Sign up for our daily newsletter
The Actuary The magazine of the Institute & Faculty of Actuaries

The Code Book

Last year I read a book which was ‘un-put-downable’– an enthralling thriller about mysteryand intrigue, despair and triumph, treacheryand obsession. It wasn’t the latest blockbusterby Stephen King or Jeffrey Archer – surprisinglyenough, it was a book about the history of mathematics:Fermat’s Last Theorem, written by Simon Singh.Anyone who enjoyed Fermat’s Last Theorem wouldneed no encouragement to grab a copy of Singh’s newbook, The Code Book. The new book is a history ofcode-makers and code-breakers – a battle of wits whichhas lasted for more than 2,000 years. The book followsthe development of secret writing, from the simplestciphers described in the Kama Sutra, to the mostsophisticated encryption techniques used in modernInternet transactions. (Did you know that the KamaSutra recommends that women should use ciphers inorder to conceal the details of their romantic liaisons?)

Sgd bncd annj ax...

How can meaning be wrenched from such gibberish?Can it be done? Quite often, the answer is yes! Timeand time again, the code-makers have invented‘unbreakable’ codes – and then some genius comesalong and achieves what was commonly thought tobe impossible.

Some code-makerswere rather over-confident.They refused tobelieve that the codescould be broken by anyhuman means. When aFrenchman broke thediplomatic codes usedby King Philip of Spainin the 16th century, theking complained to thepope about this mostunnatural event. Clearly,he pointed out, thisFrenchman must be ‘anarchfiend in league withthe devil’, and he shouldbe prosecuted for hisdemonic deeds. Thepope declined to pursuethe matter – possiblybecause his own Vaticanaides had also brokenthe Spaniard’s code a fewyears earlier.

Of course, some codesare a bit more sophisticatedthan others, andso decryption takes just a little bit longer. TheVigenere code was invented in 1586, and was knownas ‘le chiffre indéchifferable’. It was not broken untilCharles Babbage responded to the challenge in 1854,ie 268 years later.

Singh’s book explains how the Vigenere code works(it is quite simple); he also explains how Babbagebroke the code (not quite so simple). Singh describesBabbage as an eccentric genius, best known fordesigning the first calculating machines, for reformingthe postal service, and for his hatred of organgrinders.Many actuaries will also be familiar with hiscontributions to actuarial science.

What qualities does a code-breaker need? Genius isa prerequisite, obsession is highly desirable, and desperationis also a great motivator. In many cases, thesolution to a cryptographic puzzle has been, quite literally,a matter of life and death. For example, MaryQueen of Scots was beheaded as a result of unsophisticatedencryption – Queen Elizabeth’s ministers easilymanaged to decode her traitorous missives, whichencouraged her confederates to assassinate themonarch.

Changing history

Singh gives a number of examples where code-breakinghas changed the course of history, from JuliusCaesar to World War II.There is a whole chapter on ‘cracking the Enigma’,describing the work of British cryptanalysts duringWorld War II. The motley crew at Bletchley Park brokethe supposedly unbreakable Enigma code used by theGermans. It is generally agreed that this achievementshortened the war by years and saved thousands oflives.

Where did the British military establishment findtheir code-breakers? Historically, they had employedlinguistic experts, but they soon decided that othertalents might be more useful. So they ran a crosswordpuzzle competition in the Daily Telegraph.They issued an anonymous challenge to readers, askingif anyone could solve the newspaper’s crosswordin under 12 minutes. It was felt that crossword expertsmight also be good code-breakers, but of course noneof this was mentioned in the newspaper. The 25 readerswho replied were invited to Fleet Street to sit acrossword test. Five of them completed the crosswordwithin the allotted time, and another had only oneword missing when the 12 minutes had expired.A few weeks later, all six were interviewed by militaryintelligence and recruited as code-breakers atBletchley Park.

The military also recruited bridge experts, chesschampions, and academic mathematicians. Apparently, this unorthodox recruitment method was quitesuccessful, because the British eventually managed tobreak the Enigma codes.

Singh gives a detailed description of the inner workingsof the Enigma encoding mechanism, and alsoexplains the ingenious methods used by the British todecode the messages.In some cases, success was the result of sheer geniusand innovation. For example, one mathematiciansuggested building a programmable machine to helpbreak the codes more quickly, but his bosses decidedthat such a machine was technically impossible.Ignoring such negativity, one of the engineers wentahead and built it anyway, producing the world’s firstcomputer, Colossus. (Unfortunately, Colossus wasclassified top secret, and after the war it was destroyedto preserve the secret. As a result, many early computertextbooks erroneously state that the 1945ENIAC was the first modern computer.)

Sometimes mere genius was not enough – more drasticmeasures were required. For example, it was easierto decode the messages if the British knew just one ortwo words of the underlying text. This was called a‘crib’. But how could they get these few vital clues? Indesperation, the British airforce began laying downmines in particular locations. The Germans wouldsoon discover the mines and send out coded warningsto their colleagues. These warnings would inevitablycontain a map reference, and naturally, since theBritish already knew this map reference, it could beused as a crib when the message was intercepted. Sowingmines to obtain cribs was known as ‘gardening’.

Language barrier

It is, of course, much easier to keep your messagessecret if they are transmitted in an unknown language.Singh describes the success of the Americanmilitary, which employed Navaho Indians to transmitsecret messages in World War II. The Japanese werecompletely at a loss to understand this ‘weird successionof guttural, nasal, tongue-twisting sounds’. Theynever broke the code.

Singh points out that the same sort of problemoften confronts archaeologists, who must try to decipherinscriptions written with unfamiliar symbols inunidentified languages. He devotes a chapter to thedecipherment of Egyptian hieroglyphics and CretanLinear B script. Both are fascinating stories.


The story of encryption is by no means over. At present,cryptography is essential for secure transmission of electronicdata (eg when you provide your credit card numberover the Internet). Singh describes the developmentof the RSA encryptionsystem which iscurrently in use. RSAis not perfectlysecure, of course. Inorder to break thecode, all you need to do is factor a very large numberinto its prime factors. Surely a simple task? Yes, but it israther time-consuming. When the RSA method wasfirst described in Scientific American, Martin Gardnerchallenged his readers to decode a short message whichhad been encrypted using the RSA system. The challengewas published in August 1977. The code waseventually broken in April 1994, by a team of 600 volunteers.

And that was an easy one!

For the more complicated ciphers, Singh puts thetechnical details in appendices. The appendices areadequate for an average intelligent layman, but somereaders may want to know more. Fortunately, Singhprovides a long list of books and websites which arerecommended for further reading.

Break it!

Once your curiosity has been aroused, you might feeltempted to try it yourself – fancy a bit of code-breaking?Singh sets a challenge for his readers: The CodeBook includes ten different encrypted messages in anappendix. The first North American reader to solvethem all wins $15,000. However, be warned ! It is nota doddle. The book was published in October 1999,and progress is recorded on a website. As at 5 January2000, the leader had broken just six out of the tenmessages. Good luck!


To purchase this book, click on the cover image