The Edison of Secret Codes
A good code must be easy for the receiver to penetrate but impossible for anyone else. Edward Hebern’s machines made that possible and were dispensable for America’s military, yet they never earned him enough to live on.
“This is something I’ve never told anyone,” says David Kahn, between sips of cola at the Century Club in New York City. On a rainy, humid early evening in May, punctuated by the sound of the occasional car horn from the street below, he has been holding forth on one of his favorite subjects: Edward Hugh Hebern, a seminal figure in twentieth-century cryptography.
Kahn, an editor at New York Newsday, is also a historian of cryptography and the author of The Codebreakers, the definitive history of secret communications. While researching his book in the early 1960s, Kahn spoke with the city editor of the Tribune in Hebern’s adopted hometown of Oakland, California. “He had heard or remembered that Hebern got the idea for his machine while he was in jail for horse thievery,” Kahn said. “I checked the California Department of Corrections records, and sure enough, he’d been in jail.”
Virtually all the great civilizations of antiquity, with the possible exception of the Chinese, devised and used forms of secret communications. In the fifth century B.C. the Spartans hid messages with “skytales,” the first known military cryptologic devices. A long strip of leather or some other flexible material was spiraled around a wooden rod the way stripes cover a barber pole. A message was written vertically on the material, and when the material was unwrapped from the staff, it could not be read. Rewrapping it on a dowel of the same diameter revealed the message.
That sort of ruse, involving rearranging the characters of a message instead of substituting one for another, bears little relation to the numerically based cryptology practiced today. Kahn traces the birth of this science—which embraces both encoding and decoding—to Arabic peoples, who pursued various forms of secret writing beginning in the ninth century A.D. , if not earlier. The very word cipher , in fact, comes from sifr , Arabic for “nothing.” Arabs apparently devised many different systems in which, for example, words were replaced with numbers or other words, or letters within words were replaced with numbers or other letters. They used them to conceal documents pertaining to warfare, weaponry, politics, diplomacy, taxation, and even magic. Early Islamic extremists used them to hide their beliefs from the orthodox sects.
Arab preeminence in cryptology began to fade and was seriously eroded by the seventeenth century. By then much of the action had shifted to Italy, where competition and vendettas among the many citystates and various powers of the Catholic Church made the science indispensable. Throughout much of the fifteenth, sixteenth, and seventeenth centuries, most of these governments (and others in Europe) employed their own cryptographers.
Although no one seemed to grasp it at the time, the most important advance in this period was the invention, around 1466, of the polyalphabetic system of encipherment, by Leon Battista Alberti. In this system, which is used in almost all modern forms of encryption, each letter in a word is replaced by some other letter, and there is not one replacement alphabet but many.
Say the letter E is encrypted as W . In an ordinary monoalphabetic system, all other E ’s in the message will also be replaced with W ’s. In a polyalphabetic system one E might be replaced with a W , the next with a Q , the next with an O , and so on. Although polyalphabetic systems were widely (but incorrectly) regarded as impenetrable, they didn’t entirely replace cruder forms of encryption for centuries. One reason was that they were tedious to use. In fact, polyalphabetic encipherment did not really come into its own until some four hundred and fifty years after Alberti’s work, when Hebern and others began inventing machines to encipher material polyalphabetically as it was typed.
Remarkably, less seems known about Hebern’s life than about that of Alberti, who was the illegitimate scion of a wealthy Florentine family. Not even David Kahn knows how a friendly, bookish man with no history of criminal behavior apparently wound up stealing a horse. Of Hebern’s early life and personality the details are especially scant. In January 1963 Kahn placed a telephone call to Hebern’s widow, Ellie. Leaving a card game she was playing with friends, she chatted for half an hour and provided Kahn and the world with virtually all that is known about the man’s upbringing and temperament. Out of respect and gratitude to Mrs. Hebern, Kahn never mentioned her husband’s jail term in his book.
Had things turned out differently, Hebern might have been the epitome of the self-made man. He was born in Streator, Illinois, on April 23, 1869, and raised in the Soldiers’ Orphan Home in nearby Bloomington. His adolescence was apparently spent in Odin, Illinois, where he lived and worked on a farm and went to high school. At nineteen he set off for California on a horse he had raised, a gift from the farmer. But it was haying time and, worried about the aging farmer, he turned back and stayed six more months to help out.
After he finally got to California, he spent some time in and around the town of North Fork, in the Sierra Nevada. He took up a timber claim, which he later sold to a sawmill where he worked for a while. For years he sent some of his earnings to the farmer in Odin. He met Ellie in North Fork in 1896, when he was twenty-seven and she was fourteen. Then their paths diverged for at least a decade. Hebern became a carpenter, built and sold homes in Fresno, and had his brush with the law. He was arrested in 1907 in Los Angeles County, and he served his term in San Quentin. After his discharge in 1909 he sought out Ellie and proposed “about fifty times,” she recalled, before she said yes.
They were married on June 29, 1910. Ellie told Kahn that in forty-three years of marriage Hebern never raised his voice to her. He wouldn’t even yell at their lazy cat, who was fond of sprawling in their apartment hallway. Hebern was a sturdy five feet nine inches tall with a thick shock of brown hair and cobalt blue eyes. The few pictures that survive are of a middle-aged, kindly, trustworthy-looking gent with a waxed-tip mustache and, in one photo, wire-rimmed spectacles.
How he got interested in cryptography is a mystery, but Ellie’s recollections leave little doubt that it happened during his incarceration. She recalled that Hebern, a voracious reader, had learned that some American codes had been broken, which set his mind to work on devising more secure means of encryption. Thus, around the age of forty, and with no formal training in the subject or in any related area, Hebern became a cryptographer. Precisely when he conceived of the rotor method is unclear, but he established a code-machine company in 1912, and in 1915 he built a system with two typewriters, one for input and one for output, with a single rotorlike device between them for encryption.
This system, according to Cipher A. Deavours—a top cryptologist and professor of mathematics at Kean College in Union, New Jersey—later became the basis for an important Japanese diplomatic cipher machine of the 1920s known as Red to American cryptanalysts. (Deavours, “Sy” to his friends, was named by his father, a Navy cryptographer during World War II.) The Japanese were prodigious consumers of American and European cryptography patents and owned copies of Hebern machines from the earliest designs. That connection, Deavours speculates, is partly responsible for the extraordinary success American cryptanalysts had in solving the Red machine.
All rotor machines, regardless of their complexity, shared several basic features. There was a keyboard for typing the message being encrypted. There was also some hardware for displaying the letters of the encrypted message, so someone could write it down and transmit it. In the beginning this hardware was usually twenty-six tiny round windows, each with a letter of the alphabet inscribed on it and a light bulb behind. Typing in a G , for example, might light the Z bulb.
To ensure that the next time G was typed the Z bulb did not light again was the purpose of the rotors. Striking a key on the keyboard completed an electric circuit running through a power source, one or more rotors, and one of the twentysix light bulbs. Exactly which one of the light bulbs got connected depended on the relative position of the rotors, which were somewhat smaller than hockey pucks.
Around their edges the rotors generally had twenty-six different positions, one for each letter of the alphabet. A common type had wires inside connecting each position on one side to a different position on the other. Electricity would go into one side of the rotor—at the position then aligned for the letter E , say—and come out the other side somewhere else, which would determine which bulb lit up on the machine. The wiring of the rotors corresponded to the replacement alphabet first devised by Alberti.
The distinguishing feature of the rotor was, of course, that it rotated, usually driven by the striking of keys. And each time it rotated, the translation of letters changed. If D was first encrypted as L , for example, the next time it might be encrypted as J or B or W , depending on the wiring of the rotor and how many keystrokes there had been in between. Multiple rotors could produce encryption patterns of nightmarish complexity. Much of the art in cipher-machine design between the wars was in designing rotor movements of ever more dizzying intricacy.
Like many good ideas, the rotor mechanism occurred to more than one person almost simultaneously. By the time Hebern got around to applying for his first patent on a device using the rotor mechanism, on March 31, 1921, patent applications for rotors had been filed in the Netherlands by Hugo Alexander Koch, on October 7, 1919, and three days later in Sweden by Arvid Gerhard Damm.
Nonetheless, the available documents seem to establish Hebern as the most original of these inventors. He produced the first drawings of a rotor system, in 1917, and apparently built a machine from these drawings a year later. An article on an early Hebern rotor machine in the December 1922 Popular Mechanics said that it had been “completed about four years ago.”
The delay in filing for a patent was uncharacteristic of Hebern, who had already patented all manner of cryptographic contraptions ever since founding the United States’s first cipher-machine company. Among these early inventions were a device for ensuring confidentiality in banking transactions, an electromechanical enciphering typewriter, and the two-typewriter system with the rotor in between.
Hebern’s 1921 patent application was for a simple onerotor machine, intended mainly for bank and steamship uses. It was not particularly secure, however, and it did not meet with much commercial success. It was quickly supplanted by a five-rotor model that would become the prototype for virtually all the enciphering machines Hebern made for the rest of his life.
Of the five rotors on this early machine, the rightmost one advanced forward one letter position each time a key was struck. It was known as a “fast” rotor. The others advanced at longer intervals governed by ratchet wheels. To begin using the machine, the sender would first adjust the rotors and ratchet wheels to settings prearranged with the receiver and set a knob on the machine to the “direct” setting, to put the machine in encryption mode. Then he would type his message.
As each letter was typed, one of the light bulbs would light up, indicating how the typed letter was being encrypted. As they lit up, one by one, these illuminated letters were written down to produce the encrypted message—what cryptographers call ciphertext. This message could then be sent in any of the usual ways—by telegram, telegraph, or radio.
To decipher the message, the receiver had to adjust the rotors and ratchet wheels to the prearranged settings, set the knob to “reverse” for decryption, and type the encrypted message. Again letters would blink on and off in the panel above the keyboard, now spelling out the message as it was originally written (called plaintext). For added complexity, the machine could be used backward, encrypting in decryption mode and decrypting in encryption mode.
The early 1920s were heady days for Hebern. He sold about a million dollars’ worth of stock in Hebern Electric Code. By September 1922 he was so sure of imminent huge orders from the Navy and Army that he began building a factory in Oakland. (Hebern’s previous products had been handmade in a machine shop, possibly in his home.) The striking three-story structure, on the west side of Harrison Street between Eighth and Ninth streets, was built to accommodate 1,500 workers and had a luxurious office for Hebern. It was covered with gold-colored terra-cotta, and a 1923 stockholders’ report said it was “one of the most beautiful structures in California and said to be the only building in the State of true Gothic architecture throughout.”
By the time it was completed the following year, it had cost somewhere between $380,000 and $400,000, and the company still had no income. In fact, its first sale, to the Italian government, was still twenty-three months away. Eventually Hebern would sell twelve of his early machines to the Navy, the Pacific Steamship Company of Seattle, and a few other buyers, but his ambitious building was repossessed. Today it is Oakland’s Asian resource center.
The construction of a palatial factory before receiving a single order will not inspire any business-school case studies, but it is not surprising in the context of Hebern’s boundless, unrelenting enthusiasm. He wrote what Kahn believes to be the only ode ever to a cipher machine:
Marvelous invention comes out of the West Triumph of patience, long years without rest Solved problem of ages, deeper than thought A code of perfection, a wonder, is wrought.
(There are four more stanzas in similar vein.)
He saw signs of success even in the numbers surrounding his company’s founding. Commenting on a move to temporary quarters in the 1923 stockholders’ report, he wrote: “If there is anything in the fortune of figures we should have a call from the Genii of luck when we move. The company was incorporated December 12, 1912; this reads 12-12-12. We will be located on the 12th floor and the number of the building is 1212 Broadway.”
While the building was going up, a Navy panel recommended adoption of the Hebern machine with certain improvements, mainly in mechanical reliability. Hebern Electric by now controlled 102 American and foreign patents and had 2,500 stockholders.
Of course, none of this counted for much in the face of a $100,000 mortgage and $20,000 in miscellaneous debts. By the spring of 1924, scarcely five months after the building was finished, the company defaulted on a payment. Hebern was replaced as its president. In order to meet the mortgage interest, a 10 percent assessment was levied on outstanding stock. Not surprisingly, this led to an uprising among stockholders and a subsequent investigation of Hebern Electric by the state’s corporation commissioner. On May 1, 1925, Hebern and J. A. Wright, a vice president of the company, were arrested and charged with violating the corporate securities act. So much for numerology.
In Washington, D.C., meanwhile, another setback was in the making. Late in 1924 the Navy was on the verge of adopting the Hebern machine as its standard cryptographic system. The Army was also evaluating it. As a final test the services submitted a set of messages enciphered by a fiverotor Hebern machine to William Friedman, the Army’s chief cryptanalyst.
Friedman, born in Moldova and trained as a plant geneticist, had been attracted to cryptography as World War I developed, and by 1925, when he was thirty-four, he already had a reputation as one of the United States’s foremost cryptanalysts. His renown was based on a series of stunning solutions, including those of a code used by a network of Hindu revolutionaries, a British field cipher, and, probably most challenging, an American encipherment system developed by AT&T. In 1924 he had helped investigators unravel the Teapot Dome scandal by solving messages that had been sent between two of the men implicated. However, these messages were not enciphered but rather encoded, meaning that numbers in a code book were substituted for the words, and decoding was merely a matter of figuring out which code book was used and looking up the numbers and their corresponding words.
With the Hebern machine a year later, on the other hand, Friedman faced his most difficult challenge so far. Early in 1925 he was given ten messages enciphered by the machine, each a little more than three hundred characters long. He was also given a copy of the machine and was told the starting positions of the two ratchet wheels and three of the five rotors, information an enemy might conceivably have. The other two rotors did not move in this version of the machine; they were known as stators. He was also apparently made aware that all the messages were enciphered with the same arrangement of rotors. What he had to do to decipher the messages was figure out how each oi the rotors was wired and the settings of the two stators. He did it in six weeks.
The solution of the messages was more a testament to Friedman’s genius than an indictment of Hebern’s machine. Friedman is widely regarded as the greatest cryptanalyst ever, in no small part because of the Hebern solutions. Parts of Friedman’s report on his solution are still classified by the National Security Agency.
In solving the messages, Friedman had to improve considerably upon a cryptanalytic technique he had devised years before. His “index of coincidence” method, first used in 1920, was related to the frequencies with which letters appear in plain and cipher texts.
Although its application is often quite complex, the underlying principle of the method is fairly simple. The basic idea is that when two long strings of plaintext are paired off letter by letter, there are more matches than when the same is done with ciphertext. The reason is that ordinary English has lots of E ’s, T ’s, A ’s, and O ’s and very few of certain other letters. This preponderance leads to a high rate of matches—about 6.67 percent. With two strings of ciphertext, which are essentially lists of random letters, matches can be expected only l/26, or 3.85 percent, of the time.
However, if a cryptanalyst aligns two messages enciphered with the same machine and settings, and if the enciphering sequence starts at the same point in each message, the frequency of matches will jump to 6.67 percent. That’s because if, say, the ninety-seventh character matches in two strings of plaintext, then the ninety-seventh character in the two resulting ciphertexts will also match, even if the letters in between are different. These were the basic principles Friedman marshaled to solve the Hebern machine. By working on character strings in the ciphertext and applying the index of coincidence repeatedly, he could determine the locations, the starting positions, and finally the wirings of each of the rotors.
As impressive as Friedman’s achievement was, it was made possible in part by a flaw in the Hebern machine that could easily have been corrected: having only one fast rotor, positioned at one end of the rotor bank. With that changed, “Hebern’s machine might have effectively served its intended purpose,” Deavours writes.
Back in Oakland, however, Hebern was never told of Friedman’s solution. Not that he was lacking for problems: The Alameda County district attorney, Earl Warren (later Chief Justice of the United States), was accusing him and Wright of selling for three and five dollars shares that had a legal, or par, value of one dollar. On March 4, 1926, Hebern was found guilty. A cynical numeroloeist might have noted that a twelve-member jury deliberated for only twelve minutes on a month and day that multiplied to twelve.
That June Hebern Electric Code filed for bankruptcy. Hebern requested, and was granted, a retrial. On August 8, 1927, the charges against him were dismissed.
Irrepressible as always, Hebern had by then incorporated another outfit, the International Code Machine Company, in Reno, Nevada, and secured a Navy contract for four machines. His original five-rotor model, the one solved by Friedman, turned out to be seminal. It inspired an extensive Navy program in cipher-machine development from about 1925 through the early 1930s.
For some of that time Hebern was a consultant to the Naval Code and Signal Section. He also continued refining his designs. This led to improved five-rotor machines that went a long way toward eliminating the weaknesses of his original five-rotor design. In these machines Hebern began experimenting with more complicated rotor sequences. There are more fast rotors, the operator can choose which rotors will be the fast ones, and complicated arrangements even allow some rotors to control the movements of others.
The most successful of this group was the modified Hebern Cipher Machine (HCM), which, like his original machine, had five rotors and two ratchet wheels. Unlike the original, however, it had three sliding switches, called dogs, which let the operator control the movement pattern of the rotors. With this machine, two or three of the rotors were fast, another one moved after 26 letters had been enciphered (“medium”), and the remaining rotors moved only after 650 letters had been enciphered (“slow”). Which rotors were fast, medium, or slow depended on the dog settings.
In 1931 the Navy bought thirty-one of these machines for $54,480. It was by far the most Hebern ever earned from his pioneering ideas and decades of work on cipher machines. These thirty-one machines, issued to a group of flag officers, were the Navy’s highest-level cryptographic system in the early and mid-1930s. After five years they were refurbished and reissued, along with two newly purchased machines, for lower-level duty handling traffic among naval bases. They were still being used after the United States entered World War II. In 1942 two of the refurbished machines were captured by the Japanese, and the others had to be destroyed.
In 1932, shortly after the machines were purchased, Friedman and his three top assistants again tried to decipher sample messages. In this attempt they could manage only partial solutions. “The attack on the modified HCM marks a decisive turning point for Friedman’s career as a cryptanalyst,” Deavours has written. “His reluctance to think in terms of automated cryptanalysis, combined with a heavy administrative load, was to put him more and more out of contact with the mainstream of the subject.”
Despite the strong impact they had on each other’s careers, Friedman and Hebern may never have met. One of Friedman’s top assistants during the 1930s and 1940s, Frank B. Rowlett, says that he cannot recall any direct contact between the two men.
How did Friedman regard Hebern? He “had a great deal of admiration for him as a machine builder, but he didn’t think too highly of him as a cryptographer,” Rowlett said. Hebern’s “machines were beautiful … mechanically excellent,” he added, “way out in advance of what the Europeans had done.” But the early ones were “cryptographically poorly designed.” Although their merits continue to be debated, it seems clear that they were the inspiration and basis for the most important program of cryptographic-machine development immediately before the Second World War. The Army Signal Corps’s partial solutions of the modified HCM led the Navy, with Hebern’s help, to continue refining its cipher machines in the early and mid-1930s. This effort led to the Electric Cipher Machine (ECM), Marks I through III. Marks I and III owed a debt to the HCM; the latter was essentially just a modified HCM with a few additions. But the extraordinary Mark II would go on to become the highest-level American cryptographic device in World War II.
The Mark II, also known as CSP888/889 (and in the Army as SIGABA and M-134C), was almost certainly the most secure machine used by any combatant in the war. It was an extreme rarity among cipher machines—one that, as far as anyone knows, was never solved by hostile cryptanalysts. “One cryptanalyst from NSA told me that he never heard of anyone ever breaking it,” says Deavours. “That was a pretty high-level guy.”
As secure as it was, it was not perfect; it had occasional mechanical malfunctions and weighed about six hundred pounds. Nonetheless, it remained in service in various capacities until well into the 1950s. “They finally took it out of service because it was too big, not because it stopped being secure,” Deavours explains. By then rotor-based machines were starting to give way to all-electronic models with transistors.
Although some details of the ECM Mark II’s operations remain classified, it is known that it had fifteen rotors, only five of which actually enciphered letters. There were no dogs; instead, the other ten rotors controlled the movement of the five enciphering rotors, making the enciphering pattern quite complex. At a given rotor position, for example, the next letter encipherment could result in any combination of the five rotors moving a step. The machine was the subject of a secret patent by Friedman and Rowlett. Rowlett, who was also the key figure in breaking the most important Japanese code of the war era, deserves the larger share of the credit.
How much did the Mark II owe to Hebern? Opinions vary. Rowlett says, “Knowledge of the Hebern machine was useful, but was not responsible for the development” of the Mark II. Deavours, however, says, “If they hadn’t been considering machines like the Mark I … Rowlett probably never would have thought of the Mark II.”
Hebern’s original five-rotor machine and the Mark II did share at least one feature: Their enciphering rotors were wired according to a principle known as the interval method. Rather than connecting the twenty-six letter pairs straddling each rotor in random fashion, the pairs were chosen so that the enciphered message would have, to the extent possible, the same number of A ’s, B ’s, C ’s, and so on. This method makes messages harder to solve for cryptanalysts; it is still classified by the U.S. government.
Unbeknownst to the designers of the Mark II, Hebern had apparently come up with the interval method some ten years before, a fact only uncovered by Deavours in the early 1980s while studying some early Hebern rotors. “I remember thinking I must be dreaming; he couldn’t possibly have known this,” Deavours recalls. “It’s certainly not what you would expect from one guy working alone, practically inventing the subject as he went along.” Nor is there any doubt that Hebern knew what he was doing. “ Every one of its five rotors is wired in this way, so it couldn’t have been a coincidence.” Why Hebern dropped the interval method after using it on the original five-rotor machine is unclear.
For Hebern, the mid-1930s began a string of disappointments. In 1934 he submitted a machine to the Navy about which little is known other than that it turned out to be “a complete failure,” in the words of Laurance Safford, the Navy’s top cryptanalyst at the time. Safford and S. C. Hooper, who had been Hebern’s chief naval contacts, were assigned to other duties, and Hebern got a curt letter from a Navy functionary discontinuing business with him. “They pulled the rug out from under Hebern and were not even polite about it,” Safford later commented.
In October 1938 Hebern applied for a patent on his multiple-rotor mechanism only to find that a patent for such a device had been granted five months earlier to IBM. Hebern had not filed earlier because the Navy would not let him, out of concern for the device’s confidentiality. An interference case ensued, and Hebern lost it on April 28, 1941.
He remained active as an inventor, and not just in cryptography. He filed a patent application in November 1938 for a “printing telegraph system,” which converted electrical signals of different time duration to letters or numbers. The signals could be sent by either radio or wire. In 1940 IBM expressed interest, but it eventually declined to acquire the rights to the patent. For Hebern a contract would have meant much-needed cash; by this time he and Ellie were living mainly on income derived from property inherited from Ellie’s sister.
Hebern finally took action against the armed services on September 3, 1947. He charged the government with reneging on promises of future contracts or compensation in exchange for Hebern’s agreement not to patent or disclose some of his inventions. He also accused the services of infringing on six of his patents in the machines they developed. The armed services rejected the claims more than five years later, on January 22, 1953. Hebern had died the previous February at the age of eighty-two after trying to lift a heavy box. Other than his suit against the government he left no estate.
After the rejection Ellie pursued the suit in the U.S. Court of Claims, filing a petition on May 19, 1953. “After he died, the lawyers tried but couldn’t do anything without Mr. Hebern,” she later recalled. The case was hobbled from the start. On the basis of legal technicalities, the claims court narrowed the issue to prevent any consideration of whether the government had used the rotor concept, as pioneered by Hebern, in thousands of machines during the 1940s and 1950s without adequately compensating him.
That Hebern had at least been strung along is hard to dispute. Hooper, who had been made an admiral and had risen to director of naval communications, testified at one of the hearings that the Navy “kept buying machines to keep Hebern encouraged.” Finally, in 1958, when it appeared that the court might order the release of some sensitive information, the armed services agreed to a $30,000 settlement.
Hebern does not seem to have been embittered by his treatment, which is perhaps not surprising, considering his natural ebullience. Kahn wrote to him in 1946 as a teen-ager to ask where he might buy or rent one of Hebern’s machines. Hebern responded by packing one up and shipping it to Kahn.
“Any suggestions you may make for the improvement of the cipher system will be greatly appreciated,” Hebern wrote Kahn. “As a loyal American, my whole effort for years has been to perfect a cipher system that would give our Government the advantage over other nations in having a secure means of communications when the need is vital.”