Codes
Created | Updated Jan 28, 2002
What is a Code?
A code is a form of cryptology which takes words, groups of letters or entire sentences and replaces them with 'code groups', secret and nonsensical terms, that can be transmitted securely.
Codes require the use of codebooks in order to function, these are books containing the list of codegroups and the list of real words they relate to. Codebooks are difficult to produce, expensive to distribute and time-consuming to replace.
Types of Code
One-Part Codes have the alphabetic order of the codegroups in the same order as the plaintext words, this means that only one list needs to be kept.
Two-Part Codes have a randomised order of codegroups against the alphabetic order of the plaintext words. This is a more secure solution but is more complicated to produce and the codebook becomes twice as bulky.
One-Part codes are essentially quite easy to cryptanalyse, because the codegroup for 'cat' will always be alphabetically later than the codegroup for 'bat' and before the codegroup for 'dog'.
Two-Part codes are rather harder to cryptanalyse; in fact they can prove very difficult indeed. The history of all codes, however, is littered with clear examples of how they were, indeed, broken. The intercepted 'Zimmerman Telegram', the cryptanalysis of which brought the United States into the First World War, is the classic historical instance of the cryptanalysis of a two-part code.
The Zimmerman Telegram
While many ciphers have been used to protect the vital secrets of governments and armed forces through the most thrilling of historical events, it rarely falls to a cryptanalyst to change the course of history. Usually the modification of a battle plan, a slightly improved briefing for a diplomat or better understanding of enemy intentions is all that can be effected. In a few cases, however, the importance of the information wrested from the incomprehensible cipher is explosive. When cryptanalysis revealed the complicity of Mary Queen of Scots in the attempt to assassinate Queen Elizabeth I, it was important, continent-wide. The Zimmerman telegram had truly global import.
The story reveals so much about cryptology and the way it is used that it is relevant even today.
The year was 1917 and Europe was in the grip of the 'Great War', already more than half over. The battle lines on the river Somme had claimed hundreds of thousands of lives and the French mutinies at Verdun had begun to show even the sheltered civilians of the time how horrific the war had become. A belt of northern France and Belgium was denuded of foliage, replacing farmland and forest with mud, criss-crossed with trench, barbed wire and shellhole. Mighty Russia had been fought to a standstill in the East and the first stirrings of revolution were beginning to murmur in the Tsar's armies.
Across the Atlantic the United States looked on dispassionately. A war in Europe, however regrettable, seemed far removed from the farmers of Iowa and introspective politicians in Washington DC. In Britain, America was a major source of discussion. No top-level discussion could be held without someone asking how soon the two great non-European powers, America and Japan, would be forced to intervene. The question was reasonable: America in particular had become quite schizophrenic about international affairs. A brief war against Mexico and the construction of a brand new and impressive navy pointed to a nation looking to expand influence and join the 'club' of world states taking responsibility for events beyond their borders. However President Woodrow Wilson was categorically opposed to war, he had been under pressure to ally the US with Britain and France for a while but he had won re-election under the slogan 'He kept us out of war'. The American public did not want war and voted accordingly.
In Germany things were going even worse. British naval blockades had deprived the Kaiser of the necessary supplies to feed his population, his army was getting hungry and morale was falling. If Germany was going to win they had to unleash a decisive blow. The blow to fall was clear, in fact it had always been a part of the German plan, only stalled because of the unexpected absence of American troops in Europe. The Kaiser had vetoed the use of the feared U-Boats1 fearing that it would prompt Wilson to war.
Desperate times in Germany were forcing the Kaiser's hand so a complicated scheme was devised to control American reaction and the plan was placed in the care of Arthur Zimmerman, Germany's Foreign Minister. Mexico was the target of the plan and foolish America would provide the seed of her own undoing. The scheme was astounding in its ambition.
The first British naval act of the war had been to sever the telegraph cable running from Germany to the US. This forced German Atlantic messages to be passed via other countries or over wireless. The favourite route was through Sweden, a neutral country but with German sympathies. Initially Britain objected to this breach of neutrality. The Swedes responded by wrapping the German messages in Swedish codes, believing that Britain would now never know. They were wrong, but no further complaint came from Britain. This led the Swedes to believe that their codes had not been penetrated. Nothing could have been further from the truth!
The Zimmerman telegram itself was also transmitted by another route, handed in code to the US Embassy in Berlin it was encoded again in American cipher and sent to Washington where it could be passed to the German Ambassador. The Americans were unable to read this message, they had no idea what they were carrying.
The Americans used the cable from Denmark to Britain and then from Britain to Washington, obviously Britain collected copies of every message by that route, but the Swedish cable connected with Britain as well, so the British cryptanalysts were able to have a go at two copies, both in the same German code, one also in American code, the other also in Swedish code. The messages were taken to one of the greatest cryptanalysts of all time. Captain William Hall was an amazing polymath and a self-taught cryptanalyst and it didn't take him long to recover most of this message. It was sent from Zimmerman to von Bernstorff, German Ambassador to the US. What it contained was pure dynamite. It carried an instruction to pass the message on to the German Ambassador in Mexico. The message for the Mexican office read:
WE INTEND TO BEGIN ON THE FIRST OF FEBRUARY UNRESTRICTED SUBMARINE WARFARE. WE SHALL ENDEAVOUR IN SPITE OF THIS TO KEEP THE UNITED STATES OF AMERICA NEUTRAL. IN THE EVENT OF THIS NOT SUCCEEDING WE MAKE MEXICO A PROPOSAL OF ALLIANCE ON THE FOLLOWING BASIS:
MAKE WAR TOGETHER, MAKE PEACE TOGETHER, GENEROUS FINANCIAL SUPPORT AND AN UNDERSTANDING ON OUR PART THAT MEXICO IS TO RECOVER THE LOST TERRITORY IN TEXAS, NEW MEXICO AND ARIZONA. THE SETTLEMENT IN DETAIL IS LEFT TO YOU.
YOU WILL INFORM THE PRESIDENT OF THE ABOVE MOST SECRETLY, AS SOON AS THE OUTBREAK OF WAR WITH THE UNITED STATES IS CERTAIN AND ADD THE SUGGESTION THAT HE SHOULD, ON HIS OWN INITIATIVE, INVITE JAPAN TO IMMEDIATE ADHERENCE AND AT THE SAME TIME MEDIATE BETWEEN JAPAN AND OURSELVES. PLEASE CALL THE PRESIDENT'S ATTENTION TO THE FACT THAT THE RUTHLESS EMPLOYMENT OF OUR SUBMARINES NOW OFFERS THE PROSPECT OF COMPELLING ENGLAND IN A FEW MONTHS TO MAKE PEACE.
ZIMMERMAN
While revealing the message would give away the secret of British cryptanalysis, it could prompt sleepy America into wakeful rage. A decision was taken to wait, after all from the first of February American ships would be sunk by German U-Boats. America must respond then!
Astoundingly America did not, so a roundabout route was used to get a copy of the telegram that wouldn't arouse suspicion that cryptanalysis had been involved. Some old-fashioned espionage was used to get a copy of the telegram in Mexico City from the telegraph office, this was the telegram shown to the US government. In order to throw an even denser smokescreen around his success Hall filled the British press with disgusted stories demanding to know why Britain had been unable to discover this information for herself and relied on American skills. A smile must have played across his face when he read them.
The Americans were shocked and humiliated. Not only had Germany offered to give away part of the US to a foreign power but she had done so using the US government as courier! Finally Wilson faced evidence he could not ignore, the US entered the war on the winning side. While US forces had a fairly minimal impact on the front lines, the fear of a new fresh army on the way forced Germany into extravagant risks in order to win before America arrived. It is therefore true to suggest that the solution of this telegram was directly responsible for the defeat of Germany. There has never been a more important message solution.