i'm creating a program that would send some info to server thru sockets. but, server should first let me in, so server admin suggested using blowfish encription with which i have one problem nad here it is:
when he uses blowfish with string "testtest" and key (salt) "1234567890ABCDEF" (16 chars), he gets this: d5fb49d55b9f3687
so, for proper working and communication thru sockets, i should be able to get the same result. so i do:
$string = "testtest";
$key = '1234567890ABCDEF';
echo crypt($string, $key);
what i get is: 12SddsiYCoHyw which is, as you can se false.
i checked php manual (http://www.php.net/manual/en/function.crypt.php) and saw this statement there:
CRYPT_BLOWFISH - Blowfish encryption with a sixteen character salt starting with $2$
so i tried to put $2$ before $key itself, but even that didn't work. i also checked if CRYPT_BLOWFISH constant is defined with defined('CRYPT_BLOWFISH') and it returned 1, which means, it is. but i still don't get the right result!!! i even tried bin2hex() function on both variables and still didn't get correct result. can someone PLEASE help me out with this because it's killing me!!!
and no, i cannot use any other decription!!!
thanks for all your help!
regards ,)