(Nov-13-2017, 05:00 AM)AceScottie Wrote: I dont fully understand the enigma machine however i did create a working version in python
there are 3 keys which represent the encoder used
to use the file, save it and run 'python file.py inputstring 0 0 0 encrypt'
That should create you a random key, encrypt the inputstring with that key, the print the output and key into the terminal
'input is input k1 = 3 k2 = 19 k3 = 1 and output is ['n', 'l', 'g', 'e', 'w']'
to decrypt simply put the encrpted text and key into the same process and set it to decrypt mode
'python file.py nlgew 3 19 1 decrypt'
input is nlgew k1 = 3 k2 = 19 k3 = 1 and output is ['i', 'n', 'p', 'u', 't']
the way to encrypt and decrypt is the exact same almost to a point.
I and taking the value from key1 * key2 * key3 and then using modulo to find the letters offset.
#aplah is a list of the alphabet # keys are a global variable encryption = key3 * key2 * key1 # creates a number between 0 and 15625 pos = alpha.index(L) # finds the position of the letter in the alphabet eL = alpha[(pos + encryption)%26] # adds the result of the keys to the position of the letter while looping arround the alphabet key_increment() #increments the key by 1full code:
https://pastebin.com/XzbhFJSF
the only difference between encrypting the data and encrypting it is as simple as + or -
additional, if you mix the alphabet up you will get a completely different key that should still work in reverse
Edit:
Also, Thanks this was a pretty fun project to work on.
Thank you very much for your support and help with the program! Sadly, it doesn't answer the problem I have.. I am searching a program, that uses the principles of encription that resembles mine, so the enigma machine.. The letter has to go through rotor 1, then rotor 2, rotor 3, the through mirror and then back through rotor 3,2 and 1.
I hope you still have time and understand what I mean.. If possible, I need my program, just improved so the decription works. Thank you a lot!
(Nov-12-2017, 10:37 PM)Larz60+ Wrote: I saw the display at Ft. Meade when I lived in Virginia at the cryptography Museum.
Know all about it. That machine was used only a few years before I was born,
(Yes, I was born in the first half of the last century (My grandchildren ask what the civil
war was like, and I have to remind that that it was nearly 100 years before my birth).
and is probably why WWII was not one by Germany. One was captured early on,
and decoded by Alan Turing, the Germans never knew, and continues to use them. Most
all messages were intercepted by the British.
If you don't have an answer by tomorrow A.M., I'll give it a go. Right now, I'm getting ready
to watch football, drink coke and eat Twinkies.
Thank you a lot for your help! I very much appreciate it! :) the help that was sent to me, which you can see in y reply above, isn't sufficient to me sadly.. I require the same encription method as I used. If it possible for you, I would greatly appreciate it if you find a way to decrypt the message properly!
Thank you very much for your help!