Enigma Machine Sim banner

Enigma Machine Sim

6 devlogs
19h 35m 42s

simple simulation of the enigma machine

Demo Repository

Loading README...

sbalaji07

oh by the gods this is enough, please tell me that you agree that this is enough. i never got around to getting plugboard functionality but i’ll have to do that soon (some day). the wiring actually works now, as you can see by where it gets output. this was a pretty fun project, and my code is a genuine abomination, but this was a pretty fun project.

Attachment
0
sbalaji07

i said i would do it. i did say i would do it. did they listen? did they harken to my words? i dont know, i dont know anymore, maybe you should ask them, maybe they have what you want. the visuals are a little barebones however it’s something, and i think it looks cool. i’m still figuring out the exact wiring, it doesn’t actually correspond correctly yet, however the outputs do work in the terminal,
which is in fact what i’m using to sanity check each step. the code for those wires is a genuine atrocity. a bete noire if you will. but oh well, if it works it works (it doesn’t work right now though)

Attachment
0
sbalaji07

fixed enigma machine, should have working cli operation. switched characters to being 0 index to fix the issue with the mod.

also planned out the graphical layout and started rendering the keyboard.

Attachment
Attachment
0
sbalaji07

added reverse rotor functionality, this is getting trippy. the reverse enciphering is definitely broken since it may output a negative number if the wheel rotates too much but I’ll just have to fix that later. for the most part, or rather, for at least a couple inputs (I’ve only tested a couple) it seems to be working correctly

Attachment
0
sbalaji07

separated modular functions into individual files and switched to the three rotors of Enigma I. now utilising an initialiser function to install all three rotors, allowing for changes in the ordering.

one key concept that took some time to understand is that the wiring of each rotor was exclusively within itself. That means, when a rotor rotates, functionally, the input is shifted by one, the mappings themselves never change, as is often easy to visualise. the implication this returns when simulating a compartmentalised process is that both inputs and outputs have to be shifted in accordance with rotation. a rotor shifted one place takes the input ‘A’ into the ‘B’ wiring, and the ‘B’ connection is what is activated on the other side of the rotor. Significantly, if ‘B’ corresponds to a ‘D’, then the next rotor does NOT receive an input of ‘D’, but rather an input of ‘C’, since the first rotor has been shifted by one position.

Attachment
0