Crypt-CAST5

 view release on metacpan or  search on metacpan

t/2cbc.t  view on Meta::CPAN

# See if we can interoperate with Crypt::CBC
use Test::More;

# prior to 1.22, Crypt::CBC didn't use the Crypt:: prefix to locate ciphers
eval "use Crypt::CBC 1.22";
plan skip_all => "Crypt::CBC required for this test" if $@;
plan tests => 2;

my $cbc = Crypt::CBC->new("0123456789abcdef", "CAST5");

my $msg = "'Twas brillig, and the slithy toves";
my $c = $cbc->encrypt($msg);
is(length($c), 56, "ciphertext length check");
my $d = $cbc->decrypt($c);
is(unpack("H*",$d), unpack("H*",$msg), "encrypt-decrypt");

# end 2cbc.t



( run in 0.525 second using v1.01-cache-2.11-cpan-e1769b4cff6 )