The story of decryting the cyphertext that could not be decrypted using the simulators used on this forums
As you might know, I have attempted to bruteforce this code, but lack of time stopped me from allocating a large amount of time for this.
I saw that apparently it had been decrypted, so I was curious (I even asked details in this thread) how do you get from WZA and XUN to BVO. Apparently, nobody answered and looking back it's probably because for them it was a stupid question. As it turns out, it was not quite like that.
Since I've been a programmer for 17 years I decided to take a different approach: using my previous program (and the python enigma simulator), bruteforce all 15.6k combinations - that is decrypt the cyphertext using every single possible key - 15.6k possibilities. Output this to a file. Grep the cleartext in the output file, find the unique line having the cleartext and find the key. Work my way backwards from there.
Let's proceed:
python3 test.py > decrypted_refl_b
To my surprise, using the python enigma simulator, the key BVO decrypted the cyphertext DCIPYDQGUYMXYUFLGMR to BLETCHLEYPARKCRYPTO
i.imgur.com/0kohiku.pngAlright, so somehow the key BVO decryps the text. But how do you get from WZA and XUN to BVO?
I tried the settings from Oct 27 on my local machine (laptop), with initial setting WZA and XUN and I got VKZ. Not BVO.
i.imgur.com/5fbVi8Q.pngI used the Android simulator on my phone and got the same result.
I remembered
Arduino Enigma had a simulator and mentioned his Enigma simulator had been tested with some universal enigma, so visited his blogspot and found the link. Encountered the same problem.
i.imgur.com/vHb1Mqa.pngi.imgur.com/c8wHpZz.pngUsed my own Arduino running some github code that I found and attempted the same thing, and got the same result. Every WZA and XUN gives back VKZ as message key, not BVO.
i.imgur.com/257dL3m.jpgFinally, I got back to my downloaded python code enigma simulator and bruteforced the key, using a similar approach. Attempt to decrypt XUN using all possible key combinations. Grep the output and find BVO. Find the initial settings from there.
python3 test.py > decrypted_refl_b_msg_key
And here comes the big surprise:
i.imgur.com/vjOA2qG.pngApparently, for this simulator, initial setting of WZA gives BVO when entering XUN.
But how is it that for every other simulator it gives VKZ and for this one it gives BVO??
I started looking at the source code and digging around the python code.
i.imgur.com/x6YMpVf.pngAfter much digging I found a comment that solved the entire puzzle:
"A value of 'A' for example puts the rotor in position 0, assuming an
internal ring setting of 0.
The parameter val must be a string in 'A' - 'Z'."
i.imgur.com/YLzp1z0.pngIt might be that for every single other simulator, A is 1. Z is 26. In this simulator, A is 0. SO, there's an offset of 1.
To test my theory, I set a normal simulator, used by us to the settings for Oct 27 and set initial settings to WZA. I then backed every wheel by 1. WZA became VYZ.
With VYZ, XUN decrypts to BVO.
i.imgur.com/LWI5lSz.pngTo fully test my theory, I set message key to BVO, then backed each wheel by 1. BVO became AUN. Using AUN as the message key and every other simulator except the python one, DCIPYDQGUYMXYUFLGMR decrypts to BLETCHLEYPARKCRYPTO.
I have attached pictures. (For the geeks, Ubuntu 18.04 LTS)
In conclusion, their lab and simulator is not the one we were using.
P.S. Apologies if it's not all clear. I'm tired and need a beer :-)
P.P.S It's part of Immersive labs apparently