I'm writing an app that will use blowfish encryption..
PHP's mcrypt will be used if available.
if not, I'll use PHPmyadmin's blowfish.php library.
The problem is I can't figure out what initialization vector
blowfish.php is useing (or if that's even my problem).
ie, if I encrypt with blowfish.php and decrypt with mcrypt:
/* include path to phpmyadmin '/libraries/blowfish.php'; */
$secret = 'secret';
$string = 'test string';
$iv = blah;
$encrypted = PMA_blowfish_encrypt($string,$secret);
$decrypted =
trim(mcrypt_decrypt(MCRYPT_BLOWFISH,$secret,base64 _decode($encrypted),MCRYPT_MODE_CBC,$iv));
echo $decrypted;
will output something like
test strÙÚE¦ô<qÕ
Anyhow, how do I make these two interchangeable?