use Crypt::Twofish2; use MIME::Base64; $cipher = new Crypt::Twofish2 "a" x 32, Crypt::Twofish2::MODE_CBC; my $text = "random text!"; print length($text),": $text\n"; # make text a multiple of 128 bit $text .= " " x (16 - length($text) % 16); $crypted = encode_base64($cipher->encrypt($text)); print length($crypted),": $crypted\n"; __END__ 12: random text! 25: ZA5yODJpIrGnOXpzt3hDVQ==