crypt, md5, sha modules

Marco Herrn herrn at
Sat Jan 24 23:27:32 CET 2004

Hi, I don't know wether this is really the best place for asking this
question. If you know a better, please tell me.

The problem is an understanding of the 3 modules for hash algorithms. I
need a script to create hashed passwords (the user enters his password
and gets back the hash for it).
I need this for password verification in the mailserver exim, since it
supports hashed passwords. The user then sends his password in clear
(but always by using SSL), exim creates a hash and compares it to the
one in a specific file (there will be the hash created by my python

Well, it works with the crypt module. But exim also supports an md5
hashing. Now I would like to use that, since it supports much better
passwords. But the md5 module works in a very different way than crypt.
Does anyone know whether such hashes are compatible with exim?

What makes me think about it is, that there is no salt and that the
output is non-ascii unless I use hexdigest() which only returns hex
numbers (when I look into my /etc/shadow each hash contains alphanumeric

And if possible I would also like to use sha, cause it is even a bit
more safer than md5, but am not sure, whether this is supported by exim.

So my main question is: can I use the md5 module for creating hashes
compatible with exims md5-function? And if so, how?

Thanks in advance for your help

Marco Herrn             herrn at
(GnuPG/PGP-signed and crypted mail preferred)
Key ID: 0x94620736

More information about the Python-list mailing list