Filewatcher File Search File Search
Content Search
» » » » » » perl-Crypt-OOEnigma-0.3-1.el5.rf.noarch.rpm » Content »
pkg://perl-Crypt-OOEnigma-0.3-1.el5.rf.noarch.rpm:30154/usr/share/man/man3/  info  HEADER  downloads

perl-Crypt-OOEnigma - Flexible, object-oriented interface to a WWII Enigma machine…  more info»


Crypt::OOEnigma(3User Contributed Perl DocumentatiCrypt::OOEnigma(3)

       Crypt::OOEnigma - A World War II Enigma machine in a flexible
       OO framework

         use Crypt::OOEnigma;

         my $enigma = Crypt::OOEnigma->new();

         # OR set the default rotors' start positions
         Crypt::OOEnigma->new( start_positions => [10,20,5] );

         # OR choose rotors from the set (0..5)
         Crypt::OOEnigma->new( rotor_choice    => [3,4,5]);

         # OR both
         Crypt::OOEnigma->new( rotor_choice    => [3,4,5],
                               start_positions => [10,20,5] );

         my $cipher = $enigma->encipher("Some Text");
         my $decode = $enigma->decipher($cipher);
         # OR, since Enigma's are self-inverse:
         my $decode = $enigma->encipher($cipher);

       What is an Enigma?

       The Enigma Machine was a much-used encryption device in the
       Second World War.  It was an electrical device, somewhat like
       a typewriter, combining substitution and rotation ciphers in
       such a manner that the resulting overall cipher was difficult
       to break, unlike the constituent ciphers. The machine could
       decode as well as encoding messages.

       In short, the electrical Enigma is constructed from a number
       of rotors - usually 3, each of which implements a simple sub‐
       stitution cipher on the letters of the alphabet only, and a
       reflector.  The reflector is a self-inverse simple substitu‐
       tion 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 let‐
       ters, 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 particu‐
       lar start position.  Received messages are decoded by setting
       the Enigma to the same state as the encoding Enigma and pro‐
       cessing the message again.  The result is clear text with the
       letter X instead of spaces.

       For a good description of the Enigma, including some inter‐
       esting exercises, see Part IV of "The Pleasures of Counting"
       by T W Korner, Cambridge University Press.

       The Commercial Enigma

       The commercial Enigma typically consists of 3 rotors and a
       reflector.  A Commercial Enigma is provided in the package.

       The Military Enigma

       It turns out that the Commercial Enigma is relatively easily
       cracked by brute force methods  (see Korner) and that it can
       be easily strengthened by the addition of a simple device
       known as the plugboard.  The plugboard is a set of electrical
       plugs implementing the identity substitution (A -> A, B -> B
       etc) with a number of pairs of letters - say, 6 - swapped.
       The plugboard sits between the operator's keyboard and the
       commercial enigma and it has an impact far in excess of its

       A Military Enigma Machine is included in the package.

       The OOEnigma Module

       For simplicity, this OOEnigma module supplies a number of
       rotors and a military enigma machine so that the user can do
       one of:

       * Use a default Enigma
       * Choose 3 rotors
       * Choose start positions
       * Choose both 3 rotors and their start positions

       And the Enigma takes care of the rest.  Users who wish to use
       their own substitution codes or create their own Enigmas
       should see the documentation for the individual modules.

       Creating your own Enigmas.

       Enigmas based on an arbitrary number of rotors and using
       rotors, reflectors and plugboards with any reasonable cipher
       may be easily constructed.  The user creates the required
       Rotor, Reflector and Plugboard objects then uses them to
       instantiate either a Military or Commercial Enigma.


       Enigma is weak!

       Cryptographers talk of the strength of a cryptographic algo‐
       rithm in term of whether it is computationally feasible to
       break it.  It is, of course, computationally feasible to
       break an Enigma cipher so don't use it for anything serious!

       This package was created in spring 2002 as an exercise in OO
       Perl and preparing modules properly for CPAN.  More impor‐
       tantly, the Enigma is interesting.

       CPAN already has a Crypt::Enigma which is not object-oriented
       and implements only one Enigma (whereas you can create any
       Enigma-like machine with these objects).  Hence the package
       name Crypt::OOEnigma

       The Pleasures of Counting, T W Korner, CUP 1996.  A great
       book for anyone with the slightest interest in mathematics:
         ISBN 0 521 56087 X hardback
         ISBN 0 521 56823 4 paperback

       The Enigmas:

       The components:

       S J Baker, Ambriel Consulting,

       This package is licenced under the same terms as Perl itself.

perl v5.8.8                  2002-10-04           Crypt::OOEnigma(3)
Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2017