Donald Stufft added the comment:

(A)RC4 and ChaCha are just two stream ciphers that let you encrypt some data, 
they work by essentially producing a psuedo-random stream of data in a 
deterministic manner based off of a key, and than that is XOR'd with the data 
you want to encrypt. arc4random (ab)uses this and uses "real" entropy (e.g. 
randomness pulled from random noise on the network and such) as the "key" and 
then uses the psuedo-random stream of data as the values you get when you ask 
arc4random for some random data. The actual process is quite a bit more complex 
then that, but that's the basic gist.

Userspace PRNG's are not a very good idea for reasons better explained by an 
expert: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/

And yea, using MT for anything that needs a CSPRNG (that is, a 
Cryptographically Secure Psuedo Random Number Generator) is a real bad idea, 
because the numbers it outputs are not "really" random. I'm of a mind that the 
APIs should default to CSPRNGs (so ``random`` should default to SystemRandom) 
and using something like MT should be opt in via something like 
"UnsafeFastRandom) or something. That ship is almost certainly sailed at this 
point though.

----------
nosy: +dstufft

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to