18 messages in org.python.python-bugs-list[ python-Bugs-917055 ] add a stronger...
FromSent OnAttachments
SourceForge.netMar 15, 2004 9:46 pm 
SourceForge.netMar 16, 2004 5:44 am 
SourceForge.netMar 16, 2004 6:49 am 
SourceForge.netMar 16, 2004 6:52 am 
SourceForge.netMar 17, 2004 4:05 am 
SourceForge.netMar 17, 2004 6:27 am 
SourceForge.netMar 18, 2004 1:27 am 
SourceForge.netMar 18, 2004 3:51 am 
SourceForge.netMar 21, 2004 12:33 pm 
SourceForge.netMar 21, 2004 2:34 pm 
SourceForge.netMar 21, 2004 2:50 pm 
SourceForge.netMar 21, 2004 7:49 pm 
SourceForge.netMar 21, 2004 7:56 pm 
SourceForge.netMar 24, 2004 6:34 am 
SourceForge.netMar 25, 2004 12:15 am 
SourceForge.netMar 25, 2004 3:25 am 
SourceForge.netMar 25, 2004 4:08 am 
SourceForge.netMar 25, 2004 7:37 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-917055 ] add a stronger PRNGActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 15, 2004 9:46:40 pm
List:org.python.python-bugs-list

Bugs item #917055, was opened at 2004-03-16 02:46 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=917055&group_id=5470

Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: add a stronger PRNG

Initial Comment: The default Mersenne Twister algorithm in the Random module is very fast but makes no serious attempt to generate output that stands up to adversarial analysis. Besides cryptography applications, this can be a serious problem in areas like computer games. Sites like www.partypoker.com routinely run online tournaments with prize funds of 100K USD or more. There's big financial incentives to find ways of guessing your opponent's cards with better than random chance probability. See bug #901285 for some discussion of possible correlations in Mersenne Twister's output.

Teukolsky et al discuss PRNG issues at some length in their book "Numerical Recipes". The original edition of Numerical Recipes had a full blown version of the FIPS Data Encryption Standard implemented horrendously in Fortran, as a way of making a PRNG with no easily discoverable output correlations. Later editions replaced the DES routine with a more efficient one based on similar principles.

Python already has an SHA module that makes a dandy PRNG. I coded a sample implementation:

http://www.nightsong.com/phr/python/sharandom.py

I'd like to ask that the Python lib include something like this as an alternative to MT. It would be similar to the existing whrandom module in that it's an alternative subclass to the regular Random class. The existing Random module wouldn't have to be changed.

I don't propose directly including the module above, since I think the Random API should also be extended to allow directly requesting pseudo-random integers from the generator subclass, rather than making them from floating-point output. That would allow making the above subclass work more cleanly. I'll make a separate post about this, but first will have to examine the Random module source code.

----------------------------------------------------------------------