This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dstufft
Recipients dstufft, gvanrossum, jbeck, tim.peters, vstinner
Date 2015-09-08.17:50:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
(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:

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.
Date User Action Args
2015-09-08 17:50:25dstufftsetrecipients: + dstufft, gvanrossum, tim.peters, vstinner, jbeck
2015-09-08 17:50:25dstufftsetmessageid: <>
2015-09-08 17:50:25dstufftlinkissue25003 messages
2015-09-08 17:50:24dstufftcreate