Re:Understanding the Enigma machine from “The Imitation Game...
by charypar on Friday February 27, 2015 @05:04AM
(#9118076)
That property is caused by the reflector, rotors themselves can shuffle randomly. The way the reflector is built in the implementation is from pairs of consecutive (unique) letters of the shuffled alphabet (getting a half of the reflector) and then merging the inversion.
IMHO it's correct.
Re:Understanding the Enigma machine from “The Imitation Game...
by jgrahamc on Friday February 27, 2015 @06:19AM
(#9118274)
Hmm. Rereading the code I believe you are correct. I'm not strong in Ruby and had misunderstood what this was doing:
Reflector = Hash[*('A'..'Z').to_a.shuffle]
Reflector.merge!(Reflector.invert)
This is a minor flaw for the explanation but the result was that a letter could never be enciphered to itself on Enigma. And this fact was exploited because it meant that crib positions could be eliminated.