#38646 [NEW]: crypt function problem
| From: | edcross at gmail dot com | Date: | Wed, 30 Aug 2006 01:13:55 +0000 |
| Subject: | #38646 [NEW]: crypt function problem | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-101508@lists.php.net to get a copy of this message | ||
From: edcross at gmail dot com
Operating system: linux
PHP version: 5.1.5
PHP Bug Type: *Encryption and hash functions
Bug description: crypt function problem
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 bug report at http://bugs.php.net/?id=38646&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38646&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38646&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38646&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38646&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38646&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38646&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38646&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38646&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38646&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38646&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38646&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38646&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38646&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38646&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38646&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38646&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38646&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38646&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38646&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38646&r=mysqlcfg