I’ve been away from the blog for a while enduring several straight weeks of travel, two of them overseas. Now I’m back home readying for the PDC by porting Silverlight samples to RC0 and writing new ones. If you’re coming to the PDC, I would love to see you at the Silverlight precon. We’re going to have a heckuva good time, and I’ll have lots of new stuff to show, plus Silverlight T-shirts to give away.

One of the samples I’m working on now, and one I’ll be sure to show at the PDC, is a software simulation of the German Enigma machine. My son’s going to use it in a project he’s building for National History Day (his topic: “The Tragic Genius of Alan Turing”), and I’m going to use it to encrypt all my e-mails (NOT!). I’ve long been fascinated by the Enigma and the ingenious reflection mechanism that turned it into a symmetric encryption/decryption device, and my interest was reignited when I read Charles Petzold’s new book, The Annotated Turing. Most of the core logic is in place, and you can actually encrypt and decrypt messages with it. What remains is to finish building out the UI and give it a more polished look. Here’s how it looks this morning:

Silverlight Enigma Simulator 

Rather than use lamps to display output as the real Enigma did, I opted to display a running stream of text in the TextBox above the keyboard. I may build in an option for switching between a set of lamps and the TextBox, depending on how much time I have.

Several different versions of the Enigma were used over the years. I opted to simulate one of the early machines that had three rotor wheels (in the configurations known as I, II, and III, in case you’re curious) and a “B”-type reflector. It’s pretty cool typing in sentences and seeing them encrypted, and then typing in the ciphertext and seeing the original message revealed. But you’ll see for yourself soon. I used animations to make the keys press down and the rotor wheels turn, and I used a simple MediaElement to add mechanical clicking noises.

The upcoming PDC is one you don’t want to miss. And not just because of the Enigma!