A Brief History of Random Numbers
31–40 of 55 posts
Re: A Brief History of Random Numbers
#32Earlier quoted context omitted.
Nowadays, you can just choose a CSPRNG and be done with it. There are not many use cases where you might prefer a simpler PRNG.
Are CSPRNGs as fast as general high-performance (and non-secure) PRNGs like MT, PGC or Xoroshiro256+? For many use cases in statistics / sampling / monte carlo simulations, you often need millions/billions of well-distributed random numbers with very low generation overhead. Even things like game AIs care about performance with regards to the RNGs they use.
Re: A Brief History of Random Numbers
#33Earlier quoted context omitted.
Are CSPRNGs as fast as general high-performance (and non-secure) PRNGs like MT, PGC or Xoroshiro256+? For many use cases in statistics / sampling / monte carlo simulations, you often need millions/billions of well-distributed random numbers with very low generation overhead. Even things like game AIs care about performance with regards to the RNGs they use.
Not all of them, but ChaCha8 (which many renowned cryptographers consider secure[0]) is in the same ballpark as the most common ones[1]. (A few notes on the second link: I wouldn’t recommend xoshiro256+x8 since it is very weak statistically, same for xoshiro256 IMO. Also, disclaimer, I wrote SHISHUA.) [0]: https://eprint.iacr.org/2019/1492.pdf [1]: https://github.com/espadrine/shishua#comparison
I don't dispute that at the bit level using something like PractRand it has issues and there are better "quality" ones, but at a practical sense in generating excellent 0.0f -> 1.0f float32 numbers and uint32_t indices I couldn't actually notice any quality issues with what it generated for very long running Monto Carlo simulations using billions of random numbers, even though it should have been causing issues with the integer numbers due to the weaker lower bits (although in practice, most of the indices were I wasn't aware of SHISHUA though, I'll check it out.
Re: A Brief History of Random Numbers
#34It amused me that my college statistics textbook had an appendix of random numbers in the back of the book. Just a long list of numbers generated at random and then immortalized on the same medium as ancient texts like the Dead Sea Scrolls. I guess that's the best we had for students before the widespread adoption of computers?
Back in the day, uniform random variates weren't that hard to come by, but if you wanted to simulate some normals, unless you wanted to do double table lookup plus maybe some interpolation, those tables were as convenient as it got.
https://en.wikipedia.org/wiki/A_Million_Random_Digits_with_1...
Re: A Brief History of Random Numbers
#35Pseudo- random! A new programmer reading this article would come away with the impression that, if they need random numbers, they should use xorshift or PCG, when in reality they should be calling getentropy(), or, if a syscall is too expensive, using a CSPRNG (e.g. ChaCha or BLAKE3) seeded with getentropy(). We now have RNGs that are both secure and really, really fast -- multiple GB/s fast -- so there are very few…
Re: A Brief History of Random Numbers
#36Why's he going on about slide-rules?
Re: A Brief History of Random Numbers
#37Why's he going on about slide-rules?
Re: A Brief History of Random Numbers
#38Re: A Brief History of Random Numbers
#39Pseudo- random! A new programmer reading this article would come away with the impression that, if they need random numbers, they should use xorshift or PCG, when in reality they should be calling getentropy(), or, if a syscall is too expensive, using a CSPRNG (e.g. ChaCha or BLAKE3) seeded with getentropy(). We now have RNGs that are both secure and really, really fast -- multiple GB/s fast -- so there are very few…
> when in reality they should be calling getentropy() A new programmer shouldn't be meddling in cryptography, so they probably don't need either cryptographically-secure pseudo-random numbers nor true random numbers. True random numbers are tricky.
Re: A Brief History of Random Numbers
#40Pseudo- random! A new programmer reading this article would come away with the impression that, if they need random numbers, they should use xorshift or PCG, when in reality they should be calling getentropy(), or, if a syscall is too expensive, using a CSPRNG (e.g. ChaCha or BLAKE3) seeded with getentropy(). We now have RNGs that are both secure and really, really fast -- multiple GB/s fast -- so there are very few…
If one needs fast PRNGs, say for simulation, monte carlo stuff, etc. then CSPRNGs are a terrible idea. They're literally orders of magnitude slower than fast PRNGs. Almost nothing needs CSPRNGs (only things needing crypto level security, which is a tiny amount of the uses for PRNGs).
In short, use the right tool for the job.