note 14199 added to function.ldap-bind.php
| From: | ral at royal dot net | Date: | Sun, 22 Jul 2001 02:49:42 +0000 |
| Subject: | note 14199 added to function.ldap-bind.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15647@lists.php.net to get a copy of this message | ||
I'm using the following code to generate
'userPassword' for OpenLDAP 1.2.x using {ssha} method
(to encrypt {smd5} just change MHASH_SHA1 to MHASH_MD5)
mt_srand((double) microtime()*1000000);
$salt=mhash_keygen_s2k(MHASH_SHA1,$password,substr(pack("h*",md5(mt_rand())),0,8),4);
$passsword="{ssha}".base64_encode(mhash(MHASH_SHA1, $password.$salt).$salt);
http://www.php.net/manual/en/function.ldap-bind.php