Sounds like we should change those over to the hashlib module if it's available, appears it's interface is compatible.

A non deterministic PRNG would be better for that function -- I can't think of any nice reason to reproduce the sequence that
comes out of it. :)

- Luke


Forwarding along these comments from the melkjug blog:


Hey Luke,
Thanks, nonce_str is much nicer (not to mention already written :). I’ll use that instead. Just noticed python2.5 deprecates the md5 module with a new module hashlib, http://www.python.org/doc/current/lib/module-hashlib.html . The 2.4/2.5 straddle grows ever wider…

Comment by magicbronson on July 18, 2008 at 10:33 am

from http://docs.python.org/lib/module-random.html :

“Almost all module functions depend on the basic function random(), which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes.”

For a non-deterministic prng, the pycrypto module provides Crypto.Util.randpool: http://www.amk.ca/python/writing/pycrypt/pycrypt.html#SECTION000720000000000000000

Comment by magicbronson on July 19, 2008 at 3:39 pm

--
Archive: 
http://www.openplans.org/projects/melkjug/lists/melkjug-development-list/archive/2008/07/1216651675072
To unsubscribe send an email with subject "unsubscribe" to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to