Crypt-OpenSSL-AES

 view release on metacpan or  search on metacpan

t/01-crypt-cbc.t  view on Meta::CPAN

use strict;
use warnings;
BEGIN {
  unless ($ENV{AUTHOR_TESTING}) {
    print qq{1..0 # SKIP these tests are for testing by the author\n};
    exit
  }
}

use Test::More tests => 1;
use Crypt::CBC;

my $plaintext = "This is a test!!";
my $password = "qwerty123";
my $cipher = Crypt::CBC->new(
    -key    => $password,
    -cipher => "Crypt::OpenSSL::AES",
    -pbkdf  => 'pbkdf2',
);

my $encrypted = $cipher->encrypt($plaintext);
my $decrypted = $cipher->decrypt($encrypted);
like($decrypted, qr/This is a test!!/, "Correctly decrypted via Crypt::CBC");
done_testing;



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