Python and crypto-strength random numbers by default
Python and crypto-strength random numbers by default
Posted Sep 17, 2015 8:20 UTC (Thu) by hthoma (subscriber, #4743)Parent article: Python and crypto-strength random numbers by default
Posted Sep 17, 2015 13:03 UTC (Thu)
by njh (subscriber, #4425)
[Link] (2 responses)
The article suggest that the existing MT algorithm is seeded from urandom by default, if no seed value is provided.
Why not return values from the MT algorithm if random.random() is called after an explicit seed has been set, but switch to a newer CSPRNG algorithm if random.random() is called without seeding? That would mean that existing Monte Carlo simulation code (and similar) would continue to give results that matched runs from before the change, but stronger random numbers would be produced by default in cases where reproducibility isn't a concern.
Posted Sep 17, 2015 19:10 UTC (Thu)
by droundy (subscriber, #4559)
[Link]
Posted Sep 17, 2015 21:21 UTC (Thu)
by njs (subscriber, #40338)
[Link]
AFAICT, the only reason not to (besides the usual one that it would take some work to implement and maintain) is that Guido considers it "a hack" :-(
Python and crypto-strength random numbers by default
Python and crypto-strength random numbers by default
Python and crypto-strength random numbers by default