use Crypt::DES;
my $cipher = new DES $key;
This creates a new DES BlockCipher object, using $key, where
$key is a key of keysize() bytes.
my $cipher = new DES $key;
my $ciphertext = $cipher->encrypt($plaintext);
This function encrypts $plaintext and returns the
$ciphertext where $plaintext and
$ciphertext should be of blocksize() bytes.
my $cipher = new DES $key;
my $plaintext = $cipher->decrypt($ciphertext);
This function decrypts $ciphertext and returns the
$plaintext where $plaintext and
$ciphertext should be of blocksize() bytes.
my $key = pack("H16", "0123456789ABCDEF");
my $cipher = new DES $key;
my $ciphertext = $cipher->encrypt("plaintex"); # NB - 8 bytes
print unpack("H16", $ciphertext), "\n";
Bruce Schneier, Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc.