Re: SSHA Password Encryption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 1, 2012 at 1:01 PM, Coşkun Bağrıaçık
<coskun.bagriacik@xxxxxxxxx> wrote:
> Hi guys,
>
> I wanna change password into ldap directory, but password's encryption is
> SSHA.
> How do I encrypt the string to SSHA from php ?


http://php.net/manual/en/function.sha1.php

look @ user contribuited notes for "SSHA LDAP password generation
algorithm for standard PHP > 5.0 "



$salt = sha1(rand());
$salt = substr($salt, 0, 4);
$hash = base64_encode( sha1($password . $salt, true) . $salt );
return $hash;




-- 
+  http://vipertechnology.dyndns.org
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
+  http://vipertechnology.dyndns.org/cotnact/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux