Crypt::OOEnigma::Military - A military Enigma machine circa 1940. It


Crypt-OOEnigma documentation  | view source Contained in the Crypt-OOEnigma distribution.

Index


SYNOPSIS

Top

  use Crypt::OOEnigma::Military;
  # An Enigma with 3 default Rotors (with identity substitutions)
  my $enigma = new Crypt::OOEnigma::Military;

  # OR
  use Crypt::OOEnigma::Military;
  use Crypt::OOEnigma::Rotor;
  my @rotors = ()
  # Populate the list of Crypt::OOEnigma::Rotor
  Crypt::OOEnigma::Military->new( rotors => [@rotors] );

  # OR EVEN

  use Crypt::OOEnigma::Military;
  use Crypt::OOEnigma::Rotor;
  use Crypt::OOEnigma::Reflector;
  use Crypt::OOEnigma::Plugboard;
  my @rotors = ()
  # Populate the list of Crypt::OOEnigma::Rotor, see relevant pod
  my $reflector = new Crypt:OOEnigma::Reflector(params); # see relevant pod
  my $plugboard = new Crypt:OOEnigma::Plugboard(params); # see relevant pod
  Crypt::OOEnigma::Military->new( rotors => [@rotors],
                                  plugboard => $plugboard,
                                  reflector => $reflector);

  my $cipher = $enigma->encipher($mesg);
  my $decode = $enigma->encipher($cipher); # self-inverse

  # for internal use

  $enigma->init(); # returns the rotors to their initial state

DESCRIPTION

Top

This module provides a Military Enigma machine which differs in that a Plugboard is added before the Rotors.

You should usually create a Military Enigma with your own Plugboard, Rotors and Reflector.

NOTES

Top

None

BUGS and CAVEATS

Top

Enigma is weak!

Cryptographers talk of the strength of a cryptographic algorithm 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!

HISTORY

Top

This package was created in spring 2002 as an exercise in OO Perl and preparing modules properly for CPAN. More importantly, 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

SEE ALSO

Top

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

Crypt::OOEnigma::Military

The components: Crypt::OOEnigma::Rotor Crypt::OOEnigma::Reflector Crypt::OOEnigma::Plugboard

AUTHOR

Top

S J Baker, Ambriel Consulting, http://ambrielconsulting.com

COPYRIGHT

Top


Crypt-OOEnigma documentation  | view source Contained in the Crypt-OOEnigma distribution.