
Neutered random number generator let man rig million dollar lotteries - walterbell
http://arstechnica.com/security/2016/04/neutered-random-number-generator-let-man-rig-million-dollar-lotteries/
======
Animats
Why is any major lottery generating random numbers with a computer? California
shows the mechanical ball drop machine on live TV for each draw.[1]

[1] [http://www.calottery.com/happenings/lottery-tv/draw-
videos](http://www.calottery.com/happenings/lottery-tv/draw-videos)

~~~
psychometry
There are so many different games across different states that you can't
televise them all. You could at least televise the generation of a random
seed, perhaps, but you'd still need faith in the individual RNGs.

~~~
mahyarm
You could put on youtube. Each lottery that makes you a shit ton of money has
a $5000 lottery ball machine cost. Or even a computer that looks at 1 lava
lamp per lottery and uses it as it's constantly regenerating seed.

------
koolba
> The newly discovered evidence underscores the difficulty of maintaining
> trustworthy computer systems that do what they're intended to do. In this
> case, it took only one insider to defeat the auditing that the lottery
> system was required to undergo. It's not clear if officials have tightened
> the requirements to make future tampering harder.

Wouldn't hurt to open source it too. It's not a silver bullet as you still
need to ensure the build is stable and the final product is actually running
that same code, but at least it gives the public something to eyeball. That
plus separation of duties (develop/validate/deploy) delegated to separate
people is as good as it gets. To get around that you'd need collusion across
all the groups and if you've got that, you're totally screwed anyway.

~~~
mjklin
I just ran across this in the book _Seeking Chances_ by Emanuele Bardone:

> Interestingly, one of the techniques used by the banks to dupe the rating
> agencies [before the 2008 economic crisis] was to reverse-engineer the
> computer models the agencies used to devise their ratings. Reverse-
> engineering was facilitated by the fact that the rating agencies made their
> computer models public. Thus the banks could trick them starting from
> answers and then working backward to get the intended result.

It would seem open-source is not always advisable when it comes to sensitive
information.

~~~
koolba
> It would seem open-source is not always advisable when it comes to sensitive
> information.

For behavior models like risk ratings sure. A similar example is threat and
fraud detection; if scammers know what you're checking it'd be easier to work
around.

In this case though the output is supposed to be a "fair" random number. If
knowing how it's generated allows you to be able to predetermine it, i.e.
exactly what the offender in this case did, then the code itself is bad and
public eyeballs might find it.

~~~
farzadb82
This also assumes that the "eyeballs" looking at the code are doing it for the
greater good and not personal profit. Given a big enough jackpot, do you
really believe that the person who finds a loophole in the algorithm will do
the right thing?

------
ant6n
Maybe he should've been more clever about hiding his attack -- for example if
the program runs on the next date, it should delete the infected dll and
overwrite it with the original unmodified one.

You can go more clever and deeper with this sort of attack, like in this
story: [https://www.quora.com/What-is-a-coders-worst-
nightmare/answe...](https://www.quora.com/What-is-a-coders-worst-
nightmare/answer/Mick-Stute?srid=RBKZ&amp;amp;share=1)

~~~
scurvy
This man has nothing on Formula 1 ECU coders. Their levels of deception and
track covering are beyond impressive.

~~~
SteveNuts
Examples?

~~~
scurvy
Benetton in 1994:
[https://en.wikipedia.org/wiki/1994_Formula_One_cheating_cont...](https://en.wikipedia.org/wiki/1994_Formula_One_cheating_controversy)

Once the FIA started demanding access to ECU's, programmers learned their
system and figured out ways to produce faked checksums before the race, so
that they matched with the post-race checksum. That is, after the traction
control and ABS programs self-deleted on the parade lap post-race.

This was common knowledge in the paddock, but no one could prove anything.
Even then, everyone was doing it so the field eventually became level.
Cheating and "pushing the rules" has a very long and storied past in F1. If
you're not caught cheating every few years, most would assume you're not
trying hard enough to win.

Edit: Here's a link to a Reddit thread about McLaren's fiddle break. It was a
dual braking setup that allowed the driver to only apply the rear brakes.
Photographers noticed that sometimes only the rear brakes glowed red instead
of all brakes glowing red. Many accused them of using traction control and
ABS. In reality, it was just an independent braking circuit (which was
illegal).
[https://www.reddit.com/r/formula1/comments/1ux791/an_old_f1_...](https://www.reddit.com/r/formula1/comments/1ux791/an_old_f1_shot_of_mclarens_fiddle_brake_a_second/)

~~~
mootothemax
Can you point me at some reading material regarding Benetton's self-modifying
code and the checksums stuff?

Everything I'd read on the topic - until now - had said they had a hidden
mention item - "Option 13" \- that managed the (illegal) traction control, and
when confronted with it, they said it was too difficult to remove, but they'd
never used it. (Honest, guv!)

~~~
scurvy
Rumor was that the other teams developed the self-modifying code, not
Benetton. This is all rumor and speculation though. No one's going to come out
now and say "Yeah we totally cheated back then" because the FIA could reverse
standings and vacate championships.

------
sroussey
Voting machines have less scrutiny

------
userbinator
_computer security official for a US state lottery association_

I thought people who would be associated with the lottery association were
disqualified from participating?

~~~
Houshalter
He was. He gave the winning numbers to his brother. Who then tried to claim it
anonymously somehow. In fact they went to such convoluted lengths to cover it
up, the money ended up unclaimed the first time they did it.

------
paulpauper
A single person winning six times would arouse suspicion

~~~
oneeyedpigeon
As ever, greed is the downfall of the ill-prepared criminal. He could probably
have won a ~$2 million prize once, left it at that, and got away with it.

------
brute
> _The drawing had to happen on three particular days of each year, two
> certain days of the week and at a certain time of day._

Why do these machine have a concept of time and date in the first place?

~~~
noir_lord
It mentions DLL injection in the article so it looks like the machine is
running Windows.

This is one of the downsides of using a commodity OS for absolutely
everything, you end up with edge cases where one size fits nobody.

Throw in that the people commissioning the systems are not computer scientists
and/or applied mathematicians and you end up with this kind of thing.

I'm cynical, if I had to design a machine to draw lottery numbers it would
look like the old style rolling tumbler machines (which is what we use in the
UK for the lottery[1]).

If I needed to handle lots and lots of draws I'd keep the physical machines
and use computer vision to handle reading the balls with a completely separate
system recording the draw as well (so I have an audit trail) EDIT: In fact
thinking about it I'd have _two_ CV systems written independently by different
organisations/teams with any disagreement halting the draw and raising a flag.

Setting it up so that the person who writes the CV code has no access to the
physical machine would be straightforward enough and isolating the recording
system from the rest as well.

Essentially no one person in the loop should have access to all the components
otherwise this stuff probably _will_ happen.

[1]
[https://en.wikipedia.org/wiki/National_Lottery_%28United_Kin...](https://en.wikipedia.org/wiki/National_Lottery_%28United_Kingdom%29#Machine_appearances)

~~~
21
There is a company which makes ball-tumbler machines for state lotteries.

One security feature it has it that each ball has it's unique RFID tag
embedded inside, and the machine checks the tag on ball entry, and only allows
a ball in if certain conditions are met. And I think that it can use that RFID
tag to also read the output (so no CV is needed).

Some use a ball set only once, they throw it away after a run and use a new
one on each draw, and this RFID mechanism can also enforce that (disallow
previously used ids).

Even if someone messes with the RFID tags, the (transparent) machine and the
output is still visually checked by a commission on each run.

Of course, when this information became public knowledge, immediately some
conspiracy theory emerged that the RFID tag can be used to allow only
"favored" balls to exit the machine as winners (which is not possible, only
entry can be disallowed, not exit).

------
msandford
But secure crypto is bad, and can't be trusted folks! We _need_ to have
overseers for all strong crypto and key escrow.

They key escrow couldn't possibly become compromised, could it?

~~~
anonymousab
Better to let a hundred thousand innocent systems get hacked than to let a
single Byte go undeciphered.

------
spoiledtechie
Cudos to the devloper for a long thought out hack. 2005 to 2011. I'm not
saying, what he did was right, but he sure was patient about it.

~~~
coldtea
I don't think he was patient about it. The contrary -- from what I gathered he
didn't wait till 2011 to take advantage of the hack, instead he took advantage
of it every year from 2005 to 2011, 6 times.

Which is also why they caught him.

~~~
XaspR8d
He won the lottery 6 times, and on similar dates, after working for the
lottery? Why did he think he could get away with that? There are so many
opportunities for him to cover his tracks and he missed pretty much all of
them...

~~~
coldtea
Too confident in his own smarts and the idiocy of others...

It could be dumbness, but it's also a common trait in high IQ people -- I've
read stories and know personally lot of them who end up badly, similarly or
otherwise...

~~~
julie1
much more an actuaire saying, hey! too much winners, your insurance willl not
cover your exceptionnal loss. Where is the 50% fat margin? And then they tried
to figure out if cheating was involved.

Still, randomness being random, one day should happen that there are too much
winers some years. Else, maybe the cheaters are on the other side of the game.

