Live data from Hacker News

Swiss evoting system – IsProbablePrime is incorrect for input 19

gitlab.com

21–30 of 49 posts

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#21

For context: Switzerland doesn't have evoting. This is just some big company trying to re-sell a evoting system to the government. It has been in the news a few times, due to software and cryptographic quality issues.

It's a state owned company so it is kinda selling to itself.

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#22
post #19
post #15

Earlier quoted context omitted.

https://www.evoting.ch/en Do the bare minimum research before posting please.

That's exactly the company and the product. You could've scrolled a bit more: https://www.evoting.ch/en#transparenz Voting in Switzerland is either in person or by mail.

>Swiss Post has been providing an e-voting system for the cantons since 2016. It has been developing its new system with complete verifiability at its IT site in Neuchâtel since 2020, providing an e-voting system from Switzerland.

https://www.post.ch/en/business-solutions/e-voting?shortcut=...

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#23

For context: Switzerland doesn't have evoting. This is just some big company trying to re-sell a evoting system to the government. It has been in the news a few times, due to software and cryptographic quality issues.

> Switzerland doesn't have evoting.

And given what they show off, they should abstain from it for the next 1000 years.

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#24
post #11

Earlier quoted context omitted.

Well, unfortunately they do plan to relaunch their e-voting system next year, after having "tested their system against more than 60'000 attacks from hackers" (whatever that is supposed to mean)... https://www.srf.ch/news/schweiz/elektronische-stimmabgabe-ha... https://www.heise.de/news/Schweizer-Post-Hacker-konnten-E-Vo...

Hm, but it sounds quite solid(I only know, what is written in the links): They made an open public intrusion test with a bug bounty and they released the sources. And so far no one could find a real weakness.

How many nation-states burned their best zero-days on this public intrusion test?

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#25
post #3

Can someone explain how such a simple and easily-testable bug existed in a seemingly-important system like this? I don't know much about Swiss e-voting, but seems even the most brain-dead unit test of the IsProbablePrime function should have caught this.

Im not sure if really the simplest test would catch it. You would need to go over n primes and check them, but you might always finish too early. There is also a question of impact - i think that 19 does not really cause any harm there.

> You would need to go over n primes and check them, but you might always finish too early.

I mean sure, but it's pretty simple to at least enumerate the primes < 100 and test those...

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#26

For context: Switzerland doesn't have evoting. This is just some big company trying to re-sell a evoting system to the government. It has been in the news a few times, due to software and cryptographic quality issues.

Well, I'm swiss and evoting at least twice a year... https://www.eda.admin.ch/eda/en/fdfa/living-abroad/schweizer...

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#27
post #10
post #3

Can someone explain how such a simple and easily-testable bug existed in a seemingly-important system like this? I don't know much about Swiss e-voting, but seems even the most brain-dead unit test of the IsProbablePrime function should have caught this.

It's not really easily testable, because the bug is in pseudocode which cannot be executed.

I must be missing some context, then. It's unclear to me how pseudocode would be used in e-voting?

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#28

For context: Switzerland doesn't have evoting. This is just some big company trying to re-sell a evoting system to the government. It has been in the news a few times, due to software and cryptographic quality issues.

> Switzerland doesn't have evoting.

Looks like they had it in varying number of areas from 2003 to 2019. Then all systems were withdrawn due to security concerns.

https://en.wikipedia.org/wiki/Electronic_voting_in_Switzerla...

https://www.ch.ch/en/votes-and-elections/e-voting/#revision-...

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#29
post #2

Relevant code (from https://gitlab.com/swisspost-evoting/crypto-primitives/crypt... ): 𝑠𝑝 ← 8530092 ▷ I.e. 0b100000100010100010101100: for all primes 𝑝 ≤ 23, TestBit(𝑠𝑝, 𝑝) = true if 𝑛 ≤ 23 then ▷ Quick check for small values, simpler and faster than testing equality on each option return TestBit(𝑠𝑝, 𝑛) end if if ¬TestBit(𝑛, 0) then return ⊥ ▷ I.e. 𝑛 is even and, as per line 2, 𝑛 > 2 thus composite end i…

Let me repeat if I understand it right:

* The function will return True for all primes.

* The function will return False if the number is detected as a composite by some tests.

* The function can return True or False for all other numbers.

* For numbers* The bit for number 19 is wrong. It returns false for a prime number which violates "return True for all prime numbers".

This is indeed quite shoddy programming for such an essential and easily testable piece of software.

Re: Swiss evoting system – IsProbablePrime is incorrect for input 19

#30
post #26

For context: Switzerland doesn't have evoting. This is just some big company trying to re-sell a evoting system to the government. It has been in the news a few times, due to software and cryptographic quality issues.

Well, I'm swiss and evoting at least twice a year... https://www.eda.admin.ch/eda/en/fdfa/living-abroad/schweizer...

and you are living abroad?
Post reply on HN