$cipher->encrypt($data)
Encrypt data. The size of $data must be a multiple of blocksize
(16 bytes), otherwise this function will croak. Apart from that,
it can be of (almost) any length.
You can also use either of these to get data that is in a multiple of 16 bytes:
# this requires $username < 16 bytes and prefix packs with spaces
sprintf '%16s', $username;
# this will give you a data length divisible by 16 for any length
# we use null byte prefix packing
sub get16 {
my $data = shift;
return "\0" x ( 16 - length($data)%16 ) . $data;
}
I really hope you are not using the POD example string 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as your key. The Rijndael cipher is a symmetric key block cipher, which is a type of cipher that encrypts data in blocks, rather than a single bit at a time, and uses the same key for both encryption and decryption. If you know the key you can decrypt an encrypted block so this is also termed a secret key cipher. 'a' x 32 is not that secret :-)
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|