The Imitation Game: Fact and Fiction

Last weekend saw the release of ‘The Imitation Game’ in which Benedict Cumberbatch and Keira Knightley star as Alan Turing and Joan Clarke, codebreakers that helped change the course of the Second World War. Amongst an ensemble cast, the story of Turing is told in three parts; his school days, Bletchley Park and his final, desperate years in Manchester.



“Britain’s Best Kept Secret”

Look what I came across when hunting through some old paperwork last weekend. My first ever visit to Bletchley Park, 1995, shortly after seeing the Channel 4 series Station X.


Click To Enlarge



  • The entrance was on Wilton Avenue
  • Tony Sale toured us around the site
  • The Churchill Collection was in the atrium of the Mansion
  • You could use an Enigma machine! It was bolted to a table in Block H.
  • The Bombe rebuild was just a metal frame
  • The National Museum of Computing was in its very early days – I remember playing with piles of computers in what is now the ‘Large Systems Room’



Enigma-E + Raspberry Pi = Enigma Pi

This is a follow-on from my previous post on building the Enigma-E (an electronic version of the Naval Enigma)

Huh. Turns out the Enigma-E can send its stream of cyphertext via a very simple RS232 port on the PCB. Now, what small little device could have fun with that I wonder?

Here’s the idea: Add a Raspberry Pi inside the case of the Enigma-E and create the world’s first Internet-enabled Enigma machine.

So, here’s what we’re starting with; an Enigma-E fully constructed and tested. The cable connected at the front is the current RS232 link.

I needed to get the Raspberry Pi talking to the Enigma-E over RS232. I decided to use an off-the-shelf USB-to-serial adaptor to do this for reasons that will become apparent. Thankfully, Maplin’s stock-item uses a well-supported chipset (PL2303) which the Pi is more than happy with. Plugged it in and there was the new device in /dev. A quick test in the command-line proved the Pi could happily talk to the Enigma-E.

Next, how to get the Raspberry Pi talking to the outside world? I wanted it to be as wireless as possible. Fortunately, Maplin saved the day again with the Edimax N150 Nano USB Wi-Fi adaptor. It’s tiny and supported by the Pi after a firmware update. Instructions on getting all this going are easily found on that Internet thing. A bit of fiddling around and I had a good reliable wifi connection running.

If the Raspberry Pi is going to be inside the Enigma-E’s box, how am I  going to talk to it if can’t get a wifi connection? There’s not a lot of space inside the box and on the front board, so I was reluctant to start making holes for HDMI and USB. Using a little circuit I had previously built, I had a solution. On the first build I had wired up the E’s RS232 terminals to a 3.5″ socket in the front plugboard. This was removed and in place went a hook-up to a logic-level conversion circuit that allows an additional RS232 connection to the low-voltage UART connection on the Raspberry Pi’s GPIO. I’ve covered how to build this circuit in a previous post. RS232 on a Raspberry Pi

Final challenge: Power. The Raspberry Pi needs a nice stable 5V but the Enigma-E needs a minimum 6V. Luckily, it’s also happy with 12V. So, get a cheap (but reputable) car USB power adaptor and gut it. Some drastic shortening of the cables later and we have a tiny 12V-5V convertor on board. I wired this up to the external power input for the Enigma, added a 12V supply and bingo, both devices happily powered up.

A final bit of securing of all the bits into the box, some very careful assembly (and an improved lampboard cover) and I’m done.

Oh, one more thing, we need some logos in a cheap-printed-WWII-style.

Now onto software. A simple PHP script monitors the Pi -> Enigma serial port. Anything coming in is then broadcast as a HTTP request to my server, which receives the request and stores it. When demonstrating the Enigma Pi, a page on the main web site retrieves the store and displays the cyphertext coming in live with some morse audio for good measure.

Thing is, in true software developer yak-shaving fashion, I wanted the person seeing the signal coming in to be able to decrypt it on the web site. I found a couple of Enigma M4 simulators but none were quite up to the mark. So, obviously, I had to build my own. 🙂

It’s taken a few weeks, but it’s done. A fully-functional Enigma M4 written entirely in JavaScript that can be used to send and receive encrypted messages to the Enigma-E.

Well, I’ve come this far, may as well go the whole hog. See, there’s only one Enigma-E, and that’s no fun if you don’t have it with you to play with. As I had developed the site this far, I decided to add the ability to send and receive messages using only the virtual Enigmas and email. I figured this may be useful is demonstrating how Enigma works, especially to younger visitors to Bletchley Park. The result is – The Virtual Enigma.

The site requires a modern browser (support for HTML5) so IE9 or above as well as recent builds of Firefox, Safari and Chrome all work nicely. Do try it out and let me know what you think.

The worst bit? This project has given me another idea. Maybe next year. :S

Send and receive Enigma messages at



Enigma-E Build

The Enigma-E is an electronic analogue for the M3 and M4 Naval Enigma machines. It’s a remarkable project developed by Paul Reuvers and Marc Simons of Crypto Museum. For you money you get a beautifully constructed PCB, all the components and a superb manual that walks you through the construction process. Seriously, it’s been a long time since if had such pleasure following a long set of instructions. The kit comes as just the naked PCB and components but you can buy boxes as well (as I did) to give it that real Enigma feel. Power is via an external supply or 9V battery.

Construction took me a couple of weeks, here and there, and was reasonably straightforward, the only heart-stopping moment being the separation of the plugboard and main board (went well, phew). A few mods to the box later and I had my own Enigma machine, which I intend to use on tours around Bletchley Park. For an added bonus, the Enigma E comes with a simple RS232 interface. From this you can receive the stream of encyphered text from the Enigma-E. The final photo shows a successful hook-up to my MacBook. This gave me an idea but that’s another post. 🙂

I thought anyone considering buying one of these may like to see how construction goes, so here’s a photo library of the build.

Enigma-E kits are sold exclusively through Bletchley Park and Museum Jan Cover. For more information have a look at Crypto Museum.



The U-Boat Story, Birkenhead

Did you know that only three U-boats from WWII still exist? One is in Germany, another in Chicago and the final one is in Birkenhead, Merseyside. I was fortunate enough to be in the area recently and went to pay it a visit.

U-534 is something of a mystery. Despite evidence that the sub had received the fleet-wide order from Admiral Dönitz to surrender, it refused to hoist its black flag and continued on its mission. Attacked by Liberator aircraft dropping depth-charges, U-534 was forced to give up the chase and all hands, bar two who perished in a lifeboat, surrendered to the Allies. The sub soon sank and lay at the bottom of the sea, north of Norway for 40 years.

Raised by treasure-seekers (they were disappointed), the wreckage was eventually saved and via a rather complicated route came to be aquired by Merseytravel, who turned the three pieces of the sub into a museum. It’s based at the Woodside ferry terminal and can be combined with the essential Liverpool experience of the “Ferry ‘cross the Mersey”.

The U-Boat itself is impressive. As it was cut into three pieces, they have taken advantage of this, lighting the insides so you can get a feel for the cramped and dangerous conditions they lived in. Photos above show the Siemens electric motor and the galley. You can also climb up the conning tower and even use the periscope.

The museum is in two sections; the U-Boat itself and a collection of salvaged items. My particular area of interest was the two Enigma machines found on board. One is in pretty poor condition but another is in one piece although badly corroded. They are of the later M4 variant, featuring the infamous ‘extra rotor’ that caused so many headaches for Bletchley Park. During the 10 month Enigma ‘blackout’ caused by the introduction of the M4, more allied shipping was lost in the Atlantic than the entirety of WWII combined.

I must commend The U-Boat Story on their presentation of the machines which includes a pair of great touchscreen Enigmas. These can be used to send messages to each other and  provide a walkthrough of setting up the machine including rotors and plugboard.

It’s a rare thing to see and breathtaking in scale. If you find yourself in that part of the world, don’t miss it.

The U-Boat Story




Turing Monopoly

If you’ve not heard, a special ‘Turing Monopoly’ has been released to celebrate his centenary and you still have a chance to bag this edition of the famous property trading game. What makes the Turing edition so special is the inclusion of  a replica of the hand-made board used by Max Newman and Alan Turing when at Bletchley Park. Turing was so good at Monopoly that Newman added in a diagonal line at make the game trickier. As well as the traditional board, a facsimile of the ‘Turing’ board is included with the rules as written down by Newman’s son. The original board was only discovered in 2011 by the Newman family and is now proudly displayed at Bletchley Park.

2000 of the Monopoly sets have been published, 1000 of which were immediately snapped up by Google, making the publicly-available sets even rarer. The property names are all from Turing’s history and the money features his famous passport photo. The few remaining sets can be purchased only from Bletchley Park for £29.99 plus postage.



GCHQ, Bletchley Park and ‘Hollywood Myths’

In a rare public speech given to mark Turing’s centenary, the current head of GCHQ, Iain Lobban, expressed regret at the way Turing was treated after the war whilst praising his achievements and calling out to Universities and other educational institutes that we must “find the next Turings”. This was a welcome speech, given at an appropriate time and certainly befitting and right.

As I read the report on The Guardian’s website, everything was going great until the last two paragraphs. They literally made my jaw drop.

Lobban also used the speech to explode some of the myths about Bletchley Park, particularly regarding the Enigma machine, which was used by the Nazis to encrypt messages.

“You have probably all seen the Hollywood version of the Enigma story,” he said. “The films showing heroic sailors leaping onto sinking German submarines to recover their Enigma machines. The truth around the initial acquisition is a little more prosaic. In 1926, Edward Travis, who later became director of GCHQ, went to Berlin and obtained an Enigma machine by the simple expedient of going to the manufacturing company and buying one.”

Myths? I hope that was the journalist’s choice of words. Sadly, this seemingly innocuous statement dismisses the sacrifices made by a number of seamen in the Battle of the Atlantic during World War II. Mr Lobban may be referring to the initial acquisition of an Enigma machine but there is so much more to it than that and such a statement, taken out of context, risks belittling those who gave their lives to supply Bletchley Park with information that helped turn the tide of World War II.

It is true that Alistair Dennison and the codebreaker Dilly Knox purchased Engima machines from Arthur Scherbius’ company. At this time Enigma was a commercially available product, targeted at the banking sector. It was a commercial failure but Scherbius was able to sell the rights to the German government, who had seen it’s potential for military application. What must not be implied is that the machines purchased by Denniston and Knox were anywhere near as hard to break as the Enigma machines used by the German military. Enigma was never one product. It was revised often and a family of machines emerged as the war years past. The first Enigmas to be deployed by Germany contained a significant modification; the plugboard or ‘steckerbrett’. This new front-panel, absent on any commercial Enigma, increased the possible combinations by a number in the region of 153,000,000,000,000 whereas the advertising for the commercial machines boasted ‘over 8,000 possibilities!’. I presume you can see the difference? This was by no means the only change made by the German engineers over the course of war.

Commercial Enigma (Photo Credit – Creative Commons)

Miltary Enigma With Plugboard (Wikipedia)

The circa-1926 machines had been broken by many but the same techniques could not be applied to the wartime Enigma machines. Great minds such as Zygalski, Rejewski, and Różycki, the three polish codebreakers, worked with Knox, Turing, Welchman and many others to achieve that feat.

Lets looks at the truth behind the “Hollywood version”, “The films showing heroic sailors leaping onto sinking German submarines to recover their Enigma machines.” What Mr Lobban fails to realise is that is exactly what happened. Yes, our Hollywood friends did rather make a mess of the whole U-571 movie which saw Matthew McConaughey single-handedly bring WWII to a close, the movie getting so many facts wrong in the process it made my head spin. Let’s deal with reality instead.

During World War II, few in German high-command ever believed that Enigma transmissions were being read. One who did was Naval Commander Donitz. His concern was such that he had the Naval M3 Enigma machines modify, adding an extra rotor to the existing three. When these came into use in mid-February 1942, the massive leap in complexity immediately locked out put Bletchley Park. During the next ten months the U-boats sank more ships in the Atlantic than in the rest of the war combined. Britain was left starving as convoys from the United States failed to make the crossing, falling to the ‘wolf packs’.

On the 30th October 1942, HMS Petard successfully depth-charged the submarine U-559. After several hours, during which U-559 lay hiding and damaged on the seabed, it was forced to the surface. A cannon from Petard ripped through the conning tower, ensuring the submarine could not escape. As the German sailors started to swim across to Petard to surrender, a rope net was sent out to create a bridge between it and the U-boat. Realising U-559 would soon sink as a result of damage it had sustained, the race was on to gather intelligence. Two seamen, First Lieutenant Colin Grazier and Able Seaman Anthony Fasson swam across to the U-boat as it started to list. They were joined on-board, unexpectedly, by Tommy Brown, a 16-year-old NAAFI canteen assistant who had lied about his age to serve in the Navy.

A search of the vessel revealed the 4-rotor Enigma and the all-important settings book, which contained information on how this new machine was operated. However, the U-boat started to list violently and as the Enigma was bolted to the table, they were force to leave it. The young men attempted to escape with the settings book but had left it too late. Grazier and Fasson perished with U-559 but Brown made it back on board HMS Petard with the vital information. The book was rushed to Bletchley Park and as a result of this and the capture of an Enigma M4 by HMS Bulldog in a separate raid on U-110, naval Enigma messages could be read once again. Within three months, the U-boats would be withdrawn from the Atlantic.

Both Grazier and Fasson both received the George Cross. Tommy Brown died shortly before he was due to receive the George Medal, trying to save his 4 year-old sister from a house fire. It was award posthumously and he was buried with full honours in Tynemouth Cemetery.

First Lieutenant Colin Grazier

Able Seaman Anthony Fasson

Tommy Brown

This is only one story, and only a summary of it. The fact is, there are many real stories were people gave their lives to recover Enigma machines. These are not myths and heroes like Grazier, Fasson and Brown deserve a better legacy.