I have always had an interest in computer security, probably inspired by films like Hackers and scenes like ’this is a Unix system’, and along with this interest I have been fascinated by cryptography.

This lead to me reading The Code Book by Simon Singh which I think is the perfect introduction to the subject of cryptography. It doesn’t require any technical knowledge, and doesn’t dive in to complex maths, but rather presents the history of cryptography starting with Caeser Cyphers and moving all the way through to modern public-key cryptosystems. The book fully explains the background of why each advancement was made, illustrating the cat and mouse chase between the cryptographers and their enemies.

I found the book really inspiring and after reading the chapter that described the workings of the Enigma machine, I had to try coding it. The following is the result of an afternoon of procrastination, so it’s not the best code, however it should be relatively easy to understand and it achieves what I set out to do.