<<

Codes and 20

Can You Keep a Secret?

Codes and ciphers have been around just about as long as there has been written language. The ability to communicate in secret – as well as the ability to peer into the secret communications of others – has been central to a surprising number of major world events throughout history, often with nations as well as lives hanging in the balance. A word first about the difference between a and a : • A code is a secret language used to disguise the meaning of a message. The simplest form is a “jargon code,” where a particular phrase corresponds to a previously defined message. “The milkman comes in the morning,” for example, could mean “the invasion begins at dawn.” • A cipher conceals what is referred to as a “plaintext” message by substituting (a “substitu- tion cipher”) and/or scrambling (a “”) the letters. As we shall see later, a simple may encrypt the message “Call me tomorrow morning” as “FDO OPH WRP RUU RZP RUQ LQJ.” For our purposes, we will use such general terms as “code,” , sometimes called “cryptology,” is “code breaker,” “encryp- tion” and “decryption” to from the Greek, meaning “hidden writing,” and its refer both to codes and ci- use has been documented for over 2,000 years. phers, rather than repeatedly drawing the distinction between the two. Hidden Writing Cryptography, sometimes called “cryptology,” is from the Greek, meaning “hidden writing” and its use has been documented for over 2,000 years. From the beginning, codes have always been of greatest use in matters of war and diplomacy. The reasons for this are pretty obvious: no general would want his strengths, weaknesses or plans revealed to his enemy, as no ambassador would want his goals or strategies available to his competitor sitting across the negotiat- ing table. At first, written messages were simply hidden to keep their meaning secret, in a practice called . In his chronicle of the wars between Greece and Persia, the Greek historian Herodotus described how an act of cryptography had saved Greece from con- quest by Xerxes, left, the king of Persia and pharaoh of Egypt who ruled from 485 to 465 B.C. Codes and Ciphers 21

In an effort to expand his rule, Xerxes secretly began amassing a great army and navy several years before launching a surprise attack on Athens. The build-up was witnessed, however, by Demaratus, a Greek exile living in the Persia at the time. Demaratus, determined to alert his homeland, scraped the dark wax off a pair of wooden folding tablets, wrote the news onto them, then covered the message over with wax again. When the tablets reached their destination, the wax was removed and the message read. On receiving the news, the Greeks, who at that time had no navy, commissioned the construction of 200 warships. When the Persian fleet finally arrived in 480 B.C., without the element of surprise, Xerxes found himself lured into a trap, and his forces were defeated in a day. Around this same time, Spartan military leaders used a , at right, (rhymes with Italy), which was simply a wooden staff, to encode their communications. A strip of parchment or leather was wrapped around it, and the writer would write his message along the length of the scytale. When finished, the strip would be unwound and seem to contain only a series of meaningless letters. In order to read the message, the receiver would wind the leather around another scytale of the same diameter as the one used by the sender. Herodotus also documented the tale of Histaiaeus, who was anxious to encourage Aristagoras of Miletus to revolt against the Persian king. To keep his message hidden, he shaved the head of his messenger, wrote the message on his scalp, then waited for the hair to grow back before sending him off. The weakness of this second method should be pretty obvious. If the message remains hidden until its intended recipient receives it, then all is well and good, but if it is found, it is plain for all to see. As the demand for secrecy increased, a more foolproof solution was needed. The In his historic quest to expand the Roman Republic into a vast empire a little more than 2,000 years ago, Julius Caesar, commemorized in a bust at right, by all accounts a man of exceptional brilliance, energy and vision, embarked on a series of military campaigns in such countries as Gaul (modern-day France), Hispania (Spain), Egypt, Britannia (Eng- land) and Germania (Germany). Communications on the battlefield in Caesar’s time consisted only of written messages delivered on foot by runners, whose ability to accomplish their mission (and live to report back to their commander) depended entirely on their ingenuity, bravery and speed. Most often, several runners were dispatched to deliver the same message to one of Caesar’s of- ficers in the hopes that one would complete the mission. Since the enemy’s officers, at least, were usually literate, there was always the danger that Caesar’s orders would fall into enemy hands. To prevent the enemy from learning his plans, Caesar devised one of the earli- est known techniques, which is today known as the “Caesar Cipher.” The Roman historian Suetonius, best known for his The Lives of the First Twelve Caesars, refers to Julius Caesar’s use of the Caesar Cipher in this excerpt: Codes and Ciphers 22

“If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the let- ters of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others.” As described by Suetonius, the Caesar Cipher is a simple shift of the alphabet by a specified number of characters to the right. The number of character shifts is referred to as the . By replacing each character in a message with the character that corresponds to the key number of charac- ters further down the alphabet – in this case, three – anyone can create a Caesar-Ciphered message.

Codes and Ciphers Lessons In Unit 2, Codes & Ciphers, you will create a software program capable of encoding a plaintext message and decoding an encrypted message, using the Caesar Cipher described in the previous narrative. After modeling the Caesar Cipher on a simple message using a pencil and paper in order to get a basic idea of how it works, you will: 1. Create the Cryptography Project 2. Ask the User to Choose Encipher, Decipher or Exit 3. Ask the User to Choose Caesar Cipher, Vigenere Cipher or Exit 4. Implement the Caesar Cipher method to Encode a plaintext message

For an explanation of the Vigenere Cipher, read on. Codes and Ciphers 23

Encoded Court Intrigue During the Middle Ages, thick with intrigue and secret plots, the royal courts of Europe always sought to employ the finest code makers and breakers in order to help rulers guard against as well as uncover the plots of their enemies. When Mary Queen of Scots, right, was tried for plotting the assassination of Queen Elizabeth in 1586 in a failed attempt to seize the British throne, for ex- ample, Sir Francis Walsingham, Elizabeth’s ruthless spymaster, knew that he would have to prove beyond a doubt that she was behind the infamous plot before Eliza- beth would agree to her cousin’s execution. Fortunately, Thomas Phelippes, the court’s resident expert on code breaking, was up to the task and cracked the code Mary had used to communicate with her co- conspirators. In the end, Mary was condemned and Elizabeth herself signed the death warrant. As Mary learned the hard way, just as important as the ability to create a cipher that will keep your communications safe from the prying eyes of your enemies is the ability to crack your enemies’ ciphers and reveal the thoughts and plans of those who wish you or your allies harm. As long as there have been ciphers, there have been cryptanalysts. is the science of deci- phering a message without knowledge of the key. The science of crypt- analysis was invented is the study of the frequency of let- by an Arab in the ninth century, during the ters or groups of letters in an encoded message and has Golden Age of Islamic come to be the first step in breaking classical codes. Civilization. One of the many schol- ars who worked in Baghdad’s House of Wisdom at that time was the noted philosopher and mathematician Yaqub ibn Ishaq al-Kindi, pictured below in a Syrian postage stamp. During his career, Al-Kindi wrote nearly 300 books on a wide range of subjects, and his On Deciphering Cryptographic Messages was the first treatise to describe the science of letter frequency analysis. Frequency analysis is the study of the frequency of letters or groups of letters in an encoded message and has come to be the first step in breaking classical codes. Meanwhile, the West was still mired in the Dark Ages and the only places where the study of secret writing was encouraged were the monasteries, where monks strug- gled in search of hidden meanings in the Bible. Monks noticed deliberate instances of cryptography in the Old Testament. There are, for example, sections of text encrypted with , a traditional form of Hebrew substitution cipher. Atbash involves identifying the number fo places a let- ter resides from the beginning of the alphabet and substituting for it the letter that is the same number of places from the end of the alphabet. “A” becomes “z,” “b” becomes “y,” “c” becomes “x” and so on. Codes and Ciphers 24

Though the use of the atbash in the Bible was probably meant to add a sense of mystery rather than con- ceal meaning, it sparked the interest of the monks, who began rediscovering old ciphers as well as inventing new ones. In the thirteenth century, one English Franciscan monk named Roger Bacon wrote Epistle on the Secret Works of Art and the Nullity of Magic, which introduced no less than seven methods for keeping messages secret. As a result, it was the European Cryptograpy also became a tool of diplomats who monks who introduced the needed to keep their communications secret, and study of cryptology to the West, and by the fourteenth century its every government in Europe soon had resident use was widespread, especially by alchemists and scientists who spymasters and code breakers. wished to keep their discoveries secret. Geoffrey Chaucer, for example, author of The Canterbury Tales, also wrote Treatise on the Astro- labe, which included several encrypted messages. Cryptograpy also became a tool of diplomats who needed to keep their communications secret, and every government in Europe soon had resident spymasters and code breakers. Cryptography as a Burgeoning Industry By the fifteenth century, cryptography had become a full-fledged industry. After all, the Renaissance had resulted in an overall revival of the arts, sciences and education in general, and the rise of independent city states had concentrated power into regional fiefdoms, all of which were jockeying for power. Constant communications between ambassadors stationed in foreign capitals and their respective heads of state demanded secrecy, so each state had its cipher office at home and each ambassador had a cipher secre- tary traveling with him. Of course, with a greater need for codes came a greater need for code breakers, and each court had a group of cryptanalysts, as well. As the level of sophistication in methods of cryptography and cryptanalysis increased, ciphers soon grew more complicated than what had been the norm for centuries – a monoalphabetic substitution cipher, in which a message is encoded by a single sub- stitution cipher alphabet. Polyalphabetic substitution ciphers, in which the encoder switches between differ- ent cipher alphabets, was next. As far as can be documented, the first description of a was written by (1404-1472). Not long after, Alberti’s cipher was advanced by Johannes Trithemius (seen above in a tomb relief) who developed a similar cipher that shifted the encoding alphabet with every letter of the message. For this he created the (next page), a square containing 26 alphabets. What has come to be known as the Vigenére cipher was described by Giovan Battista Bellaso in 1586. His description of the tabula recta included a key that enabled the encoder to easily advance the shift with each letter. Codes and Ciphers 25

At the same time, government cryptanalysis was becoming institu- tionalized, so that by the eighteenth century each European power had what was first established in France in 1590 by Henry IV as the Cabi- net Noir, or Black Chamber, where teams of code breakers would work together to crack the most difficult ciphers contained in the correspon- dence of foreign diplomats and military personnel. Europe’s Black Chambers Since all foreign government and military personnel knew that their mail was being opened and exam- ined, encryption techniques grew in importance. The breaking of these codes was a direct forerunner of the modern system of scientific code- breaking. Few of these so-called Black Chamber groups could compete with the Geheime Kabinets-Kanzlei in Vi- enna, Austria, for both efficiency and discipline. Letters addressed to the embassies in the city were routed to the Black Chamber’s secret site from the post office by 7 a.m. Seals were melted and teams of cryptographers copied the letters. Within three hours, the resealed letters were delivered back to the post office so that they could still be delivered on schedule. Mail in transit through Austria would arrive by 10 a.m., and mail leaving the embassies for destinations outside Austria would arrive by 4 p.m. Each piece of correspondence would be copied before being sent on its way, and teams of cryptanalysts would then comb through them for hidden information. Besides supplying the emperor with a wealth of strategic intelligence, the Viennese Black Chamber would also sell information it had gleaned to other interested European powers. Cryptography was now practised in times of peace as well as war. Spying in the New World Organized spying came to the New World during America’s War of Independence, which lasted from 1775 to 1783 and resulted in British recognition of the United States’ independence and sovereignty in 1783. Early in the war it became clear to General George Washington, above right, that the ragtag American forces were no match for the British army when confronted in direct battle, so he set up a loose group of Codes and Ciphers 26 spies whose job was to spread misinformation that would enable him to delay battles until he could lure the British into situations that favored the American forces. After the loss at the battle of Bunker Hill in June of 1775, for example – where the famous order “Don’t fire until you see the whites of their eyes!” was given – the American forces were down to 36 barrels of powder, about nine rounds per man. Washington sent messengers into Boston to spread the story that he had eighteen hundred barrels, so the British decided not to attack at that time. In an effort to get knowledge about the British fortifications in New York, the next year Washington sent Capt. Nathan Hale, a schoolmaster before the war, to find out whatever he could. (Hale is depicted, left, in a postage stamp first issued in 1925.) Hale collected a lot of information on British military strength and the fortifications and wrote them in Latin on bits of paper which he kept hidden in his shoes. Unfortunately, Hale was spotted by someone who knew that he was a rebel sympathizer and he was arrested as a spy. On September 22, 1776, he was executed by hanging, but not before Hale made a last statement which is remembered today: “I only regret that I have but one life to give for my country.” Hale’s death inspired his Yale classmate and good friend Maj. Benjamin Tallmadge to work with Wash- ington as his chief intelligence officer in order to set up a more extensive spy network tasked primarily with gathering information about the size and direction of British troop movements. Tallmadge set about form- After passing on his information to the general, ing the Culper Ring, which grew into a group of Honeyman managed to “escape” and upon his return patriots – farmers, mer- chants, tavern keepers and told the Hessian commander that the Continental one woman known to this Army was in a state of such low morale that they day only as “355” – who together gathered informa- did not dare attack Trenton. tion and then relayed it by boat, horseback or on foot, to General Washington in the field. Because of Hale’s capture, Tallmadge made sure that all his spies all had codes and invisible ink within their arsenal of spy tools. Among the many spies who worked on behalf of the American cause were: • Lydia Barrington Darrah, who alerted Washington to a surprise attack planned by British com- mander General Howe, who intended to lead 5,000 men and 13 cannon to attack the Continental Army at Whitemarsh, outside of Philadelphia; • Margaret Kemble Gage, the American wife of General Thomas Gage, leader of the British Army after Howe; there is strong evidence that she tipped off the rebels to her husband’s plan to raid the armories at Lexington and Concord, inspiring Paul Revere’s famous midnight ride; • After gathering valuable information about the British garrison in Trenton, New Jersey by posing as a Tory, John Honeyman was “captured” by Continental forces and brought to Washington. After Codes and Ciphers 27

passing on his information to the general, Honeyman managed to “escape” and upon his return told the Hessian commander that the Continental Army was in a state of such low morale that they did not dare attack Trenton. Believing him, the Hessians relaxed security on Christmas Day, and Wash- ington made his famous crossing of the Delaware with 2,400 troops to rout the Hessians and score an important victory with the Battle of Trenton. Spying was not a one-sided activity during the Revolutionary War, however. Benedict Arnold (pictured at right), a leader of the Continental Army whose bold and cunning military victories during the first five years of the war eventually resulted in a commission as Major General under George Washington, is the most notorious turncoat and spy of the American Revolution. After being passed over for promotion by the Continental Congress and suffering mounting personal debts, Arnold decided to switch sides in a most dramatic man- ner. He arranged to obtain command of the fort at West Point with the intention of surrendering it to the British. To that end he began communicating with the head of British intelligence, Major John André. To disguise his communications, Arnold sometimes used a clever code that he himself had devised. Using standard published books like Blackstone’s Commentaries on the Laws of England or Nathan Bailey’s Eng- lish Dictionary, Arnold would first write his message and find each word of the message somewhere in the book. He’d then list the page, line and word number of each word, so the message would simply appear as a random list of numbers. Upon receipt, André would then look up each word in order to reveal the message. Over the course of months, Arnold also sent coded messages (disguised through the use of invisible ink) to André in let- ters that were passed through his wife Peggy’s women’s circle. (One of these messages can be seen at left.) In these messages Arnold supplied several types of information to the British, from troop movements and strength to the locations of supply depots, all the while attempting to negotiate payment for his services, which included the ultimate prize of the surrender of West Point. Arnold’s plan for the surrender would likely have succeeded except for the fact that Major André was captured with papers that revealed the scheme. As it was, Arnold narrowly escaped Washington’s forces by fleeing down the Hudson River. The unfortunate André was captured out of uniform one day and later hanged as a spy, right. Some decades later espionage thrived during the Civil War, as well. The Confederate Army used a brass cipher disk in order to encode messages us- ing the Vigenére cipher during the American Civil War. Codes and Ciphers 28

As we will see, the Vigenére Cipher is a polyalphabetic cipher, and the use of the disk enabled the encoder to switch to a different alphabet at any time, making the code seem difficult to break. In reality, however, the code was not difficult to break by seasoned code breakers and the Union Army was able to crack the South’s enciphered messages on a regular basis. The North, on the other hand, had better luck with its communications. Born into a prominent Richmond family in 1818, Elizabeth Van Lew nevertheless became an ardent abo- litionist after attending a Quaker school in Philadelphia. Living in the South made it an easy decision to do what she could to gather intelligence that would aid the Union. When the Civil War broke out and Richmond, Virginia was named the capital of the Confederacy, the outspoken “Crazy Bet” was viewed by her neighbors as more than a bit eccentric when she brought food, medicine and books on a regular basis to the By the beginning of the twentieth century a new chal- Union prisoners in the lenge was emerging, that of ever more sophisticated nearby Confederate Libby Prison. electromechanical encoding devices. What her neighbors didn’t know was that she usually came away from the prison with information about rebel troop movements that she sent straight to General Grant, gleaned not only from the prisoners, but also from the prison commander. In addition, she helped several prisoners to escape and advised them on the location of safe houses. Later, it is said, she managed to infiltrate President Jefferson Davis’ home by convincing Mary Bowser, one of her family’s former slaves, to seek a position on the household staff. Eventually, Elizabeth operated a local spy ring of twelve. She devised codes that included underlining words in books she lent to prisoners, wrote messages in a special ink that could only be read after milk had been applied to it, and transmitted messages to the North on paper rolled up and secreted in an empty egg shell hidden within baskets of eggs carried by her servants. After the war, Grant paid Elizabeth a visit to thank her for her service to the Union. “You sent me the most valuable information received from Richmond during the war,” he told her. Codes and Ciphers 29

The Rise of the Machines With the arrival of Samuel Morse’s electrical telegraph in the late nineteenth century, a new concern arose – how to maintain the secrecy of messages transmitted over newly emerging public technologies. Eaves- dropping was simply a matter of tapping into the lines at any point along the network. Within the next two decades, Marconi would also invent radio. Radio, too, would allow anyone to secretly listen in on communi- cations. Following World War I, the U.S. Army and State Department teamed to create the American Black Cham- ber MI-8, also known as the Cipher Bureau, in order to break the diplomatic communications of foreign governments. It achieved its first notable success at the Washington Naval Conference of 1921-22. The American negotiating hand during the first disarmament conference in history was strengthened by the fact that MI-8 intercepted and decrypted the communications between the Japanese government and its delega- tion. MI-8 was a forerunner of the National Security Administration (NSA), the main cryptologic intelligence agency of the U.S. government, founded in 1952 by President Harry S. Truman. For cryptanalysts the first big problem presented by all the new technologies was dealing with the dramati- cally increased volume of messages intercepted. By the beginning of the twentieth century, however, a new challenge was emerging: that of ever more sophisticated electromechanical encoding devices. For many years the most formidable of these was the German , seen above, originally invented by Arthur Scherbius in 1918, who believed the device would prove valuable to both the business community and the military. At first glance, the Enigma looks like an early typewriter that merely mechanized the process of encryp- tion, a machine version of pencil-and-paper cryptology that scrambled letters according to a key setting that would prove vulnerable to letter frequency analysis. A Keystroke of Brilliance Scherbius, however, had the brilliant insight of advancing the scramblers – there were 3 of them in the model designed for businesses – with each key- stroke, thereby changing the code itself every time a letter of a message was encoded. (The Enigma’s plugboard assembly can be seen at right.) Because of the movable scramblers, any cryptanalyst looking to crack the Enigma code would have to check some 10,000 trillion possible keys. Scherbius considered the Enigma impregnable but because of its high cost, he could find no buyers among the business community. The military, too, had little interest until Winston Churchill in 1923 published his history of World War I, entitled The World Crisis. In it he described how the interception and decryption of German communications during the war had greatly assisted the Allied cause. Forced to realize the failures of their own intelligence efforts, the German military decided to adopt the machine, more sophisticated than the commercial model, and by the beginning of World War II would pur- chase nearly 30,000 of them, ensuring that Nazi military communications would be protected by the most secure system of encryption that existed at that time. Codes and Ciphers 30

At about the same time, on a brisk fall morning in 1932, Marian Adam Rejewski, a 23-year-old Polish mathematics student, carefully wiped off his glasses, then leaned over a growing stack of papers in his small office located in the Polish General’s Cipher Bureau. While studying mathematics at Poznan University with an eye toward a career in insurance, Rejewski had attended a secret cryptology course for German-speaking math students given by the Bureau, and decided to accept a job offer after graduation. Over the next year, he would change the course of history. One of his early assignments was to tackle the German Enigma I ma- chine, which had baffled British cryptanalysts for six years. (The Enigma’s patent can be seen at left.) Though Germany had been defeated in World War I, the Poles wisely kept an eye – and an ear – on its neighbors. To the east lie Russia, anxious to export its communist philoso- phy, to the west Germany, which had ceded lands to Poland after its defeat and likewise seemed intent on someday getting them back. The Enigma I was an electro-mechanical device with a 26-letter keyboard and 26 lamps, each corresponding to a different letter of the alphabet. Inside were a plugboard that swapped pairs of letters, and three wired rotors, or “scramblers,” that scrambled letters as they were input. What made the Enigma so difficult to crack was that the code was advanced with every keystroke. The only way to decipher the message was to set a second Enigma machine to that day’s code settings. At the beginning of each message, however, the Germans added day and key settings to transmit a new three-letter (one for each rotor) message key. These message keys contained different scrambler orientations, though the plugboard settings and the scrambler arrangement remained the same as in the day-key settings. Had the Germans not added Rejewski put together a team and assigned them the the message keys, then each day’s messages – thousands grueling task of checking – by hand! – each of the of them – would have been encrypted in the same day more than 100,000 scrambler settings and cata- key, and the sheer volume of loguing every letter chain that was generated by each. messages would have revealed patterns in the letters, making the cipher much easier to break. By adding a new message key for each message, it was as though sender and receiver had agreed on a main cipher key, but then only used it to encrypt a new cipher key for each message. No wonder it had cryptana- lysts stumped. Working alone and in secret, Rejewski focused on the one point of the Enigma’s weakness that he could identify – the three-letter message-key setting, which was always transmitted twice at the beginning of each message. The first three letters would establish the setting and the next three would translate the first three into that new setting. Without knowing the day key or the message key, Rejewski could only track the relationships of the letters in the hope that they would reveal a pattern that might lead to the day key. The relationships he found estab- Codes and Ciphers 31 lished chains of letters, and he created tables to monitor and record these relationships, and note the links in each one. Thanks to the successful efforts of espionage, he eventually received a replica of an Enigma machine, so Rejewski put together a team and assigned them the grueling task of checking – by hand! – each of the more than 100,000 scrambler settings and cataloguing every letter chain that was generated by each. In the days before computers, it took his team more than a year to accomplish the task with only pencil and paper, but eventually Rejewski was able to compile a complete catalogue of Enigma’s scrambler settings. Then, in a moment of genuine insight, an inspired Rejewski realized that the parts played by the scrambler settings and the plugboard settings could, to some extent, be disconnected. By removing the cables from the plugboard in the replica ma- chine and entering intercepted , Rejewski was able to recognize certain phrases that resulted. The plugboard settings were then easy to deduce. Solving the mystery of the day/key settings and the plugboard settings together was impossible, but, by separating the two, each was solvable. In a little more than a year – without the use of a computer – Rejew- ski cracked the Enigma code. Even when the Germans altered the way they transmitted messages, Rejewski was able to invent a mechani- cal device that could rapidly check the more than 17,000 setting possibilities and thereby mechanize the process of cryptanalysis. In December of 1938, however, the Germans increased the security of Throughout the war, Germans never suspected the Enigma by adding two additional that the seemingly unbreakable Enigma code scramblers to the complex machine. Rejewski was without the resources to had been broken all along. develop the more complex mechani- cal devices that were needed to crack the new day-key settings and enable the Poles to translate the more complex encoded messages. On the eve of the Second World War it was decided that the Allies might have use of the Polish discover- ies. After a presentation of their findings to dumbfounded British and French cryptographers who had considered the Enigma absolutely unbreakable, a replica Enigma machine was smuggled out of Poland by a playwright and his actress wife. It eventually reached Great Britain, where British code breakers working in the Government Code and Cipher School in Bletchley Park succeeded in breaking the new, more complex Enigma. Two weeks later, World War II began with the Nazi invasion of Poland. Throughout the war, Germans never suspected that the seemingly unbreakable Enigma code had been broken all along. As more sophisticated mechanical encoding machines like the Enigma were developed, breaking the result- ing depended more heavily on the processes of searching, matching and statistical analysis, Codes and Ciphers 32 all tasks much more easily done by computer. Using computers rather than mechanical devices to create ciphers would provide three additional advantages, as well: 1. A computer can perform the necessary processes much faster than a mechanical device; 2. A mechanical device is limited by what can be built, while a computer program has no such physical restriction; 3. A computer works in bits – short for “binary digits” – rather than letters, providing a much wider array of characters to substitute or transpose when devising a code. Up until this time, the government and the military held a virtual monopoly on the use of computers. With the development of the transistor in 1947 and the integrated circuit in 1959, however, businesses and indi- viduals were able to take advantage of this electronic marvel. Encryption will never again be the province of mere brilliant mathematicians. The Future of Codes and Ciphers Where will future opportunities in the world of codes and ciphers lie? Surely, we live in a time of extraordinary communications capabilities: the President of the United States can pick up a handset in the White House and instantly speak to a battlefield commander anywhere in the world; about half the world’s Gross Domestic Product travels through the SWIFT (Society for Worldwide Interbank Financial Telecommunications) network every day; and anyone with access to a computer and modem can communicate with anyone else (equipped with similar technology), anywhere in the world. The Golden Age of Cryptography Many cryptography specialists consider this era to be the Golden Age of Cryptography, largely because as computer technologies continue to evolve, so will the challenges of those tasked with maintaining commu- nication secrecy, as well as those charged with unmasking the hidden communications of others. In the past, the two main users of cryptographers (and cryptanalysts) have been the military and the govern- ment. Current events ensure that the value of high-tech cryptographers will only increase in the future. One area in which cryptographers will always remain indispensable is that of military communications. As battlefield technology increases in technological complexity, systems designed to facilitate – and protect – communications will continue to evolve. Maintaining the secrecy of diplomatic communication will continue to evolve in complexity, too, as will intercepting and revealing communications from hostile nations. Historically, the onset of war has always meant massive attacks against a country’s telecommunications and communications networks. There have already been numerous examples of cross-border cyberterrorism, defined as the use of a target’s computer and information systems, usually via the Internet, in order to pro- voke real physical harm or damage to infrastructure. Codes and Ciphers 33

A Growth in Cryptography Use by Industry For that reason, industry has become a major user, as well. In addition to securing proprietary business in- formation, a company must also protect its electronic business processes from hackers, saboteurs and other intruders. It does this by monitoring its business processes, protecting them against infiltration, and identi- fying and taking defensive action against actual attacks. As the Department of Homeland Security has been charged with detecting, preventing, delaying and miti- gating any threat to the nation’s security, so too are companies in virtually every industry segment evaluat- ing their communications infrastructure for vulnerabilities to attacks that could cost human lives as well as money. Solutions are being built and deployed now that take a systemic approach to the question of security against sophisticated attacks on the nation’s infrastructure that were unthinkable until a few years ago. These systems must take a comprehensive approach to coping with challenges of scale to such elements as: • Access to a system, service or application (identifying users’ identities and granting either physical or virtual entry) • Security event management to detect intrusions and issue alerts • Threat detection, whether a computer virus or worm, or any kind of specific targeted activity of the type favored by saboteurs For the time being, the question of personal privacy seems to have been an- swered by Phil Zimmermann, right, whose concern about the erosion of privacy in the digital age drove him to invent the software he named Pretty Good Privacy (PGP), a so-far-unbreakable encryption package, aimed at the general public, but also available, of course, to the government. PGP is currently the most widely used email encryption program in the world. While Zimmermann’s insistence on protecting privacy at first created a firestorm of controversy – as well as a three-year grand jury investigation sparked by the FBI – in the end, he was cleared of any wrongdoing and PGP can now be purchased by companies wishing to safeguard their online transactions as well as down- loaded free of charge to individuals who only seek to protect their right to privacy. For the military, as battlefield weaponry continues to evolve, a need for real-time battlespace management is emerging. Real-time battlespace management is the receiving, processing and relaying of information related to battle systems in real time, in order to keep the chain of command fully informed at all times. Cryptanalyst Opportunities Predicting the future of cryptanalysis is always uncertain, but recent trends in technology suggest that there will be no shortage of work for some time to come. While there are certainly secure encryption systems in use today, not everyone has access to them, and, even if the specific content of a particular message is undecipherable, there is still information to be gleaned by skilled code breakers that may yield valuable information about the sender or receiver. Codes and Ciphers 34

There is also the need for protection from various computer-based weapons, namely, viruses, worms and Trojan horses: • A computer virus is a program that can copy itself and “infect” a computer without the knowledge of the user. It can also spread to other computers in files sent over the Internet or through a net- work. Like its counterpart in biology, a virus can do serious harm, like damaging programs, corrupt- ing or deleting files, or reformatting the computer’s hard drive. • A worm is a computer program that can replicate itself; it uses a network to send copies of itself to other computers to harm the network itself, rather than any particular computer on the network. • A Trojan horse is a program that installs malicious software while appearing to do something else, and appears harmless until it is actually executed. Evolving Opportunities Perhaps the most intriguing possibility for the future lies in whether the challenges in building a quantum computer will ever be met. The idea first came about whenDavid Deutsch, legendary physicist and the author of The Fabric of Reality, first hit on the idea that, instead of operating according to the laws of classical physics, computers should obey the laws of quantum physics. He went on to write a paper in 1985 that described how a quan- tum computer differed from an ordinary computer. Without going into the details of quantum physics, let’s just say that a quantum computer would, among other things, be able to complete a computation literally billions of times faster than an ordinary computer. That would probably consign today’s “unsolvable” codes to the rubbish heap of history literally in a matter of minutes, if not seconds. The only problem is that, while some steps toward making a working quantum computer have been made in the years since the debut of Deutsch’s groundbreaking theory, a working model is still only theoretical. Nevertheless, it is the bold, pioneering thoughts of the greatest mathematical minds that will continue to shape the future of cryptography for years to come. * * * Codes and Ciphers 35

Sources: 1. Singh, Simon. The Code Book. Doubleday, 1999. 2. Markle, Donald E. Spies and Spymasters of the Civil War. New York: Hippocrene, 1994. 3. Moore, Dan Tyler & Waller, Martha. Cloak & Cipher. George G. Harrap & Co. Ltd, 1965. 4. Pratt, Fletcher. The Story of Codes and Ciphers. Blue Ribbon Books, 1939. 5. Wrixon, Fred B. Codes, Ciphers, Secrets and Cryptic Communication. Black Dog & Leventhal, 1998. 6. National Cryptologic Museum web site at www.nsa.gov/museum/index.cfm Codes and Ciphers 36

Challenges You Will Encounter in Unit 2 As always, it’s important to make your program both mistake and tamper-proof in order to keep it from “cancelling.” It will also make your task easier if you spend some time focusing on developing techniques to simplify and clarify the processes you use to write code: 1. No doubt you have experienced the frustration of having to hunt down missing open and end braces, probably several times. Is there some sort of procedure you can put in place that will enable you to minimize these occasions of missing braces?

2. In designing and implementing the program loop in your Game of Pig project, you asked the win- ning player to play again, yet needed to create two additional loops to ask (and validate) whether the players wished to play again. Can you think of a way to unify the command language in order to make a program easier to use, as well as easier to design and implement?

3. In building the calculator program, you only had to cope with numeric entries, but ciphers will need to accommodate plaintext and ciphertext in letters. Since a computer views upper and lower case let- ters differently, what can you do to successfully cope with any text input, no matter whether the user entered upper case letters, lower case letters or a combination of the two?

Richard Feynman was an American physicist who earned a Nobel Prize in Physics for his work his study of subatomic particles. He was also an amateur painter, juggler, and bongo player. For all his advanced knowledge and brilliant thinking, Feynman always encouraged a down-to-earth attitude in everything, even the deepest scientific subjects:

“You can know the name of a bird in all the languages of the world, but when you’re finished you’ll know absolutely nothing whatever about the bird... So let’s look at the bird and see what it’s doing – that’s what counts. I learned very early the difference between knowing the name of something and knowing something.”