News for hackers. Stuff that matters.
Re:Understanding the Enigma machine from “The Imitation Game... by jgrahamc on Thursday February 26, 2015 @06:19PM (#9116252)
There's a minor problem with the implementation. The rotors and reflector always turned a letter into a different letter because of the wiring. It's possible for the shuffling of the alphabet to leave a letter in place.

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.

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)