use Crypt::DES; my $plaintext= shift; my $key = pack("H16", "1234567890ABCDEF"); my $cipher = new Crypt::DES $key; my $ciphertext = $cipher->encrypt($plaintext); # NB - 8 bytes print unpack("H16", $ciphertext), "\n"; sub decryptpw { my $key = pack("H16", "1234567890ABCDEF"); my $ciphertext=shift; my $cipher = new Crypt::DES $key; my $plaintext = $cipher->decrypt(pack("H16",$ciphertext)); return $plaintext; }