4 ms·
So a simple linear generator is fine for an online poker game?
by tedunangst 6y ago
So a simple linear generator is fine for an online poker game?
- btilly 6y agoThe claim that most uses of random() are not in places where cryptographic security is needed is not in conflict with any list of examples where it is needed. Here are the last several times I saw random() used. Seeding a neural network for a Coursera course. Not only do you need to call random() a bunch of times, but the ability to set a seed and get deterministic results makes grading of the results massively easier. Creating simulation data used for integration tests on a piece of software. Picking a few random numbers that I used in an explanation of an answer. Of course the plural of anecdote is not data. However in my corner of the world it is very rare to need cryptographically secure anything. And when I do, I know better than to code it myself. But it is common to need a lot of cheap numbers in a hurry.
- wolf550e 6y agochacha8 (chacha20 but with fewer rounds) seeded with either a deterministic seed or from /dev/urandom (depending on what you need) is a perfectly fine PRNG, and should run at 4 GB/sec on a single core, which is plenty. Only 7 rounds of chacha are cryptographically broken, so chacha20 has excessive security margin. Using 8 rounds of that everywhere you use random today (and not a CSPRING) should be a no-brainer, I guess. On hardware with AESNI (like all x86 for the last 10 years), a reduced round AES-CTR should be very fast and also string enough for the cases when you don't need a CSPRING. Full AES-128 outputs 4.7GB/sec on my laptop, recent chips have better AES throughput.
- Sohcahtoa82 6y agoWell of course an online poker game should be using a CSPRNG. The parent comment said "Most simulations, games ...". Most. Not all. I think it's pretty obvious that Poker would not be included a statement of "Most". The real litmus test is the question of "What happens if a malicious actor is able to predict the random numbers?"
- tedunangst 6y agoThe claim was that everything that isn't generating cryptography does not need security.
- yellowapple 6y agoI personally parsed the claim as "most (simulations, games, everything)" rather than "(most simulations), games, everything", but I can see how that can go either way.
- ChrisLomont 6y agoIf you're using it to give hands to people, then no. If you suitably hash or whiten the outcome, then yes. If you're using it to generate Monte Carlo hand playouts to generate % outcomes to assist such a game, then you most certainly want an extremely fast generator. Only slightly more complex than a LCG is the PCG class (based on a PCG, and it's just as simple and fast in most cases as a LCG). And you'll need such Monte Carlo simulations to detect cheating, among other things. So even for an online poker game you need to know what you're doing. Neither type of RNG will solve all the issues you need. So yes, at the base a simple LCG would suffice if you know how to use it. https://www.pcg-random.org/index.html https://www.pcg-random.org/index.html
- bigiain 6y agoIf your devs for your online casino aren’t smart and experienced enough to know when blanket advice and recommendations about random numbers don’t apply to them - enjoy going broke, it shouldn’t take long...