Emulating Enigma Encryption Machine.

Nikos Mouzakitis
Sep 6, 2018 · 2 min read

Enigma machine was used by Germans in WW2 for message encryption.
By using the same secret(to adversaries) rotor configurations, encrypted text transforms into the original message.
The Enigma was consisting of three rotors, where the signal of each letter pressed, was crossing once in the way to a reflector and then crossing again obviously in the reverse direction. Each rotor upon completing a full cycle kicks the next rotor to move having as a result a different mapping on the letter’s output.

So the real secret combination was the ‘starting’ positions of those three rotors.

Adjustment could be done also on a 13 permutation cables between the 26 letters of the alphabet as well, meaning by that that in a permutation; letter A could become letter L signal traveling within’ the rotors and vice versa.

In the following link someone can inspect the code used , it was developed using Java language.

Here we encrypt our message by using a configuration on the rotors as first step.

Encryption of plain-text using (3,6,18) rotor configuration.

If the receiver of the message knows the initial rotor configurations, will have as an output on his side the following when decryption takes place.

Decryption using the same initial rotor configurations.

If someone does not know the configuration will end up with a message of containing nothing profitable in the context of information.Below:

Decryption using a random rotor configuration.

Germans back on Enigma’s days used to change the configurations daily; each 06:00 am message was encrypted using the days new configurations.

Worth to mention the code breakers in Bletchley Park (including Alan Turing) who actually managed to break the Enigma code before the WWII ends and helped the Allies in the espionage, strategic and decision making sectors.

Nikos Mouzakitis

Written by

Graduate of Mathematics Department in University of Aegean, Currently Computer Engineer undergrad.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade