MD5 Passwords and the Python MD5 module

Lorenzo M. Catucci lorenzo at sancho.ccd.uniroma2.it
Fri Mar 31 03:36:09 EST 2000


In article <8c0mmm$4u$1 at nnrp1.deja.com>, cephas_tpg at my-deja.com wrote:
>Thanks for the replys,
>however the crypt module, both in python and in c only produces a DES
>hash of the the password, not the md5 hash.
>Is there a python interface to PAM?
>
Now, You should look better, and you'll see crypt does what you expect,
iff you give the right salt:

>>> import crypt
>>> crypt.crypt('Peter','$1$sale')
'$1$sale$bzAAvA4EadeapmmwcYCGj/'

As you can see, this is the shadow form of the md5 hashed and salted
password (sale is italian for salt...)

I think this is what you need.

Yours,

lmc





More information about the Python-list mailing list