Cryptography is the process of rendering language or writing illegible (encryption), then converting it back to legibility (decryption) by use of a secret key. Cryptanalysis is the science of attempting to read the illegible information without the use of the secret key.
What is a Code?
A code is a form of cryptography which takes words, groups of letters or entire sentences and replaces them with 'codegroups', secret and nonsensical terms, that can be transmitted securely1.
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.
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 for encryption and decryption.
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 for example 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 'Zimmermann 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 Zimmermann Telegram
While many codes and 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 in the 16th Century, it was important continent-wide. In the 20th Century, the Zimmermann 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'. 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 cracked. Nothing could have been further from the truth!
The Zimmermann Telegram was also transmitted by another route. Handed in '0075 code' to the US Embassy in Berlin, it was encrypted again in US code 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 US Embassy 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 US 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 and his team long to recover most of this message. 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.
While revealing the message would give away the secret of British cryptanalysis, it could prompt the USA into joining the war. A decision was taken to wait - after all from 1 February US ships would be sunk by German U-Boats. The USA must respond then!
The USA did not rise to that bait, so a roundabout route was used to get a copy of the telegram that wouldn't arouse the 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 the success and manipulation, 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 US skills. A smile must have played across his face when he read them.
The Americans were shocked. 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 President Wilson faced evidence he could not ignore and the US entered the war. The fear of a new fresh army on the way forced Germany into extravagant risks in order to win before it arrived. It is therefore true to suggest that the cryptanalysis of the Zimmermann Telegram was directly responsible for the defeat of Germany. There had never been a more important message solution.