################################################################
# monoalph.pl : Monoalphabetic substitution over the alphabet  #
#                [A..Z]                                        #
#                Key is taken from command line.               #
#                Plaintext is converted to uppercase           #
#                before encryption.                            #
#    Input from STDIN : plaintext                              #
#    Output to STDOUT : ciphertext in 5 letter groups          #
#--------------------------------------------------------------#
# Klaus Pommerening 7. Oktober 1999                            #
#                                                              #
# This program is freeware. Use it as you like.                #
# Usual disclaimers apply.                                     #
################################################################

require "auxcrypt.pl";           # Use &to26, &makeperm,
                                 # &gettext, &puttext
$key = $ARGV[0];                 # Get key from command line
$permut = &makeperm($key);       # Make permutation from key.
$plaintext = &gettext;           # Get plaintext from standard
                                 #   input, transform.
$_ = $plaintext;                 # Prepare for using eval with tr
eval "tr /A-Z/$permut/";         # translate using key,
&puttext($_);                    # and print.

