3 ms·
Maybe arc4random(), from OpenBSD. There were some slides linked earlier about it [1], it might be worth looking into. [1] http://www.openbsd.org/papers/hackfes
by kbaker 12y ago
Maybe arc4random(), from OpenBSD. There were some slides linked earlier about it [1], it might be worth looking into.
[1] http://www.openbsd.org/papers/hackfest2014-arc4random/mgp00001.html http://www.openbsd.org/papers/hackfest2014-arc4random/mgp000...
- carey 12y agoIs it really wise to choose a random number generator based on RC4, which is known to have remarkably strong biases? Surely it would be better to use something based on ChaCha20, Keccak or Spritz if you have the choice?
- grogers 12y agoIt does use ChaCha20, and the implementation will use something else in another 20 years most likely. http://www.openbsd.org/papers/hackfest2014-arc4random/mgp00038.html http://www.openbsd.org/papers/hackfest2014-arc4random/mgp000...
- carey 12y agoServes me right for not reading through all the slides. I would argue that it's one of the more misleading function names out there, though.
- justincormack 12y agoYes, it is misleading, it used to use rc4. Posix are proposing to standardise it under a new generic name, so it is unlikely to get changed until this happens.
- emmelaich 12y agorand(3) recommends random(3) and arc4random(3) rand48(3) recommends random(3) random(3) recommends arc4random(3) So no excuses.