How ElectionGuard works technically · Scrutalis
Solution — technical details

How Scrutalis works, technically

A complete technical reference, with the equations and section numbers of the ElectionGuard 2.0 specification: encryption, zero-knowledge proofs, threshold key sharing, ballot chaining. No simplification that would hide a real limitation.

Scrutalis implements ElectionGuard 2.0 (Microsoft Research): a 4096-bit multiplicative group Z_p with a 256-bit prime order Q (spec §3.1.1), exponential ElGamal encryption, Chaum-Pedersen zero-knowledge proofs, threshold key sharing following Pedersen’s scheme (guardians and quorum), and the ballot chaining of spec §3.4 for end-to-end verifiability. The hash function H used throughout is HMAC-SHA-256 as a random oracle (spec §2.0.0, eq. 105).

Ballot encryption — exponential ElGamal

Every possible answer to a question (not only the one chosen) is encrypted under the joint public key K: Enc(m, ξ) = (g^ξ mod p, K^(ξ+m) mod p) — spec 2.0.0, eq. 24 — with m ∈ {0, 1} and ξ a random nonce drawn from Z_q.

Systematically encrypting every possible answer, and not only the selected one, is necessary: if only the chosen answer produced a ciphertext, merely knowing which answer was encrypted would reveal the choice. This encryption runs exclusively in the voter’s browser, never on the server.

Zero-knowledge proofs — Chaum-Pedersen

Each ciphertext comes with a disjunctive Chaum-Pedersen proof establishing that it encodes a value in the valid range (0 or 1), without revealing which. A second proof, known as the “aggregate proof”, covers the homomorphic sum of the ciphertexts of a single question: it guarantees that the total number of selected answers respects the question’s limit (a single answer for a single-choice question), which a per-answer proof cannot guarantee alone — several answers could each individually prove 0 or 1 without their sum being valid.

The two families of proofs are domain-separated (two distinct one-byte constants in the hash computation) so that a proof of one can never be replayed as a proof of the other. Anyone can verify these proofs, without knowing the vote or any secret.

Homomorphic tallying

ElGamal ciphertexts are additively homomorphic: adding up the ciphertexts of the same answer across all ballots produces a single ciphertext of the total, without ever decrypting an individual ballot. Only one decryption is needed per possible answer, when the vote closes, never while it is open.

Key sharing and threshold decryption (Pedersen)

Each guardian is assigned a random polynomial of degree (quorum − 1) (key ceremony, spec §3.2). The joint public key is the product of the constant terms of every polynomial; each guardian’s secret share is the sum of the values of all the polynomials evaluated at that guardian’s own index (Shamir secret sharing). Decryption combines the partial decryptions of a quorum of guardians, each weighted by its Lagrange coefficient (evaluated at x = 0) for the subset of guardians actually present — any subset whose size equals the quorum works, not a predetermined one.

Distributed generation (CNIL 3-04): each guardian draws their own polynomial in their browser. They publish the commitments to its coefficients and their Schnorr proofs, and, for each guardian, the value of their polynomial at that guardian’s index, encrypted for that recipient’s key alone. The server checks the proofs and computes the joint key without knowing any secret. At the count, each guardian rebuilds their share in their browser, checks it against the public commitments and sends only their partial decryptions, each with a Chaum-Pedersen proof that the server checks before combining them. The decryption key therefore never exists in full, neither on a Scrutalis server nor anywhere else.

Ballot chaining and confirmation codes (spec §3.4)

Each encrypted ballot produces a cryptographic hash of its content (the answer/pad/data triples of each ciphertext, sorted so as never to depend on submission order), then a confirmation code that chains this hash to that of the previous ballot: H(Bi) = H(H_E ; χ_Bi, H(Bi−1)), the first ballot of a referendum chaining from a starting value derived from the vote’s extended base hash (H_E).

This confirmation code is given to the voter on their receipt, and the complete chain of a referendum is published (without ever linking a code to the voter’s identity) on the public verification page. Anyone can independently recompute the whole chain from the published hashes and check that it matches what is published — and that their own code is in it: this is what makes it possible to detect that a ballot was inserted, removed or reordered after the fact.

An acknowledged adaptation of the spec: ElectionGuard normally chains one hash per question and then a global ballot hash; Scrutalis has no intermediate “per question” step and directly hashes the sorted set of the ballot’s ciphertexts — cryptographically equivalent for the property sought (any change to an answer, or to the answer a ciphertext is associated with, changes this hash).

Audit log

A mechanism distinct from the ballot chaining above: every administrative action (creating, opening or closing a referendum, etc.) is recorded in a SHA-256 hash-chained log, partitioned by organisation. Altering or deleting a past entry breaks the chain detectably. This log never contains the content of a vote — only the fact that an action took place.

References

Scrutalis does not reinvent home-made cryptography. ElectionGuard is an open protocol published by Microsoft Research, and the threshold encryption mechanism it uses builds on peer-reviewed academic work published since the 1980s.

Four academic publications, the direct origin of the mechanisms described on this page:

A technical question about our implementation?

Our team can talk directly with your IT department or your independent expert.