in reply to Crypt::Rijndael

At a totally wild guess, I'd think that the message means exactly what it says, and Rijndael expects blocks of data that are multiples of 16 bytes in size.

Try this:

my $cipher = new Crypt::Rijndael "a" x 32, Crypt::Rijndael::MODE_CBC; my $usernameCrypt = $cipher->encrypt($username^("\0"x16));
That should work, as long as length($username)<16.

The trick here is that the XOR will extend "length($username)" without changing the values.

Note that that's a) totally untested and b) may or may not be a secure way of using Rijndael, I have no idea.

Of course, if "a"x32 is your key, the security of my trick is the least of your worries :)
--
Mike

Edit:"\0" rather than '\0', that's what I get for working in C yesterday...