Enigma in Python
A huge side interest of mine is history, especially with regards to military and militaria. Naturally, WWII is quite a hotspot and technology-wise there are a few things from that era I have a soft spot for...

It is from here (and a touch of productive boredom) that I came up with the idea to implement the well-known German Enigma encryption in Python. Obviously I won't go into the gross details of how an enigma machine works, but I implemented the working of the military Enigma Mk 1, which used three rotors, a static reflector, and adjustable ring. As a side note, the Kriegsmarine - the Navy - used more sophisticated machines and methods to make the encryption even more robust.

Below are encryptions and decryptions of a test message under two different enigma settings. A neat characteristic of enigma is that as long as the setting is identical, an enigma machine can decrypt an encrypted message with no modification.

Source Code