################################################################
# monodecr.pl : Monoalphabetic decryption over the alphabet    #
#                [A..Z]                                        #
#                Key is taken from command line.               #
#                Ciphertext is assumed in uppercase.           #
#    Input from STDIN : plaintext                              #
#    Output to STDOUT : ciphertext                             #
#--------------------------------------------------------------#
# Klaus Pommerening 7. Oktober 1999                            #
#                                                              #
# This program is freeware. Use it as you like.                #
# Usual disclaimers apply.                                     #
################################################################

require "auxcrypt.pl";              # Use &to26, &makeperm

$key = $ARGV[0];                    # Get key from command line
$permut = &makeperm($key);          # Make permutation from key.
while (<STDIN>) {                   # Read input line,
  eval "tr /$permut/A-Z/";          # translate using key,
  print;                            # and print.
  }
