thewayne: (Default)
The Wayne ([personal profile] thewayne) wrote2026-03-12 12:43 pm
Entry tags:

Switzerland repeats evote failure of cryptography group in canton election

The Swiss canton of Basel-Stadt had an election. And the election included some evoting, a system being piloted to help people to vote who are living abroad or who are disabled.

Guess what!

THREE USB sticks supplied with decrypt keys failed to work, and 2,048 ballots could not be counted. The ballots are too small a number to affect any results as they represent less than 4% of the votes cast.

Basel-Stadt election officials have delayed announcing election results, and an investigation has been begun.

Gee, if only they'd also written the keys down on CDs or DVDs. Oh, wait! Computers don't have optical media drives anymore. And it's not really best practices to send decrypt keys via email or cloud services.

NEVER EVER EVER treat USB sticks as permanent media! If you copy a file onto one to move it to another computer, copy it off ASAP! They will fail, and at the worst possible moment. I carry a 512 gig USB stick on my key ring, it's very cool with both USB-C and USB-A ends on it: very useful. But if it fails some day - AND I EXPECT IT TO - not a big deal.


Now, let's talk about the number of ballots that can't be decrypted: 2,048. This is a very curious number to report, because it's a very important number in computers: it's a power of two. Computers only know two numbers: zero and one. Everything is based on binary powers of two: 1, 2, 4, 8, etc. 2048 is 2 to the 11th power. It suggests that this may not be a problem with the USB keys, but rather with the encryption software itself. The implication that I got from the Register article was that the USB keys could be read, but the decrypt key didn't work. Keys usually have built-in checksum, which is a mathematical computation that ensures that the info that you're storing hasn't been tampered with. It's just like your credit card numbers: you can instantly verify that it's a valid credit card number (and it's actually a pretty cool formula, you can look it up). You recompute the checksum, preferably comparing it to a second copy, and it tells you if the key has been tampered with. The article didn't go into this detail.

So let's talk about integer overflow! Every piece of information is represented, ultimately, in binary. Am 8-bit binary number - a byte - can hold a maximum value of 255. That's all eight bits turned on: 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128. What happens when you add one to that number? The obvious answer is that it becomes 256, but that can't happen. It's one byte, eight bits. To represent 256, you need nine bits, we only have eight. You now have an overflow situation. Sometimes the byte flips to -255, sometimes the program just flat-out crashes. You can't say with certainty without more information: what language was used, what compiler, etc.

A problem with some computers was that an overflow could cause the program to write into memory that was not supposed to be accessible to it, which could potentially cause a computer crash. The fun stuff was when hackers figured out how to make programs READ memory where they weren't supposed to: this allowed them into areas that the operating system programmers didn't anticipate and allowed the lifting of system passwords and all sorts of fun stuff! But that was in the past, operating systems are somewhat better designed now.

One VERY famous example of integer overflow was the Sid Meier's game Civilization and Nuclear Gandhi. In the game, as in life, Gandhi as a country's leader, was a peaceful guy and not militarily aggressive. In the game's code, there was a hostility counter, which was a small integer, I don't remember how big it was, let's say it was four bits, for a maximum value of 15 (1+2+4+8). 15 was maximum peaceful civilization. -15 was maximum war state, 'gonna nuke your ass' mentality. The programmers forgot to do a bounds check on that variable, and if India was at 15, and something increased it by 1, rather than ignoring the increase since they were already at Nirvana, it overflowed to -15 and they went total rage-monster and started throwing nukes at all their neighbors. Nuclear Gandhi.

Encryption programs are REALLY complicated! With 2048 being a binary power of two, it's quite possible that there is some sort of subtle bug lurking in the encryption code that didn't show in testing that's preventing the decrypt keys from working, and that it's not actually failed USB keys.

But still, my advice holds: do not trust USB keys for permanent - or critical! - storage.

https://www.theregister.com/2026/03/11/swiss_evote_usb_snafu/

https://it.slashdot.org/story/26/03/11/1953224/swiss-e-voting-pilot-cant-count-2048-ballots-after-usb-keys-fail-to-decrypt-them
devilc: (Default)

[personal profile] devilc 2026-03-12 11:23 pm (UTC)(link)
In Humble Pi Matt Parker talks about the overflow errors that you describe here. My favorite was that in Switzerland they had some issues with trains vanishing out of the computer system that tracks them. Obviously a problem, and a potentially fatal one at that.

The issue has to do with the software counting the number of axles on a train. When it hit 256 axles, the train would vanish.

The solution was not to fix the software -- that would cost money! -- but to limit all trains to having 255 or less axles.
warriorsavant: Composite-Warrior Doctor (Composite-Warrior Doctor)

[personal profile] warriorsavant 2026-03-12 11:52 pm (UTC)(link)

Slightly off track, when I was first in the military, we still had C-rations (rations in cans), and there was a small, folding, metal can opener (called a P38) which could go on your dog tag chain. Shortly afterwards, we changed to MRE's, but I still kept the P38 on my dog tags. When USB keys started to be widely used, I then hung one of those on my tags to show I covered both eras.

warriorsavant: Sword & Microscope (Default)

[personal profile] warriorsavant 2026-03-13 02:08 am (UTC)(link)

James Bond fantaisies? (Actually Walther PPK iirr)

garote: (Default)

[personal profile] garote 2026-03-13 09:52 am (UTC)(link)
You also need a “Pew-36 Explosive Space Modulator”!
warriorsavant: Sword & Microscope (Default)

[personal profile] warriorsavant 2026-03-13 01:27 pm (UTC)(link)

You are making me very angry, verrrrry angry indeed.

disneydream06: (Disney Shocked)

[personal profile] disneydream06 2026-03-13 05:47 am (UTC)(link)
Personally I will never support anything but Paper Ballots. :o :o :o
And even then, do you trust the machines doing the counting?
Hugs, Jon
disneydream06: (Disney Scared)

[personal profile] disneydream06 2026-03-13 10:02 am (UTC)(link)
I hope we don't change here. :o

And I know I may be an old fart, but I also don't support Rank Choice voting that's getting pushed here.
Not sure if both Parties are pushing or if it's just the Democrats.
disneydream06: (Disney Shocked)

[personal profile] disneydream06 2026-03-14 07:09 am (UTC)(link)
My main arguement against the Rank Voting is, it's no longer one person one vote, now it's one person 4-5 votes.

I couldn't agree more on the laughable debate system we have.
Currently involves no debate, just talking points and attempting to talk over each other.
disneydream06: (Disney Surprised)

[personal profile] disneydream06 2026-03-14 08:08 am (UTC)(link)
Yeah, I do understand the process, but when I look at it I am seeing multiple votes per person in each election cycle. I know it one for each count.
I guess I would rather vote for my guy and take my chances the correct person wins.
Don't know if I am making sense for anybody but me. LOL..........
silveradept: A kodama with a trombone. The trombone is playing music, even though it is held in a rest position (Default)

[personal profile] silveradept 2026-03-14 05:59 am (UTC)(link)
Oh, dear, something has definitely gone wrong there. That it's a power of 2 suggests that there may be more issues than the USB keys to the system involved, which will hopefully turn up.

I'm still fond of paper ballots, or at least, paper trails of ballots, so that one can be assured that the thing that you input into the machine is what the machine actually tabulated and recorded. A receipt from an e-vote that you could then bring to the in-person space in case of dispute is the best idea if you're going to do entirely electronic voting.

But I also live somewhere that sensibly uses mail-in voting for everyone as their paper option, and that's pretty good, too.