use Crypt::CBC; use Crypt::Random qw( makerandom ); $key = makerandom( Size => 32, Strength => 1); my $cipher = Crypt::CBC->new( -key => $key ); my $ciphertext = $cipher->encrypt_hex('test');