in reply to Crypt::Rijndael
Try this:
That should work, as long as length($username)<16.my $cipher = new Crypt::Rijndael "a" x 32, Crypt::Rijndael::MODE_CBC; my $usernameCrypt = $cipher->encrypt($username^("\0"x16));
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...
|
|---|