Help for this page

Select Code to Download


  1. or download this
    
    use Crypt::Mode::CBC;
    ...
    my $cbc = Crypt::Mode::CBC->new('AES');
    my $ciphertext = $cbc->encrypt("secret data", $key, $iv);
    print $ciphertext;
    
  2. or download this
    use Crypt::CBC;
    use Crypt::Cipher::AES;
    
    ...
    my $cbc = Crypt::CBC->new( -cipher=>'Cipher::AES', -key=>$key, -iv=>$i
    +v );
    my $ciphertext = $cbc->encrypt("secret data");
    print $ciphertext;