start	end	text
0	6540	I'd like to go to the next presentation, and it is Machine Voting, the Bulgarian Experience.
6540	14720	So Alex Stanov is the CTO of Information Services for JSC, and been a software developer starting
14720	20640	in the late 90s for a wide variety of projects, from specialized hardware drivers to large
20640	26340	scale information citizens for private and public sectors, including e-government services,
26340	33680	elections management, and smart cities. And so since 2003, Alex has been a leading computer
33680	40560	processing of all election results and referendum projects in Bulgaria. So we're going to learn
40560	44200	what goes on in other parts of the world as well. And as a consultant for the Central
44200	48880	Election Commission of Bulgaria, Alex is the primary author of technical and security requirements
48880	54100	for election machines used in Bulgaria. So welcome, Alex, to the stage.
57560	69040	Thank you all. I'm happy to see so many interesting faces for the processes in Bulgaria. I hope
70360	81640	we can share some ideas, problems, and solutions. So we already know that my background is
81640	88020	IT technical background. I've been for many years a software developer, then project manager.
88580	96080	Then I have some IT security and penetration testing background. And in the end, I had to
96080	103380	lead the technical side of computer processing of the results. So this put me in some unique
103380	114120	situation where I know IT and I know the election processes in Bulgaria. So this was
114120	120780	very interesting. Of course, I'm doing a lot of stuff. And as you can see here, my GitHub,
122220	129540	you can see the other things because this talk is a bit different from my other talks here in
129540	137460	DEF CON or Black Hat, which are more technical ones. So first, let's start a bit about Bulgaria.
137460	145040	It's a country here in Eastern Europe. It's part of European Union. We have a population of 7
145040	155960	million people. And it's the size about of Nevada. So what you're seeing here can be safely
155960	166400	transferred like just one state in the U.S. So we have 265 municipalities where they do
166400	173540	different kind of elections. And we have around 12,000 polling stations.
174680	181810	Naturally, we have elections for president, for our national parliament, EU parliament.
181810	193910	Since 2007, we were a member of EU and we have local elections. This year, we already had other
194530	201790	European countries' elections for European parliament. And in just a couple of months,
201790	209990	we'll have local elections, which are way more difficult than others. So let's first start
209990	218870	how we vote now and what are the processes here, how we put there the machine voting.
219290	229570	So generally speaking, you see two ballots. The first one is just majority candidates. This is a
229570	236990	ballot for president, I think. And you have here the party. You have the person, the candidate.
236990	247190	And you just have to scratch with X or V the chosen candidate. On the other part, on the other
247190	258630	side, you have the preferential ballot where you first choose the party. And after that, you give
258630	268270	preference to choosing from your candidate via these circles here. And if the candidate collects
268270	283410	enough votes, he can push and be elected. If this party gets enough results, yeah, and this can go
283410	293550	here. And this generally is a good thing because it allows for another majority, but it's highly
296270	306090	sophisticated and makes non-trivial the processing of the results. So when people vote in the e-day,
306090	313190	in the end, the polling station members can count in the ballots, the paper ballots, and they feel
314210	321270	a polling station protocol with the results. This is how it looks like, just the first pages.
322490	333750	This protocol looks pretty clean, but in reality, we receive this. You see a lot of scratches, a lot
333750	343390	of corrections here, and in the end, you don't know what exactly happened in that section. Of course,
344330	353150	if we are not so sure what happens, they open the bags with the ballots, recount, and et cetera.
356860	365980	So, putting machines in this equation. All voting machines are offline. We don't have
365980	375460	online machines, as in most states, as I understood. When the voter goes in the
375460	382640	polling station, he can decide if we will vote by paper ballot or on the machine.
383340	391880	And after that, they fill the protocol with the results written from the machine on the USB drive.
392480	400180	And this is where it gets really crazy. So, the polling station members have to
400180	408720	send by hand the results from the machine with the results on the paper voting, and they have
408720	418220	to put it on these protocols. After that, all this is transferred from polling station to IT centers
418840	428500	where the data from these paper protocols are entered by operators. In fact, we have
428840	438100	two stages of data entry. On the left, you see where the polling station members go
438810	450420	and go with the USB drives from the machines and with the protocols and give them to operators.
450420	457940	They do first entry. After that, in separate IT center, deployed from different place,
457940	464900	it's reentered again. So, you can catch the eventual discrepancies between those both
464900	476920	databases. This is a lot of hard work, which sometimes happens for about 72 hours.
480690	488890	In the e-voting in Bulgaria, we in Bulgaria very much like and love to do experiments
488890	500510	with different things. So, back in 2009, we have these machines. You can see here the
501330	509410	magnetic stripe card reader, touchscreen, and I don't know why, but they put two UPS devices
509410	519390	because to have power is paramount. So, the good thing was that this happened only in
519390	533270	nine polling stations from, you remember, 12,000. And we didn't have too big problems with this.
534370	543830	After that, we continued with the experiments. And back in 2014, we did it with 100 polling
543830	553410	stations machines, then with 300. And if you can see there, we fall to 50 because from this,
553410	561550	they started to use the results, not just as experiment, but we use the results for real.
562270	567290	This was the machine back then that we're using.
569230	576430	And maybe the important thing here is that Bulgarian government decided not to buy these
576430	589450	machines, but every time we rent it or lend it because they're not so sure who can keep them.
589450	598370	Will they be needed if there is a legislation change because all these were experiments and
598370	607950	et cetera, et cetera. So, from the experiment, what we know with this kind of machines,
607950	619430	the first version were installed with outdated Windows XP. When somebody screamed about that,
619430	629730	it was in 2007. The way that the machine is activated to allow somebody to vote was with,
629730	636750	you see this cable here. On the other end, you have just a button which is
638850	648710	pressed by the polling station officer and the machine unlocks. So, no other way.
650250	656810	The problem here, yes, the machine prints paper slips and you pass these slips here.
656810	665750	So, you have paper edited trail. Of course, we have the slips, but we didn't have the legislation
665750	673490	that requires those slips to be accounted. So, of course, we never counted. But yeah,
673490	682370	we have the trail. There were some issues with missing flash drives and, of course,
682370	691610	very low machine voting usage because generally the campaign had to be in a very narrow
692430	702970	time and nobody understood that if we can use the machines at all. And, of course,
702970	708590	there were some polling stations where the machines were not powered on.
711050	722890	So, in the beginning of 2019, the Central Election Commission tasked me to draft new requirements
722890	732050	for the machines because most of the people understood that this is a problem the way
732050	738130	we're doing it and we have to have something more current against current threats.
738890	744650	So, in the requirements, we put very strict hardware and crypto algorithm requirements.
745490	753230	We put that the machine can't have any external communication interfaces, so the air gap
754510	762830	principle will be kept. We required to have a secure boot so we know that nobody changed
762830	771270	the machine in transit. We required a full disk encryption, of course, against this tampering
771270	782550	again. We put very hard requirements about what should be in the OS image, what drivers,
782550	793550	what components should be stripped. So, we have... I'll get to that
795230	798200	because we're still on the stage of requirements.
801770	810030	After that, the guys who rented the machines have to do a certificate authority
810770	819710	and the own initialization data about the candidates, about the parties must be signed
820610	828050	and the machine have to decline to vote, to refuse to vote on signed data.
828590	837310	And in the end, we have activation with smart cards, two control and three voters
838030	847850	as seen here. So, when the voter decides to vote, he gets one voter card. It can unlock the
847850	857350	machine and vote with it. The vote must be signed on the electronic ballot with this smart card.
857350	864190	After that, he returns this card and the next voter can vote only with one of the first two
864190	874330	cards. So, they rotate and we avoid this interesting button that you saw on the previous
874330	886160	machine. Of course, the usual requirements for Vivipet's slips counting, a very detailed
886160	894020	voting process descriptions that have to be implemented are also in place.
894360	903220	We wanted to see the code and we had requirements about unit tests that have to be
904900	914600	covered, the coverage of testing and etc. All the things that we are doing when we are developing,
914600	922080	trying to develop high quality and secure information systems were in place.
924200	933920	So, what happened? Because those machines were rented again, they came with Ubuntu Linux.
937040	946820	Of course, they were smart card activated with external batteries. Here is the smart card reader
947300	956500	and here is the printout for the results. As you see, it has places for physical clips where
957060	960260	you can clip it with tamper evidence
963540	973220	things and this is how the machine works. The problem that we had here was that nobody
973220	982180	wanted from the government institutions to audit if these machines really adhere to
982180	991540	the requirements. So, the vendor says yes, they are fully compliant by the requirements,
992510	995920	but we didn't have somebody to check that.
998220	1007200	But all it was, we were obligated to do and we took the team from Bulgarian Academy of Science and
1008560	1014920	Sofia University and under the supervision of Central Election Commission, they did some audit,
1014920	1021600	which is classified. We haven't seen that and they said we are good.
1025240	1033460	So, what happened? Just several months ago, back in May,
1033460	1037420	we rented the machines again, this time 3,000 machines.
1038960	1045780	No audit. The time frame for the project, because of those higher requirements, was very narrow
1046820	1053280	and it was practically impossible to do the audit in a proper way.
1055360	1060740	A lot of polling station workers missed the training and didn't know how to work with this
1060740	1070920	machine. And we went into coordination hell, basically, between different institutions
1070920	1077280	that have to deal with these machines and their physical and logical protection.
1079080	1088380	Some statistics. From 23 machines from 3,000, we missed the results data.
1090100	1097760	Just 26% of the voters used the machines, despite the previous several experiments.
1105250	1118470	23% of those who voted. I have to check, but it's not really important how many, 100 or
1119010	1129190	1,000. It's just a percentage. Generally, in Bulgaria, we have a high percent of voters'
1129190	1137990	activity. Of course, it's lower on EU elections, but yeah, it was nothing different from other
1137990	1149750	ways. So, 5% of the machines weren't used at all, and in 10% of the machines, less than 10 people
1149750	1156430	voted on the machines. Because, remember, you can choose to vote on the machine or to vote with
1156430	1164310	paper. So, we detected a lot of human errors because we take the polling station protocol,
1164310	1174150	and we take the USB data from the machines. And in about 2.6% of the polling stations,
1174150	1183330	you had more votes received from the machine than summing up from those on the machine
1183330	1192750	and the paper. I'm not sure if I said it correctly, but this is really a big problem.
1193150	1205050	From the preferences that you see, we detected errors in about 40%, which is really high.
1205050	1209830	Why did that happen? You see this paper slip.
1211610	1223870	It comes around here. So, the polling station officers have to read this and to sum it by hand
1224530	1231850	with the paper ones and to put it on polling station protocol. And this is very, very error-prone
1232540	1242270	to us as we saw it. Just for information, the project cost was about 5.1 million
1243400	1252190	US dollars, which was the lending of the machines and services that were getting received.
1253390	1262330	The aftermath from this was a very wide political and media debate about
1264070	1271350	if we should continue with the machine voting. There were a lot of concerns about the security,
1271350	1277710	the results accuracy, and, of course, the price of this machine voting.
1278670	1287990	In the meantime of this debate, on 15th of July, it's just a month from today back,
1287990	1295250	we have the largest up-to-date personal data leak in Bulgaria. Somebody hacked the machine
1295250	1303570	in our national revenue agency and pulled a lot of personal data of Bulgarian citizens.
1304210	1315670	Of course, on this debate, it gets a bit negative about machine voting because you can't protect
1315670	1325110	the national revenue agency, how you will protect the machine voting, etc, etc. And on 3rd of July,
1325110	1333550	just half a month back, we had the legislation changed. We will not have machine voting
1333550	1340470	on upcoming local elections, which are to be held in October this year.
1341070	1348110	But for all other elections after this, we will use only machines
1350530	1357490	in polling stations with our 200 voters. So, go figure. I really, for myself,
1357490	1360990	I don't know how this was decided in the end.
1361610	1368690	But yeah, and that's all.
1369530	1370550	Yes?
1370550	1376890	Yeah, so when you had the total votes sum be absurdly large, was that because of double voting
1376890	1378510	or double counting?
1379770	1381490	Total votes for...
1381490	1386010	You had the problem that the total number of votes was more than the ballots plus the machine
1386810	1391770	thing. So, that was a problem. But was it because something was counted twice?
1391770	1394570	Or was it because some people were able to vote twice?
1394570	1403290	No, it's not concerning double voting. There was no double voting. It was just a human error
1403290	1412330	when you sum the result from this long paper slip with the results from the ballot box.
1412850	1425550	And they have to write it on this protocol. Those are about 3,200 numbers that you have to sum.
1425850	1429370	And, of course, humans make mistakes.
1430230	1431230	Yes?
1432410	1433790	Please.
1438820	1439500	Those?
1439500	1446520	The next few years. You said you're missing results from 23 machines. How many?
1452880	1462440	Well, those were missing in 23 machines, which means 23 polling stations. In our legislation,
1462440	1470220	we can't have a polling station with more than 1,000 voters. This is tops. And when I say
1470220	1479080	missing results, we have a paper protocol from this polling station, which says that there was
1479280	1488660	a voting there. But for some reason, which can be, they couldn't find the USB flash drive.
1488660	1498520	The USB flash drive can be read after that. Or some other issues. We just don't have the
1498520	1507000	data from the machines. But I don't think that for these 23 polling stations,
1507340	1515320	a lot of people use the machines anyway. Some of those were part of those that were not used at
1515320	1535000	all. Yes, please. No, there is no EU regulation on using a voting machine. There are some just
1535000	1543700	very broad requirements about the voting process. But every country in the EU decides by itself
1544680	1554600	how it will vote and what processes and mechanisms it will have. We have a bit more
1555520	1562920	complex requirements concerning the EU elections, which are held in all Europe for one week. But
1563800	1568040	generally, this is up to every country to decide.
1585430	1594810	Well, we're not sure because there was not any extensive research on that part. And the
1594810	1604230	politics like to dribble with that if the machine voting is secure or not. Of course,
1604230	1613410	half of the parties want machine voting, other half say this is fault and we don't have to use
1613410	1623170	it. So it's different. It's really different. We have some parts of the country where we have
1623170	1633710	very high usage of the machine voting. So it's not evenly distributed everywhere. But in some
1633710	1657640	other places, we have really small awareness of that. Yes, please. Well, the requirements says
1657640	1667720	that we have to have a paper audit trail and all the data that comes on the USB drive from
1667720	1675200	the machines have to be signed with the smart cards with, of course, the certificate. And the
1675200	1682980	smart cards have to be transported by different means, not with the machines in conflict, but
1684000	1691280	from different people, yes, from different teams. All this is in the requirements. But we really
1691280	1699780	don't know, or at least I don't know, because I haven't been everywhere. And, of course, I haven't
1700660	1707220	did the audit, and I don't know the audit results. But it's always okay. But
1709120	1715440	I believe these controls were in place. I hope these controls were in place.
1757390	1759090	Yeah, always connected.
1786490	1792930	Okay, people can't vote where they decide. They have to vote in the polling station that
1793550	1799410	they can vote. And where will be the machines is decided by the Central Election Commission. So
1800590	1808110	you can choose. And in most cases, you know, you can use the machine when you go to vote,
1808110	1820150	not before that. This must be done by the polling station members. And maybe not.
1823110	1829730	Yes, there was a campaign about that. So, okay, sorry, guys. If there are more questions,
1829730	1832170	I'll be on the back. Thank you very much.
