Showing posts with label cryptography. Show all posts
Showing posts with label cryptography. Show all posts

22 May 2013

Breaking the Code


If you asked my uncle Charlie what he did in the Second World War, you got some evasive boilerplate about working for Army Intelligence. He'd tell you that during the Bulge, say, his unit searched abandoned German command posts for compromising material, and sometimes it was touch and go, because the battle lines shifted back and forth, but he was generally close-mouthed about it, and made his service out to be pretty much routine duty. He did in fact have an old Third Army sleeve insignia, a pin with the white A on a blue field, circled in red, so there might have been some truth to that Battle of the Bulge story. If there was, it was a very small part of the truth, because he was actually in on one of the biggest secrets of the war.
It was called ENIGMA, and the product was code-named ULTRA.

Enigma machine
ENIGMA was an encipherment system, used by the German military and diplomatic services. Polish intelligence did the initial heavy lifting, reverse-engineering captured German equipment, and passed their results on to the Brits in 1939. British code-breakers set up shop at Bletchley Park, north of London, and began reading Luftwaffe and Army traffic.

To simplify enormously, the Enigma machine was a transposition cipher device with a typewriter keyboard. There were three rotors inside, each with twenty-six characters. When you struck a key, the first rotor advanced one position, until it reached twenty-six, and then the next rotor advanced, like an odometer. In other words, any given letter was substituted with another, but the possible combinations were twenty-six to the power of three. The rotor settings were predetermined, but they changed every day, in theory. One weakness Bletchley Park exploited was that the German operators didn't always change the settings daily. Another was that messages were sometime sent in plaintext, for redundancy, and you could compare the coded transmission to the uncoded one. If not for German security breaches, the coded traffic might well have proved unreadable.

Rotors
Then they hit a bottleneck. German naval security had always been more rigorous than that of the Luftwaffe and Wehrmacht, and the Kriegsmarine introduced a machine with four rotors. The number of possible character substitutions multiplied, and the traffic went dark.

In the North Atlantic, the convoys that were Britain's lifeline had no effective air cover or escorts, in 1940 and '41, and crossed two thousand nautical miles of unpatrolled open ocean.  Here the wolfpacks hunted. The loss of Allied tonnage was crippling. Bletchley Park needed to break the U-boat codes or the resupply would founder.


Alan Turing
The guy who probably deserves the most credit was an eccentric mathematics done from Cambridge named Alan Turing, who'd been recruited by the Government Code and Cypher School even before the war began. Turing designed an analytical machine, a numb-cruncher, in effect one of the earliest computers, a bombe, so-called.  With it, they "unbuttoned," Turing's word, the German naval ciphers, and shortened the Battle of the Atlantic. It's no exaggeration to suggest they shortened the war.


Model of the Bombe
At its peak, Bletchley Park was reading 4,000 messages a day. The decrypts tipped the balance in every campaign from North Africa to D-Day. (They were never shared with the Russians, however. Churchill's mistrust ran deep.) The people who worked there didn't talk about it, then or later. They maintained their habit of silence, and the whole story didn't break until thirty years afterwards. It was a better-kept secret than the Manhattan Project.

Alan Turing died in 1954. He was queer, and MI-5 hounded him, as a security risk. He underwent chemical castration, and was eventually driven to suicide, his contribution to the war effort unrecognized at the time of his death. Some thirty years later, Hugh Whitemore's play "Breaking the Code" opened in the West End, with the astonishing Derek Jacobi as Turing. Sodomy hasn't been criminally prosecuted in Great Britain since the repeal of the gross indecency acts in the late '60's. A legislative motion was introduced in Parliament to grant Turing a statutory pardon, just this past year.

I don't want to wade into the question of gay civil rights, although it seems to me obvious that without legal protection, homosexuals are still fair game. Turing was blackmailed by the law. His reputation doesn't deserve just rehabilitation. This has already happened. The computer library at King's College, Cambridge, for example, is now named after him, and he's widely accepted as a pioneer in Artificial Intelligence (the Turing test), and secure speech, the Delilah program. I'm saying that he deserves a posthumous knighthood, or an Order of Chivalry, at the least. This odd, cranky-pantsed fairy did as much to beat Hitler as any divisions in the field.

Churchill was later to say: "ULTRA won the war."



Editor's note: Software developer Terry Long has created a free Enigma Simulator. If you happen to use a Macintosh, download it and try it out.

Enigma