Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

🗳 ElectionGuard Java

last changed: 03/01/2022

This is a port of to Java.

Also see:

Election Verification

To verify an Election Record:

The full Verification Specification is implemented.

Workflow using Remote Guardians

The following command line programs run the entire workflow needed to run an election:

  1. RemoteKeyCeremony

  2. RemoteKeyCeremonyTrustee

  3. EncryptBallots

  4. AccumulateTally

  5. RemoteDecryption

  6. RemoteDecryptionTrustee

The entire workflow, consisting of the above steps plus verification can be run from a single command:

Election Record


Election Record Visualization

A simple Swing-based visualization of the Election Record. This is a debugging tool for developers, not a polished tool for end-users (eg election officials).

Input Validation

Election manifest, input ballot, and encrypted and decrypted tallies can be validated for consistency by classes in the com.sunya.electionguard.input package. These are complementary to the cyptographic verifications.

Library Use

ElectionGuard-Java is a full port of the ElectionGuard python library, and can be used in your own projects. Contributions here and to the python library are welcome!

Building from source

git clone
cd electionguard-java
./gradlew clean assemble fatJar myJavadocs

The javadocs will be in build/docs/javadoc/index.html. The jars will be in build/libs. Good luck, Jim.

Protobuf definitions

These may be interesting to implement in other libraries:

Python vs Java


  • Assumes Java 17.
  • Most classes are immutable. Builders are used where needed to separate mutable and immutable uses.
  • Uses Java's BigInteger for cryptographic computations.
  • Uses Gson for JSON serialization.
  • Also serializes using protobuf.
  • Use Java record classes instead of @AutoValue
  • Uses Flogger for logging.
  • Uses JUnit5, jqwik, Mockito for testing.
  • Uses gradle 7 for building.


  • Not yet fully compatible with python library JSON serialization
  • Review error logging.
  • Measure computational performance.
  • Investigate parallelization strategies.


A port of electionguard-python to Java.







No packages published