1 00:00:00,000 --> 00:00:06,540 I'd like to go to the next presentation, and it is Machine Voting, the Bulgarian Experience. 2 00:00:06,540 --> 00:00:26,340 So Alex Stanov is the CTO of Information Services for JSC, and been a software developer starting in the late 90s for a wide variety of projects, from specialized hardware drivers to large scale information citizens for private and public sectors, including e-government services, 3 00:00:26,340 --> 00:00:29,080 elections management, and smart cities. 4 00:00:29,740 --> 00:00:39,520 And so since 2003, Alex has been a leading computer processing of all election results and referendum projects in Bulgaria. 5 00:00:39,820 --> 00:00:43,040 So we're going to learn what goes on in other parts of the world as well. 6 00:00:43,040 --> 00:00:51,780 And as a consultant for the Central Election Commission of Bulgaria, Alex is the primary author of technical and security requirements for election machines used in Bulgaria. 7 00:00:51,780 --> 00:00:54,100 So welcome, Alex, to the stage. 8 00:00:57,560 --> 00:00:59,420 Thank you all. 9 00:01:00,400 --> 00:01:07,700 I'm happy to see so many interesting faces for the processes in Bulgaria. 10 00:01:08,060 --> 00:01:15,520 I hope we can share some ideas, problems, and solutions. 11 00:01:15,940 --> 00:01:23,880 So we already know that my background is IT technical background. 12 00:01:23,880 --> 00:01:28,020 I've been for many years a software developer, then project manager. 13 00:01:28,580 --> 00:01:34,060 Then I have some IT security and penetration testing background. 14 00:01:34,060 --> 00:01:40,760 And in the end, I had to lead the technical side of computer processing of the results. 15 00:01:40,760 --> 00:01:51,820 So this put me in some unique situation where I know IT and I know the election processes in Bulgaria. 16 00:01:51,820 --> 00:01:55,080 So this was very interesting. 17 00:01:55,080 --> 00:01:57,840 Of course, I'm doing a lot of stuff. 18 00:01:57,840 --> 00:02:13,640 And as you can see here, my GitHub, you can see the other things because this talk is a bit different from my other talks here in DEF CON or Black Hat, which are more technical ones. 19 00:02:13,880 --> 00:02:17,460 So first, let's start a bit about Bulgaria. 20 00:02:17,460 --> 00:02:20,580 It's a country here in Eastern Europe. 21 00:02:20,580 --> 00:02:23,340 It's part of European Union. 22 00:02:23,340 --> 00:02:27,300 We have a population of 7 million people. 23 00:02:27,600 --> 00:02:31,820 And it's the size about of Nevada. 24 00:02:32,240 --> 00:02:41,840 So what you're seeing here can be safely transferred like just one state in the U.S. 25 00:02:41,840 --> 00:02:48,640 So we have 265 municipalities where they do different kind of elections. 26 00:02:48,640 --> 00:02:53,540 And we have around 12,000 polling stations. 27 00:02:54,680 --> 00:03:01,810 Naturally, we have elections for president, for our national parliament, EU parliament. 28 00:03:01,810 --> 00:03:10,230 Since 2007, we were a member of EU and we have local elections. 29 00:03:10,230 --> 00:03:19,470 This year, we already had other European countries' elections for European parliament. 30 00:03:19,470 --> 00:03:28,450 And in just a couple of months, we'll have local elections, which are way more difficult than others. 31 00:03:28,450 --> 00:03:38,870 So let's first start how we vote now and what are the processes here, how we put there the machine voting. 32 00:03:39,290 --> 00:03:44,250 So generally speaking, you see two ballots. 33 00:03:44,250 --> 00:03:48,630 The first one is just majority candidates. 34 00:03:48,630 --> 00:03:52,110 This is a ballot for president, I think. 35 00:03:52,110 --> 00:03:54,010 And you have here the party. 36 00:03:54,010 --> 00:03:56,990 You have the person, the candidate. 37 00:03:56,990 --> 00:04:05,350 And you just have to scratch with X or V the chosen candidate. 38 00:04:05,630 --> 00:04:17,290 On the other part, on the other side, you have the preferential ballot where you first choose the party. 39 00:04:17,290 --> 00:04:25,710 And after that, you give preference to choosing from your candidate via these circles here. 40 00:04:25,810 --> 00:04:33,910 And if the candidate collects enough votes, he can push and be elected. 41 00:04:33,910 --> 00:04:44,430 If this party gets enough results, yeah, and this can go here. 42 00:04:44,670 --> 00:05:02,430 And this generally is a good thing because it allows for another majority, but it's highly sophisticated and makes non-trivial the processing of the results. 43 00:05:02,630 --> 00:05:16,910 So when people vote in the e-day, in the end, the polling station members can count in the ballots, the paper ballots, and they feel a polling station protocol with the results. 44 00:05:17,630 --> 00:05:21,270 This is how it looks like, just the first pages. 45 00:05:22,490 --> 00:05:30,810 This protocol looks pretty clean, but in reality, we receive this. 46 00:05:31,410 --> 00:05:40,490 You see a lot of scratches, a lot of corrections here, and in the end, you don't know what exactly happened in that section. 47 00:05:40,490 --> 00:05:53,150 Of course, if we are not so sure what happens, they open the bags with the ballots, recount, and et cetera. 48 00:05:56,860 --> 00:06:02,380 So, putting machines in this equation. 49 00:06:03,020 --> 00:06:05,360 All voting machines are offline. 50 00:06:05,360 --> 00:06:11,320 We don't have online machines, as in most states, as I understood. 51 00:06:11,940 --> 00:06:22,640 When the voter goes in the polling station, he can decide if we will vote by paper ballot or on the machine. 52 00:06:23,340 --> 00:06:31,880 And after that, they fill the protocol with the results written from the machine on the USB drive. 53 00:06:32,480 --> 00:06:37,040 And this is where it gets really crazy. 54 00:06:37,040 --> 00:06:51,320 So, the polling station members have to send by hand the results from the machine with the results on the paper voting, and they have to put it on these protocols. 55 00:06:52,460 --> 00:07:07,600 After that, all this is transferred from polling station to IT centers where the data from these paper protocols are entered by operators. 56 00:07:07,640 --> 00:07:11,720 In fact, we have two stages of data entry. 57 00:07:12,300 --> 00:07:30,420 On the left, you see where the polling station members go and go with the USB drives from the machines and with the protocols and give them to operators. 58 00:07:30,420 --> 00:07:31,980 They do first entry. 59 00:07:31,980 --> 00:07:40,220 After that, in separate IT center, deployed from different place, it's reentered again. 60 00:07:40,520 --> 00:07:46,720 So, you can catch the eventual discrepancies between those both databases. 61 00:07:46,720 --> 00:07:56,920 This is a lot of hard work, which sometimes happens for about 72 hours. 62 00:08:00,690 --> 00:08:10,490 In the e-voting in Bulgaria, we in Bulgaria very much like and love to do experiments with different things. 63 00:08:10,570 --> 00:08:18,830 So, back in 2009, we have these machines. 64 00:08:18,830 --> 00:08:34,590 You can see here the magnetic stripe card reader, touchscreen, and I don't know why, but they put two UPS devices because to have power is paramount. 65 00:08:35,510 --> 00:08:44,990 So, the good thing was that this happened only in nine polling stations from, you remember, 12,000. 66 00:08:45,550 --> 00:08:53,270 And we didn't have too big problems with this. 67 00:08:54,370 --> 00:08:58,490 After that, we continued with the experiments. 68 00:08:58,490 --> 00:09:07,450 And back in 2014, we did it with 100 polling stations machines, then with 300. 69 00:09:08,010 --> 00:09:21,550 And if you can see there, we fall to 50 because from this, they started to use the results, not just as experiment, but we use the results for real. 70 00:09:22,270 --> 00:09:27,290 This was the machine back then that we're using. 71 00:09:29,230 --> 00:09:49,450 And maybe the important thing here is that Bulgarian government decided not to buy these machines, but every time we rent it or lend it because they're not so sure who can keep them. 72 00:09:49,450 --> 00:10:00,150 Will they be needed if there is a legislation change because all these were experiments and et cetera, et cetera. 73 00:10:01,270 --> 00:10:15,230 So, from the experiment, what we know with this kind of machines, the first version were installed with outdated Windows XP. 74 00:10:15,550 --> 00:10:20,470 When somebody screamed about that, it was in 2007. 75 00:10:22,190 --> 00:10:31,930 The way that the machine is activated to allow somebody to vote was with, you see this cable here. 76 00:10:31,930 --> 00:10:45,790 On the other end, you have just a button which is pressed by the polling station officer and the machine unlocks. 77 00:10:45,790 --> 00:10:48,710 So, no other way. 78 00:10:50,250 --> 00:10:56,810 The problem here, yes, the machine prints paper slips and you pass these slips here. 79 00:10:56,810 --> 00:10:59,770 So, you have paper edited trail. 80 00:11:00,450 --> 00:11:10,210 Of course, we have the slips, but we didn't have the legislation that requires those slips to be accounted. 81 00:11:10,210 --> 00:11:12,330 So, of course, we never counted. 82 00:11:12,750 --> 00:11:14,970 But yeah, we have the trail. 83 00:11:15,890 --> 00:11:41,490 There were some issues with missing flash drives and, of course, very low machine voting usage because generally the campaign had to be in a very narrow time and nobody understood that if we can use the machines at all. 84 00:11:42,190 --> 00:11:48,590 And, of course, there were some polling stations where the machines were not powered on. 85 00:11:51,050 --> 00:12:18,130 So, in the beginning of 2019, the Central Election Commission tasked me to draft new requirements for the machines because most of the people understood that this is a problem the way we're doing it and we have to have something more current against current threats. 86 00:12:18,890 --> 00:12:24,650 So, in the requirements, we put very strict hardware and crypto algorithm requirements. 87 00:12:25,490 --> 00:12:37,170 We put that the machine can't have any external communication interfaces, so the air gap principle will be kept. 88 00:12:37,170 --> 00:12:45,730 We required to have a secure boot so we know that nobody changed the machine in transit. 89 00:12:46,190 --> 00:12:52,450 We required a full disk encryption, of course, against this tampering again. 90 00:12:53,210 --> 00:13:06,070 We put very hard requirements about what should be in the OS image, what drivers, what components should be stripped. 91 00:13:06,890 --> 00:13:18,200 So, we have... I'll get to that because we're still on the stage of requirements. 92 00:13:21,770 --> 00:13:48,050 After that, the guys who rented the machines have to do a certificate authority and the own initialization data about the candidates, about the parties must be signed and the machine have to decline to vote, to refuse to vote on signed data. 93 00:13:48,590 --> 00:13:59,470 And in the end, we have activation with smart cards, two control and three voters as seen here. 94 00:13:59,470 --> 00:14:05,730 So, when the voter decides to vote, he gets one voter card. 95 00:14:05,810 --> 00:14:10,250 It can unlock the machine and vote with it. 96 00:14:10,370 --> 00:14:17,350 The vote must be signed on the electronic ballot with this smart card. 97 00:14:17,350 --> 00:14:25,430 After that, he returns this card and the next voter can vote only with one of the first two cards. 98 00:14:25,430 --> 00:14:35,850 So, they rotate and we avoid this interesting button that you saw on the previous machine. 99 00:14:38,640 --> 00:14:54,020 Of course, the usual requirements for Vivipet's slips counting, a very detailed voting process descriptions that have to be implemented are also in place. 100 00:14:54,360 --> 00:15:10,000 We wanted to see the code and we had requirements about unit tests that have to be covered, the coverage of testing and etc. 101 00:15:10,000 --> 00:15:22,080 All the things that we are doing when we are developing, trying to develop high quality and secure information systems were in place. 102 00:15:24,200 --> 00:15:26,840 So, what happened? 103 00:15:27,480 --> 00:15:33,920 Because those machines were rented again, they came with Ubuntu Linux. 104 00:15:37,040 --> 00:15:43,720 Of course, they were smart card activated with external batteries. 105 00:15:44,100 --> 00:15:51,480 Here is the smart card reader and here is the printout for the results. 106 00:15:51,480 --> 00:16:00,260 As you see, it has places for physical clips where you can clip it with tamper evidence 107 00:16:03,540 --> 00:16:09,460 things and this is how the machine works. 108 00:16:09,580 --> 00:16:24,700 The problem that we had here was that nobody wanted from the government institutions to audit if these machines really adhere to the requirements. 109 00:16:25,000 --> 00:16:35,920 So, the vendor says yes, they are fully compliant by the requirements, but we didn't have somebody to check that. 110 00:16:38,220 --> 00:16:56,540 But all it was, we were obligated to do and we took the team from Bulgarian Academy of Science and Sofia University and under the supervision of Central Election Commission, they did some audit, which is classified. 111 00:16:56,540 --> 00:17:01,600 We haven't seen that and they said we are good. 112 00:17:05,240 --> 00:17:07,540 So, what happened? 113 00:17:07,700 --> 00:17:17,420 Just several months ago, back in May, we rented the machines again, this time 3,000 machines. 114 00:17:18,960 --> 00:17:20,060 No audit. 115 00:17:20,060 --> 00:17:33,280 The time frame for the project, because of those higher requirements, was very narrow and it was practically impossible to do the audit in a proper way. 116 00:17:35,360 --> 00:17:41,920 A lot of polling station workers missed the training and didn't know how to work with this machine. 117 00:17:43,460 --> 00:17:57,280 And we went into coordination hell, basically, between different institutions that have to deal with these machines and their physical and logical protection. 118 00:17:59,080 --> 00:18:01,380 Some statistics. 119 00:18:01,380 --> 00:18:08,380 From 23 machines from 3,000, we missed the results data. 120 00:18:10,100 --> 00:18:17,760 Just 26% of the voters used the machines, despite the previous several experiments. 121 00:18:25,250 --> 00:18:28,290 23% of those who voted. 122 00:18:31,350 --> 00:18:40,450 I have to check, but it's not really important how many, 100 or 1,000. 123 00:18:40,890 --> 00:18:42,870 It's just a percentage. 124 00:18:43,110 --> 00:18:50,130 Generally, in Bulgaria, we have a high percent of voters' activity. 125 00:18:50,130 --> 00:18:58,930 Of course, it's lower on EU elections, but yeah, it was nothing different from other ways. 126 00:19:00,330 --> 00:19:10,990 So, 5% of the machines weren't used at all, and in 10% of the machines, less than 10 people voted on the machines. 127 00:19:10,990 --> 00:19:17,450 Because, remember, you can choose to vote on the machine or to vote with paper. 128 00:19:18,130 --> 00:19:28,170 So, we detected a lot of human errors because we take the polling station protocol, and we take the USB data from the machines. 129 00:19:28,350 --> 00:19:45,170 And in about 2.6% of the polling stations, you had more votes received from the machine than summing up from those on the machine and the paper. 130 00:19:45,550 --> 00:19:52,750 I'm not sure if I said it correctly, but this is really a big problem. 131 00:19:53,150 --> 00:20:05,050 From the preferences that you see, we detected errors in about 40%, which is really high. 132 00:20:05,050 --> 00:20:07,470 Why did that happen? 133 00:20:07,550 --> 00:20:09,830 You see this paper slip. 134 00:20:11,610 --> 00:20:14,590 It comes around here. 135 00:20:15,810 --> 00:20:28,350 So, the polling station officers have to read this and to sum it by hand with the paper ones and to put it on polling station protocol. 136 00:20:28,510 --> 00:20:35,990 And this is very, very error-prone to us as we saw it. 137 00:20:36,190 --> 00:20:52,190 Just for information, the project cost was about 5.1 million US dollars, which was the lending of the machines and services that were getting received. 138 00:20:53,390 --> 00:21:07,870 The aftermath from this was a very wide political and media debate about if we should continue with the machine voting. 139 00:21:08,110 --> 00:21:17,710 There were a lot of concerns about the security, the results accuracy, and, of course, the price of this machine voting. 140 00:21:18,670 --> 00:21:32,790 In the meantime of this debate, on 15th of July, it's just a month from today back, we have the largest up-to-date personal data leak in Bulgaria. 141 00:21:33,010 --> 00:21:43,570 Somebody hacked the machine in our national revenue agency and pulled a lot of personal data of Bulgarian citizens. 142 00:21:44,210 --> 00:22:02,970 Of course, on this debate, it gets a bit negative about machine voting because you can't protect the national revenue agency, how you will protect the machine voting, etc, etc. 143 00:22:02,970 --> 00:22:11,910 And on 3rd of July, just half a month back, we had the legislation changed. 144 00:22:11,910 --> 00:22:20,470 We will not have machine voting on upcoming local elections, which are to be held in October this year. 145 00:22:21,070 --> 00:22:34,490 But for all other elections after this, we will use only machines in polling stations with our 200 voters. 146 00:22:34,490 --> 00:22:35,830 So, go figure. 147 00:22:35,830 --> 00:22:40,990 I really, for myself, I don't know how this was decided in the end. 148 00:22:41,610 --> 00:22:48,690 But yeah, and that's all. 149 00:22:49,530 --> 00:22:50,550 Yes? 150 00:22:50,550 --> 00:22:58,510 Yeah, so when you had the total votes sum be absurdly large, was that because of double voting or double counting? 151 00:22:59,770 --> 00:23:01,490 Total votes for... 152 00:23:01,490 --> 00:23:07,690 You had the problem that the total number of votes was more than the ballots plus the machine thing. 153 00:23:07,690 --> 00:23:09,310 So, that was a problem. 154 00:23:09,310 --> 00:23:11,770 But was it because something was counted twice? 155 00:23:11,770 --> 00:23:14,570 Or was it because some people were able to vote twice? 156 00:23:14,570 --> 00:23:19,590 No, it's not concerning double voting. 157 00:23:19,590 --> 00:23:21,590 There was no double voting. 158 00:23:21,590 --> 00:23:32,330 It was just a human error when you sum the result from this long paper slip with the results from the ballot box. 159 00:23:32,850 --> 00:23:36,770 And they have to write it on this protocol. 160 00:23:37,050 --> 00:23:45,550 Those are about 3,200 numbers that you have to sum. 161 00:23:45,850 --> 00:23:49,370 And, of course, humans make mistakes. 162 00:23:50,230 --> 00:23:51,230 Yes? 163 00:23:52,410 --> 00:23:53,790 Please. 164 00:23:58,820 --> 00:23:59,500 Those? 165 00:23:59,500 --> 00:24:01,040 The next few years. 166 00:24:01,760 --> 00:24:04,800 You said you're missing results from 23 machines. 167 00:24:05,520 --> 00:24:06,520 How many? 168 00:24:12,880 --> 00:24:20,760 Well, those were missing in 23 machines, which means 23 polling stations. 169 00:24:20,760 --> 00:24:26,580 In our legislation, we can't have a polling station with more than 1,000 voters. 170 00:24:26,980 --> 00:24:28,980 This is tops. 171 00:24:28,980 --> 00:24:40,660 And when I say missing results, we have a paper protocol from this polling station, which says that there was a voting there. 172 00:24:41,020 --> 00:24:48,660 But for some reason, which can be, they couldn't find the USB flash drive. 173 00:24:48,660 --> 00:24:54,900 The USB flash drive can be read after that. 174 00:24:54,900 --> 00:24:57,220 Or some other issues. 175 00:24:57,220 --> 00:25:00,740 We just don't have the data from the machines. 176 00:25:01,720 --> 00:25:10,220 But I don't think that for these 23 polling stations, a lot of people use the machines anyway. 177 00:25:10,220 --> 00:25:16,200 Some of those were part of those that were not used at all. 178 00:25:19,300 --> 00:25:20,520 Yes, please. 179 00:25:28,520 --> 00:25:33,480 No, there is no EU regulation on using a voting machine. 180 00:25:33,700 --> 00:25:40,600 There are some just very broad requirements about the voting process. 181 00:25:40,600 --> 00:25:52,820 But every country in the EU decides by itself how it will vote and what processes and mechanisms it will have. 182 00:25:52,820 --> 00:26:02,880 We have a bit more complex requirements concerning the EU elections, which are held in all Europe for one week. 183 00:26:02,880 --> 00:26:08,040 But generally, this is up to every country to decide. 184 00:26:25,430 --> 00:26:33,590 Well, we're not sure because there was not any extensive research on that part. 185 00:26:33,590 --> 00:26:42,790 And the politics like to dribble with that if the machine voting is secure or not. 186 00:26:42,970 --> 00:26:54,390 Of course, half of the parties want machine voting, other half say this is fault and we don't have to use it. 187 00:26:54,910 --> 00:26:57,950 So it's different. 188 00:26:58,110 --> 00:26:59,350 It's really different. 189 00:26:59,350 --> 00:27:06,730 We have some parts of the country where we have very high usage of the machine voting. 190 00:27:06,730 --> 00:27:12,810 So it's not evenly distributed everywhere. 191 00:27:12,810 --> 00:27:18,210 But in some other places, we have really small awareness of that. 192 00:27:18,570 --> 00:27:19,730 Yes, please. 193 00:27:35,260 --> 00:27:54,500 Well, the requirements says that we have to have a paper audit trail and all the data that comes on the USB drive from the machines have to be signed with the smart cards with, of course, the certificate. 194 00:27:54,780 --> 00:28:06,820 And the smart cards have to be transported by different means, not with the machines in conflict, but from different people, yes, from different teams. 195 00:28:07,260 --> 00:28:09,940 All this is in the requirements. 196 00:28:09,940 --> 00:28:17,700 But we really don't know, or at least I don't know, because I haven't been everywhere. 197 00:28:17,700 --> 00:28:24,500 And, of course, I haven't did the audit, and I don't know the audit results. 198 00:28:25,300 --> 00:28:27,080 But it's always okay. 199 00:28:27,080 --> 00:28:32,760 But I believe these controls were in place. 200 00:28:32,760 --> 00:28:35,440 I hope these controls were in place. 201 00:29:17,390 --> 00:29:19,090 Yeah, always connected. 202 00:29:46,490 --> 00:29:50,650 Okay, people can't vote where they decide. 203 00:29:50,650 --> 00:29:54,750 They have to vote in the polling station that they can vote. 204 00:29:54,750 --> 00:29:59,270 And where will be the machines is decided by the Central Election Commission. 205 00:29:59,270 --> 00:30:02,590 So you can choose. 206 00:30:02,590 --> 00:30:09,350 And in most cases, you know, you can use the machine when you go to vote, not before that. 207 00:30:14,070 --> 00:30:17,530 This must be done by the polling station members. 208 00:30:17,530 --> 00:30:20,150 And maybe not. 209 00:30:23,110 --> 00:30:25,530 Yes, there was a campaign about that. 210 00:30:25,610 --> 00:30:28,050 So, okay, sorry, guys. 211 00:30:28,090 --> 00:30:30,890 If there are more questions, I'll be on the back. 212 00:30:30,890 --> 00:30:32,170 Thank you very much.