# Enigma - Bombe - Understanding the relative values of ring settings to key settings

For a project, I am writing Enigma and Bombe simulators in Python. I have coded up both and so far so good. My Enigma simulator gives the same results as the online simulator here: https://people.physik.hu-berlin.de/~palloks/js/enigma/enigma-u_v20_en.html

But now I am using my Bombe simulator to find key settings with an assumed ring setting of AAA (1, 1, 1). When the Bombe stops I have a key setting and ring setting which gives a relative offset. For example a message encoded with key = FHY (6, 8, 25) and ring settings JQC (10, 17, 3) gives key/ring offsets of 4, 9, 4. For this same message my Bombe stops at key = WRW (23, 18, 23) and ring = AAA (1, 1, 1). This combination also gives key/ring offsets of 4, 9, 4. This is as I would expect, so far so good.

But... With a 20 character message encoded at key = AKW (1, 11, 23), rings = ZAB (26, 1, 2) the key/ring offsets are 25, 16, 5. However, my Bombe stops at key = BJW (2, 20, 22), rings = AAA (1, 1, 1) giving key/ring offsets as 25, 17, 5. My first thought is, of course, that my Bombe code was incorrect, but if I use the online simulator I get the same encyphered output for either of those settings. So my Bombe stop is correct. What is going on? Why are these settings cryptographically equivalent yet the offsets are not?

AKW (1, 11, 23), rings = ZAB (26, 1, 2) => offset = 25, 16, 5

BJW (2, 20, 22), rings = AAA (1, 1, 1) => offset = 25, 17, 5

I am using rotors I, II, III from left to right (with reflector B and six stecker pairs) if that has any bearing.

Any help is appreciated. Thanks!

• I would suggest that cryptii.com/pipes/enigma-machine is a much better Enigma simulator. Perhaps another recent question with answers is relevant to your attempt, crypto.stackexchange.com/questions/108434/… . And specifically on Bombe, crypto.stackexchange.com/questions/25117/… . As for Bombe simulator, this is THE one lysator.liu.se/~koma/turingbombe . Jan 23 at 22:57
• Without knowing your ciphertext and crib, it is impossible to follow your computation. Better still, if you are referring to the Turing-Welchman Bombe, give us your menu. There are mistakes in calculating wiring core offsets. Indicators - rings = wiring cores. AKW - ZAB = 1, 10, 21 and BJW - AAA = 1, 9, 22. You got them the other way round, and W ≡ 23 not 22. BTW, what is/are your Bombe stop condition(s)? I suggest you to use Magnus Ekhall & Fredrik Hallenberg's Bombe simulator lysator.liu.se/~koma/turingbombe to verify your results. Jan 24 at 15:47