[issue12754] Add alternative random number generators

2016-09-06 Thread STINNER Victor
STINNER Victor added the comment: I agree with what Nick wrote. It became easy to install a third-party module, and we made progress on APIs to get random bytes from the system. I'm not convinced neither that Mersenne Twister limitations are important enough to replace it. If you want to see

[issue12754] Add alternative random number generators

2016-09-06 Thread Nick Coghlan
Nick Coghlan added the comment: Since this issue was opened, a few relevant changes have been made: * firstly the random.SystemRandom API and subsequently the "secrets" module were added to provide ready access to the operating system's cryptographically secure PRNG. This addresses the "At

[issue12754] Add alternative random number generators

2011-08-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Before trying to find the best (CS)PRNG, can't we start with ssl.RAND_bytes() and ssl.RAND_pseudo_bytes()? I would be nice to use ssl.RAND_pseudo_bytes() to generate crypt.mksalt(): see issue #12858 --

[issue12754] Add alternative random number generators

2011-08-29 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___ ___

[issue12754] Add alternative random number generators

2011-08-29 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: I am no kind of crypto expert, but from what I read, there are no known attacks on chacha8 or salsa20/12 better than brute-forcing the key, and distinguishing the stream from random or deducing state would be considered an attack.

[issue12754] Add alternative random number generators

2011-08-28 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: Earlier this year I wrote Python wrappers for a number of generators: https://github.com/douglasbagnall/riffle They are mostly cryptographic stream ciphers from the ESTREAM[1] project, but I was also interested in dSFMT[2], which is a

[issue12754] Add alternative random number generators

2011-08-28 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: A bit more on the state size and period of the stream ciphers. Chacha and Salsa use 64 bytes (512 bits) of state (vs ~2.5kB for MT19937). Its counter is 64 bits, and its seed can be 320 bits (in cipher-speak, the seed is split between

[issue12754] Add alternative random number generators

2011-08-28 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thanks Douglas. Can you say what the cryptographic guarantees are for Chacha and Salsa (seeing a stream of randoms doesn't allow you to do deduce internal state, previous randoms, or future randoms)? Is it suitably strong for

[issue12754] Add alternative random number generators

2011-08-17 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: The problem is that the Python API can only produce one number per call and a function call in Python is really slow (it creates a Python frame). If you want to speed it Python, it would be better to add methods to generate arrays to limit the

[issue12754] Add alternative random number generators

2011-08-16 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I don't know if it would help you, but I wrote a C library offering a simple API and supporting various RNG (cryptographic, hardware, pseudo, ...). It reuses existing libraries like GSL, OpenSSL, glib, gcrypt, etc. It supports

[issue12754] Add alternative random number generators

2011-08-16 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: On my laptop, KISS4691 could produce about 110 million random numbers per second (148 millon if inlined), whereas MT19937 produced 118 million random numbers per second. The problem is that the Python API can only produce one

[issue12754] Add alternative random number generators

2011-08-15 Thread Raymond Hettinger
New submission from Raymond Hettinger raymond.hettin...@gmail.com: While keeping the MT generator as the default, add new alternative random number generators as drop-in replacements. Since MT was first introduced, PRNG technology has continued to advance. I'm opening this feature request to

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: George Marsaglia's latest random number generator KISS4691 is worth considering, though I am not sure the performance is that different from MT19937. Here is a link to Marsaglia's post on comp.lang.c. Marasglia passed away shortly after

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: I'm posting the code for comparison of KISS4691 and MT19937. I do realize KISS4691 might not be sufficiently different from MT19937 in characteristics for Raymond Hettinger to consider it. But at least here it is for reference should it be of

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: Another (bug fix) post by Marsaglia on KISS4691: http://www.phwinfo.com/forum/comp-lang-c/460292-ensuring-long-period-kiss4691-rng.html -- ___ Python tracker rep...@bugs.python.org

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Changes by Sturla Molden stu...@molden.no: Removed file: http://bugs.python.org/file22905/prngtest.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Changes by Sturla Molden stu...@molden.no: Added file: http://bugs.python.org/file22906/prngtest.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: Further suggestions to improve the random module: ** Object-oriented PRNG: Let it be an object which stores the random state internally, so we can create independent PRNG objects. I.e. not just one global generator. ** Generator for

[issue12754] Add alternative random number generators

2011-08-15 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Please focus your thoughts. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___