python sha module and ldap

Ng Pheng Siong ngps at madcap.dyndns.org
Fri Jul 20 11:18:41 EDT 2001


According to  <lawick at wanadoo.nl>:
> >>> import sha pwd='secret' so=sha.new(pwd) print so.hexdigest()
> e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
> 
> With openldap, a sha can be generated like this: joost at saba:~ >
> ldappasswd -h saba -t "" -vv -n -Hsha -e geheim
> :{sha}kGByAB793z4R5tK1eC9Hd/4Dhzk=
> 
> The two don't match because Python sha is hex and ldap not. How can I
> make them match?

Here's a guess: the LDAP output is the base64 encoding of the binary
digest.



-- 
Ng Pheng Siong <ngps at post1.com> * http://www.post1.com/home/ngps

Quidquid latine dictum sit, altum viditur.



More information about the Python-list mailing list