DEV Community

Puneet Khandelwal
Puneet Khandelwal

Posted on

Verifying the Vote: Building a Go CLI for Poll Book Integrity

Trust in an election depends entirely on verifiable data integrity. Last month, I pulled the state-certified electronic poll book export from our county election board public data releases. It was a massive JSON file paired with a cryptographic signature file claiming the data came straight from the secretary of state without tampering. Instead of trusting a dashboard, I opened my terminal, fired up Go, and wrote a hundred lines of code to check the math myself.

Our default state as engineers is skepticism. We reject production deployments without checksums, so we shouldn't accept civic data systems on blind faith either. The state export used a standard ECDSA signature over a SHA-256 hash of the voter registration ledger. The official public key sat on the state portal, buried under three layers of PDF documentation. The real challenge wasn't complex cryptography. It was building a pipeline that ingested the raw export without mutating whitespace or line endings, which ruins the cryptographic hash instantly.

I built a CLI utility that takes the public key, data file, and signature as arguments. Using standard library packages like crypto/ecdsa and crypto/sha256, the script streams the file contents through a hash reader instead of loading the multi-gigabyte dataset entirely into RAM. Memory efficiency matters when dealing with statewide voter files on modest hardware. Within milliseconds, the terminal printed the boolean result of the verification function. It passed. The real value wasn't the green confirmation text. The value was having an auditable, reproducible artifact anyone in the community can run.

Civic tech discussions stay abstract too often. We talk about transparency like it's a philosophical posture rather than an engineering constraint. When citizens rely on proprietary software interfaces locked behind non-disclosure agreements, accountability breaks. Open source tools change that dynamic. They shift verification from a privilege granted by authorities to a right exercised by the public. If a county publishes election records, those records need developer-friendly verification paths out of the box.

Writing this small CLI tool reminded me why I started writing code. Software is our most powerful tool for enforcing truth in complex systems. When we build transparent verification mechanisms for civic infrastructure, we stop complaining and start engineering resilience.

Top comments (0)