Jul 31, 2000, 11:08 AM
Post #1 of 4
Crypt::CBC and portability to C programs
i hope someone can help me with this one..
i need to encrypt some cookies, that are to be handed to whatever browser a visitor is using.
just a simple string to be encrypted.
i decided on Blowfish, as it's a strong algorithm and there are both C and Perl implementations (Crypt::Blowfish and libmcrypt)
Now, as we all know, in order to encrypt strings of arbitrary length, one must use CBC or something similar..
so, i use Crypt:CBC, with the blowfish algorithm. cool.
the problem seems to be that CBC takes the key value that you give it, and hashes it with MD5 in some nonstandard (?) way, and uses that for the actual key.
this is bad, because now i can't use a C program to decrypt that cookie...
anyone know of a possible solution?
here's the doc on Crypt::CBC http://theoryx5.uwinnipeg.ca/CPAN/data/Crypt-CBC/CBC.html