Can you use code to steal an election?
Yes. You can.
Video over.
Welcome to CompChomp...the only show on the internet where we forget our tagline
and have to film the next day.
I am a fan of most technological advances.
Every time I'm in the crosswalk and I almost
get smashed by a distracted driver, I am so happy that human-driven cars
are soon going to be a thing of that past.
So when I hear people complaining that "Electronic voting is dangerous!!!",
I just tend to roll my eyes. Especially when it all seems so politically motivated.
In 2004 - one of the first elections I was
able to vote in - everyone was talking about
how the evil Diebold corporation was going
to deliver the election to George W. Bush
simply through manipulation of voting machines.
Fast forward to 2016 and it's the exact same
story. Except this time it's the evil George
Soros and he's going to steal the election
for Hilary Clinton.
Eh...heh...heh...heh....comic book super villain!
So I set off on a journey to research electronic
voting and my intention from the start was
to show everyone how all of these conspiracy
theories are just bunk and that electronic
voting is absolutely safe. Unfortunately,
that did not turn out to be the case.
The first thing I found out is that the code
that powers electronic voting machines is
considered "intellectual property". This means
it's protected by laws like the Digital Millennium
Copywrite Act. And what this means is that
when researchers asked to see this code, to
verify what it's doing, the companies don't
have to let them unless they want to. And
as you might imagine, most of the companies were like,
"Thanks, but this is our private property."
One of the few exceptions was in 2006. 
The Secretary of State of California said,
"Hey! If you guys want us to spend a whole bunch
of money on these machines, you're going to
have to prove that these are safe for our
citizens to use.
So a team of researchers from U.C. Berkeley got to look at some of the code of the most popular
voting machines, and what they found...was that it was really well written code.
But, there were some problems.
Issue number 1. This code was not written using high assurance techniques.
What are high assurance engineering techniques? 
I dug in and found out that most code is written
sort of following the same procedures which
is that you write quality code, and then you
hand it off to a quality assurance team and
they test it by clicking all over the place...running
it through its paces...and seeing where it
fails. Also, if you're doing what you're supposed
to do, you write automated tests that run
when you change the code so that you see if
you break anything. And code written this
way can be really really awesome, but it still
has the possibility of giving you, say, a
blue screen of death or being vulnerable to
hackers...like this guy.
So high assurance engineering techniques on
the other hand borrow from our friends in
mathematics. And they use mathematical proofs
to absolutely guarantee that the code that's
written will do exactly what you say it will
do, no more and importantly no less. And you
can take these proofs and you can hand them
off to a third party and they can verify that
this code does exactly what you say. 
No more and no less.
It's sort of repetitive but it's very important...so important.
And this code in these voting machines...it
was really good, but they found issues in
the interpreter. For instance, there were
buffer overruns and double free errors that
skilled hackers can use to change what the
program is going to do when it runs.
Which is kind of not a good thing....
But thats not even the worst of it. They discovered
that the machines were vulnerable to an attack
called the "Hursti Hack". It was named after the 
Finnish programmer Harri Hursti that discovered it.
When the voting machines start up, the 
first thing they do is...
I don't know if it's the first thing they do.
The voting machine wakes
up and it says, "Hey! No one should have voted
on me yet, so there shouldn't be any votes."
And this zero vote total is supposed to ensure
that when the votes start everything's fair.
Except, Hursti thought to himself,
there is more than one way to make a zero.
What if I start this out with negative 150 
votes for A and 150 votes for B?
And guess what? It worked!  The voting 
machine read that as a zero vote total.
Furthermore, Hursti was able
to change it not only on the machine itself,
but also on the central tabulation machine which means that everyone involved,
all of the election officials said, "Yeah. If this had happened in a real election I would have certified this."
If the votes match....the vote's are scratch.
The votes a pumpkin patch....I don't have
a good rhyme here, but basically, if those
votes match it gets certified.
Now, you're probably thinking this is all
well and good in some sort of academic setting
where Professor Hursti (he's not 
a professor...he's just a hacker),
but, an academic setting where someone gets to sit there all day and mess with the voting machine.
But that's not the real world. We don't just let someone walk into a private space with one of our voting
machines and do whatever they want. 
Oh wait....except that is exactly what we do.
One of the foundations of our democracy where
we have anonymous voting is that you have
to make sure that someone's vote absolutely
was not coerced. So you cannot have anyone
recording who they voted for or watching them
vote. If you put so much as a security camera
in that booth with a voter, you've nullified
things. Because it could then be used to make
them vote a certain way. So we allow people
to walk in the booth, have privacy with the
voting machine, and all it takes is one USB
card with the right code slipped in the machine
and suddenly your election is no longer valid.
And why does this USB card work? Because that's how they program most of these voting machines.
They take a USB card. They go from 
machine to machine to machine and boom.
So if you get your bad code on one machine...
it's probably on a LOT of machines.
It's like a USB transmitted disease. 
A UTD...or something.
Knowing all of this and knowing the damage
a that a single hacker can do and how valuable
it is for a hacker to steal an election especially
in a wealthy, industrialized nation...I think
that from now on, I'm just gonna ask for that
paper. It's just like....doop...it's just....
it's simple. We all know how to use pencils. It's
good. It's crayon....
At least until these fromblems are fixed.
Froblems? At least until these problems are fixed.
Chomp!
