Adam Lang wrote:
>I'm not sure why it would work on the previous configuration, because it
>shouldn't.
>
>When you use crypt() with no second argument, it generates a random seed to
>create the hash.
>
>So, since both crypt calls with different seeds, they naturally should be
>different results.
>
>Try this:
>
>$var = "sample";
>
>$testFirst=crypt($var,"ab");
>$testLast=crypt($var, "ab");
>
>echo $testFirst;
>echo "<BR>";
>echo $testLast;
>
>Now you will get the results you want.
>
>Adam Lang
>Systems Engineer
>Rutgers Casualty Insurance Company
>http://www.rutgersinsurance.com
>----- Original Message -----
>From: "S.ArunSrinivasan" <arun@o...>
>To: "professional php" <pro_php@p...>
>Sent: Thursday, October 10, 2002 7:59 AM
>Subject: [pro_php] Crypt
>
>
>
>
>>Hai,
>>
>><?
>>$var="sample";
>>$testFirst=crypt($var);
>>$testLast=crypt($var);
>>if($testFirst == $testLast)
>>{
>> echo "ok";
>>}
>>?>
>>
>>The above code echoes "ok" with combination of Linux 6.2, PHP
>>4.0.2 and Apache 1.3.12
>>
>>But in the combination of Linux 7.2, PHP 4.0.6 and Apache 1.3.20 it
>>doesn't echoes ok.
>>
>>Could anyone specify why it's not working.
>>
>>Regards,
>>S.Arun Srinivasan.
>>
>>
>>
>>
>
>
>
>
I bielieve the php docs recommend using the word your trying to hash as
the salt as well.