Stickybit.← NotebookPortuguêsNote · voting machine and cryptography · Oct 5, 2026 ·
Note

The voting machine at 30: what 2026 cryptography would add.

Brazil's voting machine turns thirty as a system of custody and digital signatures, not of cryptography over the vote. It works, and that is not what this note is about. It is about three things our work this year would add, each with a number we measured: a receipt that cannot buy a vote, an audit that counts the result instead of testing the machine, and the post-quantum signature that does not fit the QR code on the tally.

Specimen · one precinct tally and the signature its QR carries
–QRs for the tally, in the TSE format
–QRs for the signature alone, as bytes (hypothesis)
–signature characters
–verify 563,910 tallies (8 cores)

Our measurement, October 5, 2026, in Go, on an ordinary eight-core computer, corrected on October 6 against the official manual for the tally's QR code (TSE, 2024): each QR carries at most 1,100 alphanumeric characters, the limit of the machine's thermal printer, of which about 166 are header and chaining hash. A fictional municipal tally with 5 candidates for mayor and 150 for the council: 1,947 characters in the manual's key:value format. Today's QR signature is Ed25519, with one key per state published by the TSE; the hardware signature on the result files is a 521-bit curve. Both share the same fragility against a quantum computer.

Before the argument

Four words for this page.

Precinct tally (BU)

One polling station's result, printed at the end of the day: registered voters, turnout, votes per candidate, blank and spoiled. Since 2015 it carries a QR code; five copies are printed, and one is posted on the station's door.

Digital vote record (RDV)

The table where the machine writes each vote into a randomly drawn row, in the clear, with nothing linking it to the voter. It is the "shuffle" that protects secrecy. It stays inside the machine.

Digital signature

A mathematical seal that only the machine's private key can produce and anyone can check. It is everywhere: on the software the machine agrees to run, on the ceremony's hash table, on the tally. Today it is of a kind a large quantum computer would forge.

Receipt

What the voter takes home. Today, nothing. The electoral court argues that a readable paper buys votes and coerces. It is right about paper: a receipt that proves without revealing is a different object.

The intuition

Custody and signatures, not cryptography over the vote.

Reading what the electoral court describes, the machine's security is a chain of custody (the machine has no network, the software is compiled and sealed in a public ceremony, the media travels by hand) and of digital signatures (the system only executes what is signed, the embedded security module holds the key, the tally leaves signed and the server discards whatever fails the check). The vote itself is never encrypted: it is written in the clear into a drawn row.

That explains why homomorphic encryption, which we sum with and sell for other elections, does not belong in the court's machine. Summing encrypted tallies solves a problem the central count does not have: it already sees only per-station aggregates, signed and public. We say this before any hook, so as not to sell a solution without a problem.

What the chain leaves open are three points, all recorded by the court itself as design choices: the voter takes no proof home; the audit tests sampled machines, not the result; and all the trust rests on signatures of a kind that already has a date to become forgeable. Those three are where the 2026 work fits.

inside the machine · no network Confirm RDV · drawn rowvote in the clear signed tally + QR media, by hand central countchecks the signature five printed copies,one on the station door the voter leaves with nothing
Nothing is encrypted: the vote sits in the clear in a drawn row, and everything that leaves the machine leaves signed. The trust is in custody and in the key.
Hook one

The receipt that cannot buy a vote.

The court's argument against a paper receipt is correct: a readable paper becomes proof for whoever buys or coerces. What voting cryptography offers is a different object. The vote is encrypted at the moment of Confirm; the receipt is the fingerprint of the encrypted vote, published on a chained public board; alongside goes a proof that the content is a valid vote, without saying which. The voter checks at home that the receipt is on the board. They cannot show anyone whom they voted for, because the receipt does not say.

We made this work end to end in our lab: one credential per voter ID, receipt, chained board, proof of a valid vote, and opening of the result only by a group of custodians, three of five. The RDV already shuffles by drawing a row, but in the clear and inside the same machine. The receipt gives the voter the individual verification that today exists only collectively, through the tally.

The limit, stated plainly: receipt and proof do not zero out coercion if the voter can prove the content to a third party. The design mitigates, it does not eliminate. And it is exactly what we sell where there is no electoral court: unions, assemblies and boards, where today the alternative is somebody's spreadsheet.

encrypted vote receipt = hash public boardchained proof: it is valid voter, at home "is my receipt there?" proof without revealing
The receipt proves the vote went in and does not say which vote it was. It is the receipt that paper cannot be.
Hook two

Audit the result, not the machine.

The machine's audit tests machines: a batch is drawn, known ballots are cast on them, and the count is checked. It is a good equipment audit. It is not a result audit: it does not say, with a declared risk, that the proclaimed winner is the winner. The court itself calls that check a sample, and it is.

There is a family of audits designed for the other question, the risk-limiting audits: records are drawn until the chance of certifying a wrong result falls below a chosen limit. We measured two in our lab, in a simulated election with a tight 1% margin. The one that only counts ballots needed 65,415; the one that compares each drawn ballot with the machine's record needed 629, one hundred and four times fewer. At a declared 5% risk, the wrongful certification we observed was 0.43% and 1.40%, under the limit.

The condition is having a record independent of the machine to compare against. In the Brazilian machine, by design, it does not exist per voter: the tally on the station door is the only independent copy, and it is per station. This is where hook one feeds hook two: the receipt published on the board is exactly the record a comparison audit needs, with no paper in anyone's hand.

1% margin · declared risk 5% count only 65,415 records · wrongful certification 0.43% compare with the machine's record 629 records · wrongful certification 1.40% 104 times fewer, if there is something to compare
Our measurement in a simulated election. The cheap audit needs a record independent of the machine. The voting machine has none per voter; the receipt from hook one would be that record.
Hook three

The 2028 signature does not fit the QR code.

Everything in the machine is a digital signature: the software it agrees to run, the ceremony's hash table, the security module's certificate, the tally. More than four million certificates have been issued by the electoral court's certificate authority. According to the independent verifier that reads the court's public files, the machine's hardware key is a 521-bit elliptic curve. It is strong today and it is in the family Shor's algorithm breaks. For signatures the risk is not "record now, open later"; it is that any archived tally becomes forgeable retroactively, and the comparison of door tally against portal loses its anchor.

The UE2028 model is being specified now, and a machine serves ten years: the 2015 model still votes in 2026. So we asked the most concrete question we could: if the tally were signed with the post-quantum standard, would it still fit the QR code the court's app reads? We built a municipal tally in the QR's text format and signed it with six algorithms.

SignatureBytesCharacters, in hexQRs for the tally (1,100 characters each)QRs for the signature aloneVerify 563,910 tallies, 8 cores
Ed25519 (today's QR)641283111.2 s
ECDSA P-25672144319.6 s
RSA-2048256512314.7 s
ML-DSA-44 (post-quantum, level 2)2,4204,840864.9 s
ML-DSA-65 (post-quantum, level 3)3,3096,6181087.3 s
ML-DSA-87 (post-quantum, level 5)4,6279,25412109.1 s

Fictional municipal tally of 1,947 characters, 5 candidates for mayor and 150 for the council, in the key:value format of the TSE manual. Each QR carries 1,100 characters, about 934 of them usable after the header and the hash; the manual says large tallies already reach four QRs today. With the current signature the fictional tally takes three. With ML-DSA-65, ten: the signature alone is eight. The hypothesis of printing the signature as raw bytes, in symbols of the same size, gives four QRs for ML-DSA-44 and five for ML-DSA-65, because the limit is the printer, not the QR standard. The time is verification on an ordinary computer for every machine in the country: the migration costs size, not time.

The signature envelope the machine writes already has an algorithm field with three values: RSA, elliptic curve, and the armed forces' research centre's own algorithm. Adding the post-quantum standard to the envelope is a small change. The QR is not: either the tally goes from three to ten symbols printed on thermal paper, or the signature goes in separate QRs, or the app fetches the signature from the portal and the QR carries only the tally and its fingerprint. Any of the three is a specification decision for the UE2028, and it has to be made before buying the machine, not after. It is what we describe in post-quantum identity for devices and in the quantum computer's clock.

What to do

Three decisions that belong in the specification, not on election day.

  1. Give the UE2028 a security module that can switch algorithms.

    The envelope already has the field. What is missing is hardware that signs in ML-DSA and in elliptic curve at the same time during the transition, and a court certificate authority that issues hybrid certificates. Bought without that, the module is classical until 2038.

  2. Decide where the large signature goes on the tally.

    Ten QRs in sequence, separate QRs for the signature alone, or the QR carrying only the tally and its fingerprint while the signature sits on the portal. Each choice changes the app citizens use. Measuring first, as we did above, costs an afternoon.

  3. Publish a record that lets the result be audited.

    Without an independent record per voter, the risk-limiting audit is expensive or impossible. The cryptographic receipt published on a chained board is that record, with no paper. It is the only one of the three decisions that changes the voter's experience, and therefore the slowest.

What we are not saying

Where this may be wrong.

We do not say the machine is insecure

There is no proven fraud in thirty years, and the custody-and-signature chain is a serious design. The three hooks touch windows the court itself describes as choices, not flaws.

The tally is fictional, the format is not

We use the key:value format and the 1,100-character-per-QR limit from the TSE's official manual (2024 edition), but the tally is invented, with 150 council candidates. Real sections range from one to four QRs today. The number of QRs changes with the tally; the size of the signature, which dominates the count, does not.

The cheap audit needs what the machine lacks

The 629 records hold for an election with an independent record per voter. Without it, the number does not apply to today's machine. We present the cost to show the size of the gain, not as something the court could do tomorrow.

The quantum clock is a thesis, not a date

That elliptic-curve signatures are breakable by a large quantum computer is a fact. When that computer exists is our estimate, and it may be wrong in either direction. The machine's argument does not depend on the date: it depends on the machine serving ten years.

Talk

Does this apply to your case?

If you run elections outside the electoral court, in a union, a cooperative, a board or an assembly, tell us in two lines how many people vote and who needs to trust the result. The first conversation is to see whether a receipt that cannot buy a vote solves it, and, if your spreadsheet is already enough, we say so.

Talk on WhatsApp algorithms@stickybit.com.br Stickybit · Porto Alegre, since 2004

← Research notebook · Locked data (FHE) · Post-quantum · stickybit.com.br

Sources