Which sha to use?

S. Alan Ezust ezust at users.sourceforge.net
Sat May 22 18:55:00 CEST 2004

Hi, I'm new here.

Which SHA to use? slappasswd claims to use SHA digests, but it's not the same 
as what the python sha built-in uses. Does the LDAP python library have its 
own sha interface that's compatible with slappasswd?
>>> import sha
>>> x = sha.new("foobar")
>>> x.digest()
>>> x.hexdigest()

$ slappasswd
New password: foobar

Why are these different anyway? Should I be using the sha built-in 

question #2: Is there a simple example of how to add the first 
user/sha-password/e-mail into a brand-new LDAP repository and then query it 
to get the user back?

S. Alan Ezust
Ottawa, Ontario, Canada

More information about the python-ldap mailing list