python sha module and ldap

lawick at wanadoo.nl lawick at wanadoo.nl
Thu Jul 19 10:47:03 EDT 2001


Hi,

I have a problem using the sha module in python and sha encryption with ldap.
The python sha module can generate a digest of a (password) string like this:
>>> 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?

Is there also a ssha module for Python?

Cheers,

Joost
-- 

--
Joost van Lawick
E: joost at lawick.com
W: http://www.lawick.com/



More information about the Python-list mailing list