Message250246
(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. |
|
Date |
User |
Action |
Args |
2015-09-08 17:50:25 | dstufft | set | recipients:
+ dstufft, gvanrossum, tim.peters, vstinner, jbeck |
2015-09-08 17:50:25 | dstufft | set | messageid: <1441734625.3.0.0067864636191.issue25003@psf.upfronthosting.co.za> |
2015-09-08 17:50:25 | dstufft | link | issue25003 messages |
2015-09-08 17:50:24 | dstufft | create | |
|