A LSO BY S IMON S INGH
Fermats Enigma
Published by
Delacorte Press
an imprint of
Random House Childrens Books
a division of Random House, Inc.
1540 Broadway
New York, New York 10036
Copyright 2001 by Simon Singh
All rights reserved. No part of this book may be reproduced or
transmitted in any form or by any means, electronic or mechanical,
or by any information storage and retrieval system, without the written permission of the Publisher,
except where permitted by law.
The trademark Delacorte Press is registered in the
U.S. Patent and Trademark Office and in other countries.
Visit us on the Web! www.randomhouse.com/teens
Educators and librarians, for a variety of teaching tools,
visit us at www.randomhouse.com/teachers
Library of Congress Cataloging-in-Publication Data
Singh, Simon.
The code book : how to make it, break it, hack it, crack it /
Simon Singh.
p. cm.
eISBN: 978-0-375-89012-3
1. Coding theory. 2. Cryptography. I. Title.
TK5102.92.S56 2002
652.8dc21
2001042131
v3.1
To the Teachers and Mortals
who took the time to inspire me
XICYIQKMHR, VOIR RFH LKRQT
The urge to discover secrets is deeply ingrained in human nature; even the least curious mind is roused by the promise of sharing knowledge withheld from others. Some are fortunate enough to find a job which consists in the solution of mysteries, but most of us are driven to sublimate this urge by the solving of artificial puzzles devised for our entertainment. Detective stories or crossword puzzles cater for the majority; the solution of secret codes may be the pursuit of a few.
John Chadwick
The Decipherment of Linear B
CONTENTS
1 T HE C IPHER OF M ARY Q UEEN OF S COTS
The birth of cryptography, the substitution cipher and the invention of codebreaking by frequency analysis
2 T HE A NONYMOUS C ODEBREAKER
The Vigenre cipher, why cryptographers seldom get credit for their breakthroughs and a tale of buried treasure
3 T HE M ECHANIZATION OF S ECRECY
The Zimmermann telegram, the Enigma machine and how cryptography changed the courses of World Wars I and II
4 T HE L ANGUAGE B ARRIER
The impenetrability of unknown languages, the Navajo code talkers of World War II and the decipherment of Egyptian hieroglyphs
5 A LICE AND B OB G O P UBLIC
Modern cryptography, the solution to the so-called key-distribution problem and the secret history of nonsecret encryption
6 P RETTY G OOD P RIVACY
The politics of privacy, the future of cryptography and the quest for an uncrackable code
INTRODUCTION
For centuries, kings, queens and generals have relied on efficient communication in order to govern their countries and command their armies. At the same time, they have all been aware of the consequences of their messages falling into the wrong hands, revealing precious secrets to rival nations and betraying vital information to opposing forces. It was the threat of enemy interception that motivated the development of codes and ciphers: techniques for disguising a message so that only the intended recipient can read it.
The desire for secrecy has meant that nations have operated codemaking departments, which were responsible for ensuring the security of communications by inventing and implementing the best possible codes. At the same time, enemy codebreakers have attempted to break these codes and steal secrets. Codebreakers are linguistic alchemists, a mystical tribe attempting to conjure sensible words out of meaningless symbols. The history of codes and ciphers is the story of the centuries-old battle between codemakers and codebreakers, an intellectual arms race that has had a dramatic impact on the course of history.
In writing The Code Book, I have had two main objectives. The first is to chart the evolution of codes. Evolution is a wholly appropriate term, because the development of codes can be viewed as an evolutionary struggle. A code is constantly under attack from codebreakers. When the codebreakers have developed a new weapon that reveals a codes weakness, then the code is no longer useful. It either becomes extinct or it evolves into a new, stronger code. In turn, this new code thrives only until the codebreakers identify its weakness, and so on. This is similar to the situation facing, for example, a strain of infectious bacteria. The bacteria live, thrive and survive until doctors discover an antibiotic that exposes a weakness in the bacteria and kills them. The bacteria are forced to evolve and outwit the antibiotic, and if successful, they will thrive once again and reestablish themselves.
History is punctuated with codes. They have decided the outcomes of battles and led to the deaths of kings and queens. I have therefore been able to call upon stories of political intrigue and tales of life and death to illustrate the key turning points in the evolutionary development of codes. The history of codes is so inordinately rich that I have been forced to leave out many fascinating stories, which in turn means that my account is not definitive. If you would like to find out more about your favorite tale or your favorite codebreaker, then I would refer you to the list of further reading.
Having discussed the evolution of codes and their impact on history, the books second objective is to demonstrate how the subject is more relevant today than ever before. As information becomes an increasingly valuable commodity, and as the communications revolution changes society, so the process of encoding messages, known as encryption, will play an increasing role in everyday life. Nowadays our phone calls bounce off satellites and our e-mails pass through various computers, and both forms of communication can be intercepted with ease, so jeopardizing our privacy. Similarly, as more and more business is conducted over the Internet, safeguards must be put in place to protect companies and their clients. Encryption is the only way to protect our privacy and guarantee the success of the digital marketplace. The art of secret communication, otherwise known as cryptography, will provide the locks and keys of the Information Age.
However, the publics growing demand for cryptography conflicts with the needs of law enforcement and national security. For decades, the police and the intelligence services have used wiretaps to gather evidence against terrorists and organized crime syndicates, but the recent development of ultrastrong codes threatens to undermine the value of wiretaps. The forces of law and order are lobbying governments to restrict the use of cryptography, while civil libertarians and businesses are arguing for the widespread use of encryption to protect privacy. Who wins the argument depends on which we value more, our privacy or an effective police force. Or is there a compromise?
Before concluding this introduction, I must mention a problem that faces any author who tackles the subject of cryptography: The science of secrecy is largely a secret science. Many of the heroes in this book never gained recognition for their work during their lifetimes because their contribution could not be publicly acknowledged while their invention was still of diplomatic or military value. This culture of secrecy continues today, and organizations such as the U.S. National Security Agency still conduct classified research into cryptography. It is clear that there is a great deal more going on of which neither I nor any other science writer is aware.