note 22098 added to function.crypt

From: Date: Thu, 06 Jun 2002 13:50:19 +0000
Subject: note 22098 added to function.crypt
Groups: php.notes 
Request: Send a blank email to php-notes+get-31532@lists.php.net to get a copy of this message
Calling crypt() with only 1 argument appear to generate MD5 hash instead of DES with autogenerated salt nowadays, here's my solution: $mySalt = substr( ereg_replace("[^a-zA-Z0-9./]","", crypt(rand(10000000,99999999), rand(10,99))), 2, 2); echo "hash = ".crypt("mysecret",$mySalt); -- http://www.php.net/manual/en/function.crypt.php http://master.php.net/manage/user-notes.php?action=edit+22098 http://master.php.net/manage/user-notes.php?action=delete+22098 http://master.php.net/manage/user-notes.php?action=reject+22098

« previous php.notes (#31532) next »