Share your repls and programming experiences

← Back to all posts
Enigma Machine ^_^
NihalAnand (32)

Yeah, I made a commercial-grade Enigma machine, as used by the Germans during WWII.

NihalAnand (32)

@abdullahrajput9 Thank you so much! I got inspiration for this from the Numberphile video explaining the Enigma machine ( I didn't have a real one, and I wanted to try and send codes myself. So, I made it in Python!

OldWizard209 (1111)

Yeah but putting in a program is pretty epic. Good job @NihalAnand

Keep it up

StealthySniper (8)

This is really cool. 1 thing though, didn't the enigma machine have a plugboard. Otherwise, nice job!

NihalAnand (32)

@StealthySniper The military grade machines do, while commercial machines (like this one) do not.

xxpertHacker (860)

Nice job!

Literally one of the first things that I ever wanted to when I learned to program was to create an Enigma machine (but I was too much of a noob to have actually done it at the time)

Also, how hard could it be to create a mock plugboard, wouldn't it just be a hashmap/dictionary of characters to other characters?

NihalAnand (32)

@xxpertHacker It isn't difficult at all, it's more that actually implementing the user input for that makes it really confusing and isn't well suited for the terminal format.

NISHoriginal (8)

Great project!! But just a recommendation, please include some error handling so that the code doesn't abruptly stop when the user inputs a wrong option, and asks the user to enter an option again... I would be very happy if you'd do that!!

NihalAnand (32)

And, of course I whiffed it the first time through. It now has the reflector system in place, so messages are EVEN MORE RANDOM!!!! ^_^

tankerguy1917 (174)

1st. 6
2nd. 20
3rd. 26
this is pretty cool, btw

NihalAnand (32)

@tankerguy1917 Thanks, that means a lot! ^_^

NihalAnand (32)

@tankerguy1917 Also, I'm sorry to say, but your message no longer works because I messed up in making a certain part of the encoding process. I fixed it, but that means that codes generated by the previous version no longer work.

tankerguy1917 (174)

@NihalAnand oh. well it said hello there NihalAnand

AnvayMathur1 (9)

@NihalAnand Was it that a letter could encode itself? This message says so since it encoded the first H to H.