How Not to Secure Your E-Voting system

Sarah Jamie Lewis (executive director · opening privacy Research Society)

Swiss Cyber Storm 2019 · Day 1 · Main

Overview

In this compelling talk from Swiss Cyber Storm 2019, Sarah Jamie Lewis, Executive Director of the Open Privacy Research Society, dissects the catastrophic security flaws discovered in the Swiss Post and Seidel e-voting system. Titled "How Not to Secure Your E-Voting System," the presentation chronicles a journey from an initial tweet about the system's source code to the eventual uncovering of fundamental cryptographic vulnerabilities that led to the temporary halt and eventual abandonment of Switzerland's e-voting trials. Lewis, along with collaborators Vanessa Teague and Olivier Pereira, demonstrates how a seemingly state-of-the-art system, despite academic review, harbored critical implementation errors that undermined its core security guarantees.

Watch on YouTube

Visual summary for How Not to Secure Your E-Voting system by Sarah Jamie Lewis
Visual summary for How Not to Secure Your E-Voting system by Sarah Jamie Lewis

Key moments

  1. 0:00 Introduction to Swiss E-voting system analysis
  2. 2:00 Seidel's initial dismissal and motivation to investigate
  3. 4:30 First critical flaw: missing check in 'all proof'
  4. 7:00 Second major flaw: non-random generators enable vote manipulation
  5. 12:50 Third major flaw: weak Fiat-Shamir in decryption proofs
  6. 16:50 Broken Individual Verifiability halts Swiss e-voting system
  7. 20:30 Key takeaway: Public infrastructure demands public scrutiny
  8. 23:00 Q&A: E-voting complexity and future outlook

How Not to Secure Your E-Voting system

Speakers: Sarah Jamie Lewis, Executive Director, Open Privacy Research Society

Conference: Swiss Cyber Storm

YouTube: https://www.youtube.com/watch?v=RWUFTIFUKL0

Overview

In this compelling talk from Swiss Cyber Storm 2019, Sarah Jamie Lewis, Executive Director of the Open Privacy Research Society, dissects the catastrophic security flaws discovered in the Swiss Post and Seidel e-voting system. Titled "How Not to Secure Your E-Voting System," the presentation chronicles a journey from an initial tweet about the system's source code to the eventual uncovering of fundamental cryptographic vulnerabilities that led to the temporary halt and eventual abandonment of Switzerland's e-voting trials. Lewis, along with collaborators Vanessa Teague and Olivier Pereira, demonstrates how a seemingly state-of-the-art system, despite academic review, harbored critical implementation errors that undermined its core security guarantees.

The talk highlights the profound disconnect between theoretical cryptographic design and its practical, real-world implementation. Lewis meticulously details how every zero-knowledge proof within the Seidel system was found to be broken, enabling malicious actors—whether administrators, software providers, or external attackers—to manipulate votes while simultaneously generating proofs that would falsely confirm the integrity of the election. This exposé served as a stark warning about the inherent complexities and extreme risks associated with deploying e-voting systems without rigorous, transparent, and public scrutiny of both their mathematical foundations and their source code.

The significance of this research extends far beyond the Swiss borders, impacting similar e-voting deployments in Australia and underscoring a universal truth: democratic infrastructure demands the highest standards of transparency and security. Lewis champions the necessity of open-source systems, comprehensive public audits, and the willingness of authorities to subject their critical infrastructure to relentless, independent scrutiny. The findings presented not only exposed specific technical failures but also ignited broader discussions about the feasibility and wisdom of e-voting in its current form, advocating for the principle of "cutting the power" when systems are demonstrably insecure.

Background

▶ Watch: Introduction to Swiss E-voting system analysis (0:00)

The journey into the vulnerabilities of the Swiss Post e-voting system began in February 2019, when Sarah Jamie Lewis stumbled upon a tweet regarding the system's source code, which was part of a "bug bounty" trial. Her initial review of the code immediately raised numerous "red flags," prompting her to voice concerns on Twitter. This attracted the attention of other cryptographers, including Matt Green, who connected her with Vanessa Teague and Olivier Pereira, who had independently identified similar issues. The situation escalated when Swiss Post and Seidel, the company behind the e-voting system, issued a press statement dismissing the criticisms as "misunderstandings related to the cryptographic mechanisms." This dismissal, rather than de-escalating the situation, motivated Lewis and her collaborators to conduct a deeper, more rigorous analysis of the codebase.

The problem of securing e-voting systems is inherently complex, far exceeding the challenges of online banking due to the unique requirements of privacy, anonymity, verifiability, and resistance to coercion. Unlike traditional paper-based elections where physical observation provides a layer of trust, e-voting relies entirely on software and cryptographic protocols to ensure integrity. A critical concept in e-voting is Universal Verifiability, which dictates that anyone should be able to determine that all ballots in the system have been correctly counted. Another crucial property is Individual Verifiability, ensuring that any voter can confirm their own ballot was cast and counted as intended. Prior work in e-voting often focused on the theoretical soundness of cryptographic schemes, but the Swiss Post case vividly illustrated that even academically reviewed mathematics could be undermined by flawed implementation. The Seidel system, like many modern e-voting solutions, heavily relied on zero-knowledge proofs to achieve these verifiability properties, allowing a prover (Peggy) to convince a verifier (Vicki) of a statement's truth without revealing the underlying secret. The core problem uncovered was that these fundamental cryptographic building blocks, upon which the entire system's integrity rested, were critically broken in their implementation.

Key Findings

▶ Watch: First critical flaw: missing check in 'all proof' (4:30)

The research team uncovered a series of critical cryptographic vulnerabilities that fundamentally compromised the integrity and verifiability of the Swiss Post and Seidel e-voting system. These findings directly contradicted Seidel's initial claims and demonstrated a profound failure in the system's security:

  • Broken All Proof: The first vulnerability discovered was in the system's "all proof," a zero-knowledge proof designed to show that an encrypted value belongs to a predefined set (e.g., a vote for candidate A or B). The implementation was missing a crucial check on the challenge value, allowing an attacker (Alice in the analogy) to encrypt any arbitrary value and have it accepted as valid by the verifier (Peggy). This meant a vote could be manipulated at the point of encryption.
  • Mixnet Trapdoor (Shuffle Proof Vulnerability): The most severe finding was a "trapdoor" in the shuffle proof, which is part of the mixnet responsible for anonymizing votes by shuffling and re-encrypting them. The cryptographic generators used to build commitments in this proof were not truly random but were derived from known exponents. This allowed a malicious administrator or software provider to manipulate votes within the mixnet—for example, changing four distinct votes into four votes for a single candidate—while still producing a valid proof that would pass verification, making the manipulation undetectable. This directly broke Universal Verifiability.
  • Weak Fiat-Shamir Decryption Proofs: The system's decryption proofs, designed to show that an encrypted ballot was correctly decrypted, suffered from a weak Fiat-Shamir transform. Instead of hashing all relevant protocol data to generate a random challenge, only a limited set of public parameters were included. This gave an attacker (Peggy) sufficient control over the inputs to manipulate the hash function, enabling them to generate a valid-looking proof for a completely different ciphertext, or even for a ciphertext that decrypted to "garbage" results instead of a valid vote.
  • Broken Individual Verifiability: A direct consequence of the weak decryption proofs was the complete breakdown of Individual Verifiability. A malicious actor on the front end (e.g., Swiss Post itself, or a hacker controlling a browser extension) could provide a voter with a "claim check" that would appear to verify their vote was cast correctly. However, due to the decryption proof vulnerability, the actual vote counted in the system could be garbage, or manipulated.
  • Unused Vulnerable Code: The "all proof" was present in the codebase despite not being specified in the Swiss Post system's documentation. Seidel confirmed this was due to the system being built as a large library not designed to be modular, leading to the inclusion of vulnerable, unused code paths.
  • System-Wide Impact: These vulnerabilities collectively meant that every zero-knowledge proof in the Seidel system was broken. The findings led to the temporary cessation of e-voting trials in Switzerland for the May 19th federal elections and eventually to Swiss Post abandoning their old system entirely, shifting focus to a new one. The same vulnerabilities were also found in the Seidel codebase used in New South Wales, Australia, though officials claimed an "air-gap" protected them, a claim Lewis strongly refutes given the nature of the attack.

Technical Deep Dive

▶ Watch: Third major flaw: weak Fiat-Shamir in decryption proofs (12:50)

The core of the Swiss Post e-voting system's security relied heavily on zero-knowledge proofs (ZKPs) to ensure verifiability. A ZKP allows a party, the prover (Peggy), to convince another party, the verifier (Vicki), that a statement is true without revealing any information beyond the truth of the statement itself. In e-voting, ZKPs are crucial for tasks like proving a vote is validly encrypted or that a mixnet correctly shuffles votes without revealing individual ballot identities. Lewis and her team found that every instance of these ZKPs in the Seidel system was flawed.

The first issue identified was with the all proof, intended to demonstrate that an encrypted value corresponds to one of a set of allowed values (e.g., a 'yes' or 'no' vote). In theory, this proof involves specific mathematical checks, including how the prover interprets a challenge from the verifier. The Seidel implementation, however, was missing a critical check on the challenge value (specifically, c = c_0 + c_1 in the theoretical math, where a final check on c was absent in practice). This omission allowed an attacker to encrypt any value they desired, and the flawed proof mechanism would still validate it as correct. This meant that a ballot could be cast for an invalid option, or even an arbitrary value, and still pass the initial verification.

A more profound vulnerability resided within the mixnet, a crucial component for ensuring voter anonymity. The mixnet takes a set of encrypted votes, shuffles them, and re-encrypts them, making it impossible to link an original vote to its shuffled counterpart. To prove the mixnet operated honestly, a shuffle proof is used. This proof relies on the prover (the mixnet operator) committing to certain values using cryptographic generators. These generators must be truly random and their underlying mathematical relationship to the group must be unknown to prevent manipulation. However, in the Seidel system, these generators were created by taking a random exponent and using it to derive the generator (g_i = g^x_i). This meant that the mixnet operator knew the discrete logarithm relationship between the base generator g and the generated g_i. This knowledge created a "trapdoor." The operator could then open their commitments to any desired value, effectively allowing them to replace original votes with manipulated ones during the shuffling process. Lewis provided an example where four distinct votes (1, 2, 3, 4) could be transformed into four identical votes (3, 3, 3, 3) for a specific candidate, while the shuffle proof would still pass verification, making the electoral fraud completely undetectable. This directly undermined the Universal Verifiability of the system.

Following the mixnet, votes are decrypted. To ensure this process is honest without revealing the decryption key to a verifier, decryption proofs are employed. The Seidel system utilized a variant of the Fiat-Shamir transform to generate these proofs. In a secure Fiat-Shamir scheme, a challenge value is derived by cryptographically hashing all relevant parameters of the protocol (e.g., public keys, ciphertexts, random elements). This ensures that the challenge is unpredictable and cannot be manipulated by the prover. The Seidel implementation, however, suffered from a weak Fiat-Shamir construction. It only hashed a limited subset of public parameters (public key, ciphertext, a couple of random elements that Peggy controlled), critically omitting other vital contextual data. This allowed a malicious actor (Peggy) to manipulate the inputs to the hash function, thus controlling the challenge and enabling them to generate a valid-looking proof for a completely different ciphertext-plaintext pair. This meant an attacker could claim to have correctly decrypted a vote, even if they had decrypted it to "garbage" or a different value, and the system would accept their fraudulent proof. This vulnerability directly broke the Individual Verifiability property, as a voter's claim check, relying on these compromised decryption proofs, would falsely confirm their vote was correctly counted.

The cumulative effect of these vulnerabilities was that the fundamental cryptographic assurances of the Swiss Post e-voting system were entirely invalid. The system could neither guarantee that votes were cast as intended nor that they were counted correctly, all while providing fraudulent cryptographic proofs that everything was operating securely.

Demo / Proof of Concept

▶ Watch: Broken Individual Verifiability halts Swiss e-voting system (16:50)

While the talk did not feature a live, interactive "demo" in the traditional sense of executing code on stage, Sarah Jamie Lewis effectively demonstrated the vulnerabilities through clear, illustrative examples and direct references to the mathematical derivations. For each core vulnerability—the "all proof" error, the mixnet "trapdoor," and the weak Fiat-Shamir decryption proofs—Lewis presented the theoretical mathematical protocol alongside the flawed implementation.

For instance, in explaining the "all proof" issue, she visually highlighted the missing mathematical check in the Seidel implementation compared to the correct theoretical protocol. Similarly, for the mixnet "trapdoor," she used a concrete example of vote manipulation: transforming four distinct votes (1, 2, 3, 4) into four votes for a single candidate (3, 3, 3, 3) and explained how the known relationship of the cryptographic generators allowed this undetectable fraud. The mechanism for this, as she explained, was that Peggy could "open the commitments to any value she desired," akin to a magician manipulating an envelope's contents.

The weak Fiat-Shamir decryption proof was also illustrated by showing how the limited inputs to the hash function (hash(public_key, ciphertext, random_elements)) gave the attacker sufficient control to generate a new, valid-looking proof for a different ciphertext. These explanations, often accompanied by simplified diagrams of cryptographic interactions between Peggy and Vicki, served as the functional equivalent of a proof of concept, demonstrating how the attacks could be executed and why they would succeed, without needing to run actual code on stage. The detailed mathematical underpinnings and attack scenarios are further elaborated in the research papers Lewis co-authored, including "How Not to Prove Your Election System" and its addendum.

Defensive Implications

▶ Watch: Q&A: E-voting complexity and future outlook (23:00)

The findings from the Swiss Post e-voting system offer profound lessons for developers, auditors, and policymakers involved in critical infrastructure, particularly in sensitive areas like elections. The primary defensive implication is the absolute necessity of public scrutiny and transparency for any system handling public infrastructure. Lewis emphasizes that "public infrastructure demands public scrutiny," which extends far beyond merely releasing source code under a non-disclosure agreement. It requires open audit reports, full disclosure of methodologies, and a willingness to subject the entire system—from design to implementation—to continuous, independent review by the global security community.

A crucial takeaway is the distinction between mathematical soundness and implementation correctness. Seidel's system had purportedly been reviewed by academics for its cryptographic design. However, as Lewis points out, "when you implement math in source code, you have all the issues that come along with source code." Defenders must understand that even perfectly designed cryptographic protocols can be rendered utterly insecure by subtle implementation errors, such as missing checks, incorrect generator generation, or insufficient input hashing. Therefore, security assessments must encompass not just theoretical cryptographic strength but also meticulous code audits and penetration testing by experts with deep cryptographic knowledge.

Organizations deploying such systems must adopt an adversarial mindset. The fact that three academics, "operating on little to no sleep," could identify three major cryptographic vulnerabilities—breaking every zero-knowledge proof in the system—should serve as a stark warning. If independent researchers can find such critical flaws, well-resourced nation-state actors or highly motivated groups will undoubtedly find avenues for exploitation, whether through direct technical attacks or other means like bribery. This necessitates robust security architectures that anticipate and mitigate sophisticated threats.

Furthermore, transparency must be comprehensive. This means not just publishing summaries of audit reports but the full, unredacted reports. It also means transparent communication during incident response, in stark contrast to the initial dismissive statement from Seidel. The emergency patch to the Australian system during an election, without public acknowledgment in post-election audit reports, exemplifies the kind of non-transparency that erodes public trust and hinders learning from mistakes.

Finally, the most radical but perhaps most important defensive implication is to "cut the power" when systems are demonstrably insecure. Lewis's strong recommendation against using such flawed systems underscores that the risks to democratic integrity far outweigh the perceived convenience or modernity of e-voting if security cannot be guaranteed. Until cryptographic e-voting systems can be proven robust, transparent, and resilient against sophisticated attacks, relying on them introduces unacceptable risks to the fabric of society. Defenders should advocate for simpler, more verifiable, and auditable election methods until the technology and its implementation mature to a truly secure state.

Key Takeaways

  • E-voting is Exceptionally Complex: Securing e-voting systems is inherently more challenging than online banking or other critical applications, demanding the highest level of cryptographic rigor and implementation quality.
  • All Zero-Knowledge Proofs Were Broken: Every single zero-knowledge proof in the Swiss Post/Seidel e-voting system was found to be fundamentally flawed, undermining both individual and universal verifiability.
  • Implementation Flaws Undermine Cryptographic Design: Even theoretically sound cryptographic protocols can be rendered useless by subtle implementation errors, such as non-random cryptographic generator creation or insufficient data hashing in Fiat-Shamir transforms.
  • Public Scrutiny is Non-Negotiable: Critical public infrastructure, especially democratic systems, requires complete transparency, including open source code, full unredacted audit reports, and a willingness to subject the system to rigorous independent review without NDAs.
  • The Threat is Real and Accessible: If a small team of academics can find such profound vulnerabilities, well-resourced and malicious actors will undoubtedly exploit similar weaknesses in real-world deployments.
  • "Cut the Power" on Insecure Systems: When a system critical to democratic processes is demonstrably insecure and untrustworthy, the most responsible action is to halt its deployment and reconsider its use until security can be unequivocally guaranteed.

About the Speaker(s)

Sarah Jamie Lewis is the Executive Director at the Open Privacy Research Society, a non-profit organization based in Vancouver dedicated to working with marginalized communities to enhance privacy and safety. Her career path is diverse, starting as a computer scientist for the British government, then transitioning to a security role at Amazon, before moving into her current leadership position in non-profit research. Lewis is a prominent voice in the cryptography and security community, particularly known for her critical analysis of e-voting systems and her advocacy for transparency and robust security in digital infrastructure. Her work, often conducted with collaborators like Vanessa Teague and Olivier Pereira, focuses on making complex security issues accessible and actionable, especially when they impact fundamental rights like privacy and democratic integrity.

Reviews

Dr. Zero (Offensive Security Researcher) — MUST SEE

Sarah Jamie Lewis, Vanessa Teague, and Olivier Pereira absolutely dismantled the Swiss Post e-voting system. They broke every single zero-knowledge proof in the Seidel codebase. This is required viewing for anyone who still thinks you can buy election integrity from a vendor.

Heather Calloway (CISO) — STRONG ACCEPT

This is required viewing for anyone who owns third-party risk or procurement. Lewis completely dismantles a vendor's "academically reviewed" cryptographic system, proving that theoretically sound math means nothing if the implementation is garbage.

→ Top-rated talks at Swiss Cyber Storm 2019

All talks from Swiss Cyber Storm 2019