Live data from Hacker News

When Random Isn't Random Enough: Lessons from an Online Poker Exploit

lauradhamilton.com

51–60 of 90 posts

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#51
post #16

Earlier quoted context omitted.

In engineering terms, it's easier to use a reversed-biased diode as a noise source. An input circuit would transfer the diode's random waveform into a shift register as zeros and ones, until the desired word size has been assembled. It's really quite simple, and it could produce a very high degree of randomness. It would differ from typical PRNGs in that the binary sequence could not be reproduced, no matter how much…

Yeah, but AI is taking most of my free cycles at the moment. Still learning, but not much formal computer science. Thank you for responding.

> Yeah, but AI is taking most of my free cycles at the moment.

Given the present state of technology, that's probably a better use of your time. Someone else can produce a white noise source and mass-market it.

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#52

Earlier quoted context omitted.

It wasn't a MITM. Although I've done that too, ARP flood the router and redirect the traffic through myself. Only works on sites where they didn't peer validate the SSL cert. These were just packet dumps, wasn't associated with the WAP. It's hard to remember the exact details but I believe I was dumping the packets and decrypting them with the WEP key then piping them into a C program which just applied the decryptio…

Why would they even send that information to the client before it was needed anyway? Keep it on the server and push it when, and only when, the client needs to see it.

It's catching packets heading to other clients to grab the information they don't send to you.

Or it would be if it were put to use for evil.

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#53
I haven't seen this link posted yet http://www.idquantique.com/random-number-generators/products...

Note they claim: "QUANTIS has also been approved by national authorities and can be used for gaming applications."

If I were implementing this for a casino, I'd do what other posters have already suggested and use at least two independent hardware sources for my random numbers and XOR them together. IMO Intel's on-chip RNG would probably be a good source to use, but only in conjunction with others.

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#54
post #31

The solution here, which the article fails to mention, and which every security expert will undoubtedly tell you, is to make sure you use super random numbers (that's the technical term, for the layperson) by adding two random numbers together.

Strangely, the name of the submitters company is "Additive Analytics"

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#56

Ignoring that some of the variables don't match up properly (the arrays: card and Card), it seems like the explanation of the first flaw may also be flawed. Flaw #1: An Off-by-One Error The algorithm above tries to iterate over each card in the deck, swapping each card with another randomly chosen card in the deck. However—every programmer has made this mistake before—there's an off-by-one error. The function random(…

I think programmer tried to be defensive by ignoring an edge case. He either was lazy in searching for its documentation (<= 1999 you know) and tried to be over-smart to avoid "Out of Range" exception in test/production. Or he didn't consider looking at documentation like some of us do. He may have given it a shot by running it several times to see if it actually generates the number provided as an argument.

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#57
post #48
post #46

Earlier quoted context omitted.

No! You call a blocking rand function bound by available entropy. If your random source is compromised, adding two numbers from the same broken source does nothing. What you can do though, is XOR numbers from independent random sources to improve the entropy of the final output. (not sure if that's what you meant by adding random numbers together)

I believe that chops was being sarcastic in ascribing a typical naive and useless attempt at "improving" randomness to "experts". Come on, "super random numbers"??

Yes, it was indeed a joke. And one which has apparentlly fallen flat.

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#58
post #38

It seems to me that the only major issue here is using a seed which can be trivially brute forced. Even if you don't look around the expected server time in order to guess the seed more quickly, 32 bits is really not hard at all to brute force these days. I don't believe the number of bits the PRNG can generate is an issue here since we only need to uniformly get a number between 1 and 52, though what may be question…

"I'm not entirely convinced the off-by-1 is substantial".

What? You don't think always putting ace of spades at the bottom of the deck is substantial? (given that's what "52" represents)

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#59
post #31

The solution here, which the article fails to mention, and which every security expert will undoubtedly tell you, is to make sure you use super random numbers (that's the technical term, for the layperson) by adding two random numbers together.

Hah, nice one. For people not getting the joke, adding two random numbers reduces the randomness and concentrates the results around a mean.

Interestingly, the perception that adding random numbers together results in even more random numbers is behind the popularity of the scam game "razzle". In razzle there's usually a board containing an array of depressions each lined up with a different value onto which is dropped a number of marbles (there are other ways to play as well, including dice). The important part is the scoring board. After each toss the values where all the marbles landed are added up and then a board is consulted to see how many "points" are scored from that value. The game is easy, get to 10 points and you win. However, there are two tricks. First, the scoring board is arranged in non sequential order. This is to conceal the fact that the group of middle numbers do not win any points. In actuality it is very difficult to win any points, since the probabilities are all concentrated in the middle. Second, because of the scattered nature of the scoring board it's very easy for the person running the game to cheat in your favor by "accidentally" giving you points when you shouldn't have earned them. The scam then works fairly simply. People pay money for each throw, and they are given the opportunity to win a high value prize. For the early throws the operator goes quickly and fudges the score lookups, building up points for the player that they haven't actually used, and giving them an unwarranted confidence in the game. After the player gets within a point or so of winning the operator then lets stops cheating and lets them play completely fairly on their own, at which point they have odds of worse than a thousand to one of winning (keeping in mind that it costs money for every throw).

Re: When Random Isn't Random Enough: Lessons from an Online Poker Exploit

#60
post #58
post #38

It seems to me that the only major issue here is using a seed which can be trivially brute forced. Even if you don't look around the expected server time in order to guess the seed more quickly, 32 bits is really not hard at all to brute force these days. I don't believe the number of bits the PRNG can generate is an issue here since we only need to uniformly get a number between 1 and 52, though what may be question…

"I'm not entirely convinced the off-by-1 is substantial". What? You don't think always putting ace of spades at the bottom of the deck is substantial? (given that's what "52" represents)

That wouldn't be the result. The result is that the final card is swapped only once, and can never be swapped with itself, meaning it is always somewhere else in the deck. If the final card is the ace of spades, then the ace of spades can never be the last card in the shuffled deck.

In most casino card games, shuffles happen before this knowledge becomes particularly useful, which is why I don't think it's necessarily the major cause for concern here. Being able to easily guess the seed is, however, a pretty massive issue.

Post reply on HN