Can ldapcompare be used to compare passwords?

The ldapcompare command-line tool allows you to compare an attribute:value pair for a given DN and returns True or False

The following command works:

$ ldapcompare -v -D "cn=directory manager" -w DMPW 'title:associate' "uid=qbrd,ou=associate,o=sf,c=us"

ldapcompare: started Fri Oct 6 16:07:09 2006

ldap_init( localhost, 389 )

comparing type: "title" value: "associate" in entry "uid=qbrd,ou=associate,o=sf,c=us"

compare TRUE

This one doesn't work:

$ ldapcompare -v -D "cn=directory manager" -w DMPW 'userPassword:myPassword' "uid=qbrd,ou=associate,o=sf,c=us>

ldapcompare: started Fri Oct 6 16:07:22 2006

ldap_init( localhost, 389 )

comparing type: "userPassword" value: "myPassword" in entry "uid=qbrd,ou=associate,o=sf,c=us"

compare FALSE

The userPassword is stored in the directory as SHA. Can we only compare using the SHA encrypted password? Is there a way to test with a clear-text password?

Thanks in advance!!

[1015 byte] By [bombaybabe] at [2007-11-26 10:38:06]
# 1

SHA is not encryption, it is a one way hash, which means that there is no way (technically feasible atleast) to recover the original text that was converted to the hash.

If you really want to try and make a match (ie, make a brute force password cracker ;) ), perhaps you could make a script to hash the password (of list of passwords) that you want to compare, and compare the hashes.

ankushkapoor at 2007-7-7 2:49:19 > top of Java-index,Web & Directory Servers,Directory Servers...