Enigma emulator

Ad: This forum contains affiliate links to products on Amazon and eBay. More information in Terms and rules

Marcel

rotartsinimdA
Staff
Admin
Mod
10,986
5,352
Sep 19, 2006
Dordrecht
www.redbeatband.nl
Bit showing off.
As some of you know, I'm a programmer nowadays. A few months ago, I decided to write a simulation of the german Enigma M3 version (as in use by the Kriegsmarine from 1938-1942) from scratch in javascript/typescript for fun and learning purposes. Today I pushed it to my github code page and wrote a crude webpage around the code as well, so it can be usable. You can find it here EnigmaTs.

As I said it's very crude as I'm not a real frontend designer. It doesn't work well on a mobile device, yet, so if you want to try it, you'll need a full desktop/laptop to run it. But if it works for you, this simulation is as accurate as I could make it. It should be compatible with an original M3, but as I don't have access to one, I have not been able to test that.

For the interested, it works like thus:
In the menu bar, you can select Rotor Settings to select a rotor at each position (the machine has 3 rotors and a choice of 5 different rotor versions).

The rest happens on the middle console.

You'll have to set the start positions of each rotor on top with the number inputs.

The lowest panel represents the plugboard, where you can connect certain characters together by a (in this case virtual) wire (same colour represents two connected characters).
Then you can type. You can do that both by clicking on the keyboard just above the plugboard or by physically typing on your computer's keyboard. When you press a character, the encrypted character will light up in the light board above it.

Normally Enigma would be operated by two people, one typing, the other writing down the outcome. As a convenience, I added two 'notepads' next to the machine. On the left you see what you have typed, on the right the outcome of the machine.

Each time you type a character, at least one of the rotors will turn a notch, so even typing the same character twice in a row will not return the same character.

In order to decrypt, you set the machine back to your original starting position (helped by my convenient reset button that is not there on the real machine) and type the encrypted message. You will then get back the readable message.

As the original, there are no spaces or other special characters, no numbers and only uppercase.
Hope you enjoy it.

To learn more about the working of the machine and algorithm, wikipedia is a good start: Enigma machine - Wikipedia

Little test:
Rotor: V III IV
Setting: 13 2 22
Plug: EG OL IX SQ FT

HILEDODWBCJPIDHVQEHPMKSKUVVIICJQMLEXVXYLFUZPSYS
 
Last edited:
Wow.
 
It's my version of modelling. Consider this my model build of an enigma. Maybe sometime, I'll try to make a digital replica of the "Bombe". The machine designed by Alan Turing to crack the enigma code. That would be a nice project next to this one
Dude, that would be the WINNER.
 
Dude, that would be the WINNER.
Yeah, it'll take a while. The bombe is quite a bit more complicated than the Enigma itself. Nowadays we have much better computer algorithms to crack the Enigma code.

BTW I would not use my Enigma machine to really encrypt messages that you want to keep secret. I've seen algorithms that can crack most Enigma code in seconds without any previous knowledge about the message except for the language. The Bombe needed at least a few known words that should be in the message. In ww2, the Bletchly group quite often searched for the words "Keine besonderen Ereignisse" (Nothing to report) that the Germans used too much as a message.
 
Well done, Marcel!

I really hope to see an android version of this which includes more languages, Numbers, Special Characters and more...

Maybe even handwriting style fonts, like the ones in Word. Or a Morse to Enigma convertor!!!

I know it's not easy thing to do, but it would be so amazing, if you can do it!
 

Users who are viewing this thread