mcrypt and perl's Crypt

From: Date: Fri, 29 Sep 2000 15:19:24 +0000
Subject: mcrypt and perl's Crypt
Groups: php.general 
Request: Send a blank email to php-general+get-18058@lists.php.net to get a copy of this message
I'm having trouble getting output from Perl's Crypt::BF function to mesh with output from mcrypt. We're using Blowfish in CBC mode, Crypt::BF 1.00 and Mcrypt 2.2.x. Here's an example of the way in which it DOESN'T work: // Crypt::BF output using $key of $string $string = "do-cool-stuff::::::::::" $BFencrypted = "bc9f4ea9f451ff3b950468544cf1e59bea76f8b7c94aff71ba9b3f1fd5a24dd0bc35a9492bc00c542f41d52a9f29454e"; $decrypted = mcrypt_cbc( MCRYPT_BLOWFISH , $key , $BFencrypted , MCRYPT_DECRYPT ); echo "$decrypted<br>"; // "Yhv((‰ŽÃQY¦Ê`[IóžD8¦BÕ@ìÔbÌØ+h­ßù­‹h ë v§TíÚùÔu«úÔU(ãÊr^'"ˆ™gÈé" There is no IV used when creating the encrypted string, so I'm at a loss as to how that plays into the equation on the mcrypt side. The same problem exists when encrypting with mcrypt_cbc and decrypting with Crypt::BF (again, no IV). Any ideas would be very welcome, but keep in mind the Perl stuff is locked in stone and it's my chore to get the PHP side working. Thanks, Ray Black.

« previous php.general (#18058) next »