[mod_python] odd behaviour of the md5-module in modpy

Deron Meranda deron.meranda at gmail.com
Mon Jun 26 10:47:50 EDT 2006

On 6/26/06, Nikolaus Schlemm <nikl at nikl.net> wrote:
> for some reason the md5-module produces incorrect hashes for me. what seems
> particularly odd:
>  * there are always leading zeros:
>    * 8 leading zeros on a debian sid (32-bit)
>    * 16 leading zeros on an ubuntu edgy (64-bit)
>  * when calculating hashes distinct values, the hashes are all the same ...

What version of python do you have, and what version of
mod_python?  Can you provide an simple example of how
you're importing the module and calling it?

Are you calling the hexdigest() method, or just digest() to get
the value?

Are you sure you're not picking up some other module that
may be named "md5", or that you're not overloading the
variable.  Try displaying the value of md5.__file__

Also there should have been a file called "test_md5.py" which came
with your python (perhaps as /usr/lib/python2.4/test/test_md5.py).
Run it from a shell prompt and make sure all the tests pass.

Also to there are several official test vectors listed at the end
of RFC 1321, which you should use to make sure you're getting
the correct hash values: http://www.ietf.org/rfc/rfc1321.txt
Deron Meranda

More information about the Mod_python mailing list