Skip to content

Instantly share code, notes, and snippets.

@mythosil
Created August 24, 2011 01:35
Show Gist options
  • Save mythosil/1167107 to your computer and use it in GitHub Desktop.
Save mythosil/1167107 to your computer and use it in GitHub Desktop.
sample of Crypt::CBC with Rijndael
use strict;
use warnings;
use 5.010;
use Crypt::CBC;
my $cbc = Crypt::CBC->new({
key => 'xxxxxxxxxxxxxxxx',
keysize => 16,
literal_key => 1,
cipher => 'Crypt::Rijndael',
iv => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
header => 'none',
});
my $string = "Hello World";
my $encrypted = $cbc->encrypt_hex($string);
my $decrypted = $cbc->decrypt_hex($encrypted);
say $string;
say $encrypted;
say $decrypted;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment