[Python-ideas] Should our default random number generator be secure?

Stephen J. Turnbull stephen at xemacs.org
Fri Sep 11 08:39:11 CEST 2015


Greg Ewing writes:
 > random832 at fastmail.us wrote:
 > > Being able to produce multiple independent streams of numbers is the
 > > important feature. Doing it by "jumping ahead" seems less so.
 > 
 > Doing it by jumping ahead isn't strictly necessary; the
 > important thing is to have some way of generating
 > *provably* non-overlapping and independent sequences.

By definition you don't have (stochastic) independence if you're using
a PRNG and deterministically jumping ahead.  Proving non-overlapping
is easy, but I don't even have a definition of "independence" of fixed
sequences: equidistribution of pairs?  That might make sense if you
have a sequence long enough to contain all pairs, but even then you
really just have a single sequence with larger support, and I don't
see how you can prove that it's a "good" sequence for using in a
simulation.

 > Jumping ahead is one obvious way to achieve that.
 > Simply setting the seed of each generator randomly
 > and hoping for the best is not really good enough.

It is not at all obvious to me that jumping ahead is better than
randomly seeding separate generators.  The latter actually gives
stochastic independence (at least if you randomize over all possible
seeds).



More information about the Python-ideas mailing list