[00:00.000 --> 00:06.540] I'd like to go to the next presentation, and it is Machine Voting, the Bulgarian Experience. [00:06.540 --> 00:14.720] So Alex Stanov is the CTO of Information Services for JSC, and been a software developer starting [00:14.720 --> 00:20.640] in the late 90s for a wide variety of projects, from specialized hardware drivers to large [00:20.640 --> 00:26.340] scale information citizens for private and public sectors, including e-government services, [00:26.340 --> 00:33.680] elections management, and smart cities. And so since 2003, Alex has been a leading computer [00:33.680 --> 00:40.560] processing of all election results and referendum projects in Bulgaria. So we're going to learn [00:40.560 --> 00:44.200] what goes on in other parts of the world as well. And as a consultant for the Central [00:44.200 --> 00:48.880] Election Commission of Bulgaria, Alex is the primary author of technical and security requirements [00:48.880 --> 00:54.100] for election machines used in Bulgaria. So welcome, Alex, to the stage. [00:57.560 --> 01:09.040] Thank you all. I'm happy to see so many interesting faces for the processes in Bulgaria. I hope [01:10.360 --> 01:21.640] we can share some ideas, problems, and solutions. So we already know that my background is [01:21.640 --> 01:28.020] IT technical background. I've been for many years a software developer, then project manager. [01:28.580 --> 01:36.080] Then I have some IT security and penetration testing background. And in the end, I had to [01:36.080 --> 01:43.380] lead the technical side of computer processing of the results. So this put me in some unique [01:43.380 --> 01:54.120] situation where I know IT and I know the election processes in Bulgaria. So this was [01:54.120 --> 02:00.780] very interesting. Of course, I'm doing a lot of stuff. And as you can see here, my GitHub, [02:02.220 --> 02:09.540] you can see the other things because this talk is a bit different from my other talks here in [02:09.540 --> 02:17.460] DEF CON or Black Hat, which are more technical ones. So first, let's start a bit about Bulgaria. [02:17.460 --> 02:25.040] It's a country here in Eastern Europe. It's part of European Union. We have a population of 7 [02:25.040 --> 02:35.960] million people. And it's the size about of Nevada. So what you're seeing here can be safely [02:35.960 --> 02:46.400] transferred like just one state in the U.S. So we have 265 municipalities where they do [02:46.400 --> 02:53.540] different kind of elections. And we have around 12,000 polling stations. [02:54.680 --> 03:01.810] Naturally, we have elections for president, for our national parliament, EU parliament. [03:01.810 --> 03:13.910] Since 2007, we were a member of EU and we have local elections. This year, we already had other [03:14.530 --> 03:21.790] European countries' elections for European parliament. And in just a couple of months, [03:21.790 --> 03:29.990] we'll have local elections, which are way more difficult than others. So let's first start [03:29.990 --> 03:38.870] how we vote now and what are the processes here, how we put there the machine voting. [03:39.290 --> 03:49.570] So generally speaking, you see two ballots. The first one is just majority candidates. This is a [03:49.570 --> 03:56.990] ballot for president, I think. And you have here the party. You have the person, the candidate. [03:56.990 --> 04:07.190] And you just have to scratch with X or V the chosen candidate. On the other part, on the other [04:07.190 --> 04:18.630] side, you have the preferential ballot where you first choose the party. And after that, you give [04:18.630 --> 04:28.270] preference to choosing from your candidate via these circles here. And if the candidate collects [04:28.270 --> 04:43.410] enough votes, he can push and be elected. If this party gets enough results, yeah, and this can go [04:43.410 --> 04:53.550] here. And this generally is a good thing because it allows for another majority, but it's highly [04:56.270 --> 05:06.090] sophisticated and makes non-trivial the processing of the results. So when people vote in the e-day, [05:06.090 --> 05:13.190] in the end, the polling station members can count in the ballots, the paper ballots, and they feel [05:14.210 --> 05:21.270] a polling station protocol with the results. This is how it looks like, just the first pages. [05:22.490 --> 05:33.750] This protocol looks pretty clean, but in reality, we receive this. You see a lot of scratches, a lot [05:33.750 --> 05:43.390] of corrections here, and in the end, you don't know what exactly happened in that section. Of course, [05:44.330 --> 05:53.150] if we are not so sure what happens, they open the bags with the ballots, recount, and et cetera. [05:56.860 --> 06:05.980] So, putting machines in this equation. All voting machines are offline. We don't have [06:05.980 --> 06:15.460] online machines, as in most states, as I understood. When the voter goes in the [06:15.460 --> 06:22.640] polling station, he can decide if we will vote by paper ballot or on the machine. [06:23.340 --> 06:31.880] And after that, they fill the protocol with the results written from the machine on the USB drive. [06:32.480 --> 06:40.180] And this is where it gets really crazy. So, the polling station members have to [06:40.180 --> 06:48.720] send by hand the results from the machine with the results on the paper voting, and they have [06:48.720 --> 06:58.220] to put it on these protocols. After that, all this is transferred from polling station to IT centers [06:58.840 --> 07:08.500] where the data from these paper protocols are entered by operators. In fact, we have [07:08.840 --> 07:18.100] two stages of data entry. On the left, you see where the polling station members go [07:18.810 --> 07:30.420] and go with the USB drives from the machines and with the protocols and give them to operators. [07:30.420 --> 07:37.940] They do first entry. After that, in separate IT center, deployed from different place, [07:37.940 --> 07:44.900] it's reentered again. So, you can catch the eventual discrepancies between those both [07:44.900 --> 07:56.920] databases. This is a lot of hard work, which sometimes happens for about 72 hours. [08:00.690 --> 08:08.890] In the e-voting in Bulgaria, we in Bulgaria very much like and love to do experiments [08:08.890 --> 08:20.510] with different things. So, back in 2009, we have these machines. You can see here the [08:21.330 --> 08:29.410] magnetic stripe card reader, touchscreen, and I don't know why, but they put two UPS devices [08:29.410 --> 08:39.390] because to have power is paramount. So, the good thing was that this happened only in [08:39.390 --> 08:53.270] nine polling stations from, you remember, 12,000. And we didn't have too big problems with this. [08:54.370 --> 09:03.830] After that, we continued with the experiments. And back in 2014, we did it with 100 polling [09:03.830 --> 09:13.410] stations machines, then with 300. And if you can see there, we fall to 50 because from this, [09:13.410 --> 09:21.550] they started to use the results, not just as experiment, but we use the results for real. [09:22.270 --> 09:27.290] This was the machine back then that we're using. [09:29.230 --> 09:36.430] And maybe the important thing here is that Bulgarian government decided not to buy these [09:36.430 --> 09:49.450] machines, but every time we rent it or lend it because they're not so sure who can keep them. [09:49.450 --> 09:58.370] Will they be needed if there is a legislation change because all these were experiments and [09:58.370 --> 10:07.950] et cetera, et cetera. So, from the experiment, what we know with this kind of machines, [10:07.950 --> 10:19.430] the first version were installed with outdated Windows XP. When somebody screamed about that, [10:19.430 --> 10:29.730] it was in 2007. The way that the machine is activated to allow somebody to vote was with, [10:29.730 --> 10:36.750] you see this cable here. On the other end, you have just a button which is [10:38.850 --> 10:48.710] pressed by the polling station officer and the machine unlocks. So, no other way. [10:50.250 --> 10:56.810] The problem here, yes, the machine prints paper slips and you pass these slips here. [10:56.810 --> 11:05.750] So, you have paper edited trail. Of course, we have the slips, but we didn't have the legislation [11:05.750 --> 11:13.490] that requires those slips to be accounted. So, of course, we never counted. But yeah, [11:13.490 --> 11:22.370] we have the trail. There were some issues with missing flash drives and, of course, [11:22.370 --> 11:31.610] very low machine voting usage because generally the campaign had to be in a very narrow [11:32.430 --> 11:42.970] time and nobody understood that if we can use the machines at all. And, of course, [11:42.970 --> 11:48.590] there were some polling stations where the machines were not powered on. [11:51.050 --> 12:02.890] So, in the beginning of 2019, the Central Election Commission tasked me to draft new requirements [12:02.890 --> 12:12.050] for the machines because most of the people understood that this is a problem the way [12:12.050 --> 12:18.130] we're doing it and we have to have something more current against current threats. [12:18.890 --> 12:24.650] So, in the requirements, we put very strict hardware and crypto algorithm requirements. [12:25.490 --> 12:33.230] We put that the machine can't have any external communication interfaces, so the air gap [12:34.510 --> 12:42.830] principle will be kept. We required to have a secure boot so we know that nobody changed [12:42.830 --> 12:51.270] the machine in transit. We required a full disk encryption, of course, against this tampering [12:51.270 --> 13:02.550] again. We put very hard requirements about what should be in the OS image, what drivers, [13:02.550 --> 13:13.550] what components should be stripped. So, we have... I'll get to that [13:15.230 --> 13:18.200] because we're still on the stage of requirements. [13:21.770 --> 13:30.030] After that, the guys who rented the machines have to do a certificate authority [13:30.770 --> 13:39.710] and the own initialization data about the candidates, about the parties must be signed [13:40.610 --> 13:48.050] and the machine have to decline to vote, to refuse to vote on signed data. [13:48.590 --> 13:57.310] And in the end, we have activation with smart cards, two control and three voters [13:58.030 --> 14:07.850] as seen here. So, when the voter decides to vote, he gets one voter card. It can unlock the [14:07.850 --> 14:17.350] machine and vote with it. The vote must be signed on the electronic ballot with this smart card. [14:17.350 --> 14:24.190] After that, he returns this card and the next voter can vote only with one of the first two [14:24.190 --> 14:34.330] cards. So, they rotate and we avoid this interesting button that you saw on the previous [14:34.330 --> 14:46.160] machine. Of course, the usual requirements for Vivipet's slips counting, a very detailed [14:46.160 --> 14:54.020] voting process descriptions that have to be implemented are also in place. [14:54.360 --> 15:03.220] We wanted to see the code and we had requirements about unit tests that have to be [15:04.900 --> 15:14.600] covered, the coverage of testing and etc. All the things that we are doing when we are developing, [15:14.600 --> 15:22.080] trying to develop high quality and secure information systems were in place. [15:24.200 --> 15:33.920] So, what happened? Because those machines were rented again, they came with Ubuntu Linux. [15:37.040 --> 15:46.820] Of course, they were smart card activated with external batteries. Here is the smart card reader [15:47.300 --> 15:56.500] and here is the printout for the results. As you see, it has places for physical clips where [15:57.060 --> 16:00.260] you can clip it with tamper evidence [16:03.540 --> 16:13.220] things and this is how the machine works. The problem that we had here was that nobody [16:13.220 --> 16:22.180] wanted from the government institutions to audit if these machines really adhere to [16:22.180 --> 16:31.540] the requirements. So, the vendor says yes, they are fully compliant by the requirements, [16:32.510 --> 16:35.920] but we didn't have somebody to check that. [16:38.220 --> 16:47.200] But all it was, we were obligated to do and we took the team from Bulgarian Academy of Science and [16:48.560 --> 16:54.920] Sofia University and under the supervision of Central Election Commission, they did some audit, [16:54.920 --> 17:01.600] which is classified. We haven't seen that and they said we are good. [17:05.240 --> 17:13.460] So, what happened? Just several months ago, back in May, [17:13.460 --> 17:17.420] we rented the machines again, this time 3,000 machines. [17:18.960 --> 17:25.780] No audit. The time frame for the project, because of those higher requirements, was very narrow [17:26.820 --> 17:33.280] and it was practically impossible to do the audit in a proper way. [17:35.360 --> 17:40.740] A lot of polling station workers missed the training and didn't know how to work with this [17:40.740 --> 17:50.920] machine. And we went into coordination hell, basically, between different institutions [17:50.920 --> 17:57.280] that have to deal with these machines and their physical and logical protection. [17:59.080 --> 18:08.380] Some statistics. From 23 machines from 3,000, we missed the results data. [18:10.100 --> 18:17.760] Just 26% of the voters used the machines, despite the previous several experiments. [18:25.250 --> 18:38.470] 23% of those who voted. I have to check, but it's not really important how many, 100 or [18:39.010 --> 18:49.190] 1,000. It's just a percentage. Generally, in Bulgaria, we have a high percent of voters' [18:49.190 --> 18:57.990] activity. Of course, it's lower on EU elections, but yeah, it was nothing different from other [18:57.990 --> 19:09.750] ways. So, 5% of the machines weren't used at all, and in 10% of the machines, less than 10 people [19:09.750 --> 19:16.430] voted on the machines. Because, remember, you can choose to vote on the machine or to vote with [19:16.430 --> 19:24.310] paper. So, we detected a lot of human errors because we take the polling station protocol, [19:24.310 --> 19:34.150] and we take the USB data from the machines. And in about 2.6% of the polling stations, [19:34.150 --> 19:43.330] you had more votes received from the machine than summing up from those on the machine [19:43.330 --> 19:52.750] and the paper. I'm not sure if I said it correctly, but this is really a big problem. [19:53.150 --> 20:05.050] From the preferences that you see, we detected errors in about 40%, which is really high. [20:05.050 --> 20:09.830] Why did that happen? You see this paper slip. [20:11.610 --> 20:23.870] It comes around here. So, the polling station officers have to read this and to sum it by hand [20:24.530 --> 20:31.850] with the paper ones and to put it on polling station protocol. And this is very, very error-prone [20:32.540 --> 20:42.270] to us as we saw it. Just for information, the project cost was about 5.1 million [20:43.400 --> 20:52.190] US dollars, which was the lending of the machines and services that were getting received. [20:53.390 --> 21:02.330] The aftermath from this was a very wide political and media debate about [21:04.070 --> 21:11.350] if we should continue with the machine voting. There were a lot of concerns about the security, [21:11.350 --> 21:17.710] the results accuracy, and, of course, the price of this machine voting. [21:18.670 --> 21:27.990] In the meantime of this debate, on 15th of July, it's just a month from today back, [21:27.990 --> 21:35.250] we have the largest up-to-date personal data leak in Bulgaria. Somebody hacked the machine [21:35.250 --> 21:43.570] in our national revenue agency and pulled a lot of personal data of Bulgarian citizens. [21:44.210 --> 21:55.670] Of course, on this debate, it gets a bit negative about machine voting because you can't protect [21:55.670 --> 22:05.110] the national revenue agency, how you will protect the machine voting, etc, etc. And on 3rd of July, [22:05.110 --> 22:13.550] just half a month back, we had the legislation changed. We will not have machine voting [22:13.550 --> 22:20.470] on upcoming local elections, which are to be held in October this year. [22:21.070 --> 22:28.110] But for all other elections after this, we will use only machines [22:30.530 --> 22:37.490] in polling stations with our 200 voters. So, go figure. I really, for myself, [22:37.490 --> 22:40.990] I don't know how this was decided in the end. [22:41.610 --> 22:48.690] But yeah, and that's all. [22:49.530 --> 22:50.550] Yes? [22:50.550 --> 22:56.890] Yeah, so when you had the total votes sum be absurdly large, was that because of double voting [22:56.890 --> 22:58.510] or double counting? [22:59.770 --> 23:01.490] Total votes for... [23:01.490 --> 23:06.010] You had the problem that the total number of votes was more than the ballots plus the machine [23:06.810 --> 23:11.770] thing. So, that was a problem. But was it because something was counted twice? [23:11.770 --> 23:14.570] Or was it because some people were able to vote twice? [23:14.570 --> 23:23.290] No, it's not concerning double voting. There was no double voting. It was just a human error [23:23.290 --> 23:32.330] when you sum the result from this long paper slip with the results from the ballot box. [23:32.850 --> 23:45.550] And they have to write it on this protocol. Those are about 3,200 numbers that you have to sum. [23:45.850 --> 23:49.370] And, of course, humans make mistakes. [23:50.230 --> 23:51.230] Yes? [23:52.410 --> 23:53.790] Please. [23:58.820 --> 23:59.500] Those? [23:59.500 --> 24:06.520] The next few years. You said you're missing results from 23 machines. How many? [24:12.880 --> 24:22.440] Well, those were missing in 23 machines, which means 23 polling stations. In our legislation, [24:22.440 --> 24:30.220] we can't have a polling station with more than 1,000 voters. This is tops. And when I say [24:30.220 --> 24:39.080] missing results, we have a paper protocol from this polling station, which says that there was [24:39.280 --> 24:48.660] a voting there. But for some reason, which can be, they couldn't find the USB flash drive. [24:48.660 --> 24:58.520] The USB flash drive can be read after that. Or some other issues. We just don't have the [24:58.520 --> 25:07.000] data from the machines. But I don't think that for these 23 polling stations, [25:07.340 --> 25:15.320] a lot of people use the machines anyway. Some of those were part of those that were not used at [25:15.320 --> 25:35.000] all. Yes, please. No, there is no EU regulation on using a voting machine. There are some just [25:35.000 --> 25:43.700] very broad requirements about the voting process. But every country in the EU decides by itself [25:44.680 --> 25:54.600] how it will vote and what processes and mechanisms it will have. We have a bit more [25:55.520 --> 26:02.920] complex requirements concerning the EU elections, which are held in all Europe for one week. But [26:03.800 --> 26:08.040] generally, this is up to every country to decide. [26:25.430 --> 26:34.810] Well, we're not sure because there was not any extensive research on that part. And the [26:34.810 --> 26:44.230] politics like to dribble with that if the machine voting is secure or not. Of course, [26:44.230 --> 26:53.410] half of the parties want machine voting, other half say this is fault and we don't have to use [26:53.410 --> 27:03.170] it. So it's different. It's really different. We have some parts of the country where we have [27:03.170 --> 27:13.710] very high usage of the machine voting. So it's not evenly distributed everywhere. But in some [27:13.710 --> 27:37.640] other places, we have really small awareness of that. Yes, please. Well, the requirements says [27:37.640 --> 27:47.720] that we have to have a paper audit trail and all the data that comes on the USB drive from [27:47.720 --> 27:55.200] the machines have to be signed with the smart cards with, of course, the certificate. And the [27:55.200 --> 28:02.980] smart cards have to be transported by different means, not with the machines in conflict, but [28:04.000 --> 28:11.280] from different people, yes, from different teams. All this is in the requirements. But we really [28:11.280 --> 28:19.780] don't know, or at least I don't know, because I haven't been everywhere. And, of course, I haven't [28:20.660 --> 28:27.220] did the audit, and I don't know the audit results. But it's always okay. But [28:29.120 --> 28:35.440] I believe these controls were in place. I hope these controls were in place. [29:17.390 --> 29:19.090] Yeah, always connected. [29:46.490 --> 29:52.930] Okay, people can't vote where they decide. They have to vote in the polling station that [29:53.550 --> 29:59.410] they can vote. And where will be the machines is decided by the Central Election Commission. So [30:00.590 --> 30:08.110] you can choose. And in most cases, you know, you can use the machine when you go to vote, [30:08.110 --> 30:20.150] not before that. This must be done by the polling station members. And maybe not. [30:23.110 --> 30:29.730] Yes, there was a campaign about that. So, okay, sorry, guys. If there are more questions, [30:29.730 --> 30:32.170] I'll be on the back. Thank you very much.