Re: PHP 4.1 crypt()

From: Date: Tue, 08 Jan 2002 19:48:57 +0000
Subject: Re: PHP 4.1 crypt()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-79812@lists.php.net to get a copy of this message
It's too late for that. And I don't believe that the system's crypt() function just magically changed at exactly the same time we upgraded to PHP 4.1 Mike Patrik Wallstrom wrote:
On Tue, 8 Jan 2002, Mike Eheler wrote:
Is there any way to force PHP 4.1's crypt to generate crypt's with 2-letter salts? We've written some apps that do things the hack way -- if (crypt($pass,substr($pass,0,2)) == $cryptpass) -- and changing all of them to work the extended way is a real pain the arse. That includes changing all our password generation code to create 2-letter salts. Any help much appreciated. In short -- I want crypt() to work like it did in 4.0.6.
This is exactly the reason you should use a specific standard hash algorithm like MD5 or SHA-1 when encrypting passwords. The PHP crypt() call uses the system call crypt(), which might vary between different systems. Look at the PHP man pages for crypt() and the mcrypt package for more info on the subject. With mcrypt you can use whatever crypto function you need for compatibility. http://www.php.net/manual/en/function.crypt.php http://www.php.net/manual/en/ref.mcrypt.php -- patrik_wallstrom->foodfight->pawal@blipp.com->+46-709580442


« previous php.general (#79812) next »