#38646 [Opn->Bgs]: crypt function problem
| From: | bjori@php.net | Date: | Wed, 30 Aug 2006 06:42:28 +0000 |
| Subject: | #38646 [Opn->Bgs]: crypt function problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101513@lists.php.net to get a copy of this message | ||
ID: 38646
Updated by: bjori@php.net
Reported By: edcross at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: *Encryption and hash functions
Operating System: linux
PHP Version: 5.1.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2006-08-30 01:13:55] edcross at gmail dot com
Description:
------------
I am using Zendcore + PHP 5.1.4 with no extra addonds.
When using the crypt function this way everything seems correct:
echo crypt( 'password', '$1$driak4UgiErluyoe@I&glevOudr0aK' );
(Using $1$ at the begining of the salt so it gives me back a MD5
result)
The same function but this way (notice the " instead of ' around the
salt):
echo crypt( 'password', "$1$driak4UgiErluyoe@I&glevOudr0aK" );
It gives me back a DES result. The only diference is how the salt is
enclosed, duh!?
Reproduce code:
---------------
echo crypt( 'password', "$1$driak4UgiErluyoe@I&glevOudr0aK" );
echo crypt( 'password', '$1$driak4UgiErluyoe@I&glevOudr0aK' );
Expected result:
----------------
result1: $1$driak4Ug$AFGh.vpAzgjk4h9wVqs2a1
result2: $1$driak4Ug$AFGh.vpAzgjk4h9wVqs2a1
Actual result:
--------------
result1: $1Oyx5r9mdGZ2
result2: $1$driak4Ug$AFGh.vpAzgjk4h9wVqs2a1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38646&edit=1