Crypt-OOEnigma
view release on metacpan or search on metacpan
lib/Crypt/OOEnigma.pm view on Meta::CPAN
substitution cipher with no short circuits. On receiving a clear-text message
for transmission, the operator first replaces all spaces with the letter X,
before typing the message into the machine. As each key is pressed, a current
passes through each rotor, the reflector and back through the rotors in reverse
order to produce the cipher-text message. As the message is processed, the
first rotor rotates once for every letter that is encoded, the second rotor
once every 26 letters, the third rotor every 26 squared letters and so on.
The Enigma is configured by selecting several rotors from a larger set, placing
them in a particular order and a particular start position. Received messages
are decoded by setting the Enigma to the same state as the encoding Enigma and
processing the message again. The result is clear text with the letter X
instead of spaces.
For a good description of the Enigma, including some interesting exercises, see
Part IV of "The Pleasures of Counting" by T W Korner, Cambridge University
Press.
=head2 The Commercial Enigma
The commercial Enigma typically consists of 3 rotors and a reflector. A
( run in 0.451 second using v1.01-cache-2.11-cpan-26ccb49234f )