You are not logged in.

#1 2009-04-15 12:56:08

Gruntz
Member
From: Haskovo, Bulgaria
Registered: 2007-08-31
Posts: 291

PHP, ldap, crypted passwords.

Hello everyone.

When I am adding a password in OpenLDAP, it is with {CRYPT} infront. How can I decrypt this password with PHP.

For example, {CRYPT}Kms8wKoBq5AWA is the hash of one password for example. The actual password is 'secret'. I tryed every php algorithm that I know.

Regards.

Last edited by Gruntz (2009-04-15 13:23:21)

Offline

#2 2009-04-16 01:25:46

lefallen
Member
From: Melbourne, Australia
Registered: 2006-07-06
Posts: 36
Website

Re: PHP, ldap, crypted passwords.

Generally passwords stored in a encrypted format CANNOT be decrypted, this is by design.  The way you authenticate is take the password, encrypt it using the same method, and compare.  If they match you know the correct original password was supplied.


JABBER: krayon -A-T- chat.qdnx.org
E-MAIL: archlinuxforums -A-T- quadronyx.org
WEB: http://www.qdnx.org/krayon/
~o~

Offline

#3 2009-04-16 06:50:43

Gruntz
Member
From: Haskovo, Bulgaria
Registered: 2007-08-31
Posts: 291

Re: PHP, ldap, crypted passwords.

Yes, I am trying to encript the same password in order to get the same hach, but it is never the same sad I have tryed all the algorithm that I got from hash_algos() function, but it is never the same sad

Offline

#4 2009-04-16 09:40:06

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: PHP, ldap, crypted passwords.

The first two bytes/characters in your DES hash is called the 'salt'.  'Km' is the salt that was used to create that hash Kms8wKoBq5AWA.  You must use the same salt in your call to the PHP crypt function.

Offline

Board footer

Powered by FluxBB