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

Stefan Krah skrah at bytereef.org
Wed Sep 9 23:36:06 CEST 2015


Petr Viktorin <encukou at ...> writes:
> The OpenBSD implementation does not allow any kind of reproducible results.
> Reading http://www.pcg-random.org/other-rngs.html, I see that
> arc4random is not built for is statistical quality and k-dimensional
> equidistribution, which are also properties you might not need for
> crypto, but do want for simulations.
> So there are two quite different use cases (plus a lot of grey area
> where any solution is okay).

I can't find much at all when searching for "chacha20 equidistribution".
Contrast that with "mersenne twister equidistribution" and it seems that
chacha20 hasn't been studied very much in that respect (except for
the pcg-random site).


So I also think this should preclude us from replacing the current
random() functions.


Adding an arc4random module with the caveat that its quality will
be as good as the current OpenBSD libcrypto/libressl(?) would be okay.


Stefan Krah






More information about the Python-ideas mailing list