use Crypt::Mode::CBC; my $key = '(32bit key value)'; my $iv = '(32bit iv value)'; my $cbc = Crypt::Mode::CBC->new('AES'); my $ciphertext = $cbc->encrypt("secret data", $key, $iv); print $ciphertext; #### use Crypt::CBC; use Crypt::Cipher::AES; my $key = '(32bit key value)'; my $iv = '(32bit iv value)'; my $cbc = Crypt::CBC->new( -cipher=>'Cipher::AES', -key=>$key, -iv=>$iv ); my $ciphertext = $cbc->encrypt("secret data"); print $ciphertext;