Skip to main content

Helios Server (Helios is an end-to-end verifiable voting system) as library

Project description

The Helios Lib

This is Helios-Server (Helios is an end-to-end verifiable voting system.) as library,

This helios_lib version is completely independent of Django.


>>> pip install helios_lib


>>> pytest --fulltrace -s helios_lib/


from helios_lib.models import HeliosElection, HeliosVoter
from helios_lib.config import ELGAMAL_PARAMS

# Create election
helios_election = HeliosElection()

# Add trustee
trustee_default = helios_election.generate_helios_trustee(ELGAMAL_PARAMS)

# Add questions
question = HeliosElection.create_question(answers_count=5, minimum=0, maximum=2, result_type='relative')
helios_election.questions = [question]

# Add voters
voters_count = 4
helios_election.voters = [HeliosVoter() for _ in range(voters_count)]

# Freeze the election

# Cast votes, Encrypt votes of voters on the helios_lib side
helios_election.voters[0].vote = helios_election.encrypt_ballot('[[0,4]]')
helios_election.voters[1].vote = helios_election.encrypt_ballot('[[0]]')
helios_election.voters[2].vote = helios_election.encrypt_ballot('[[1]]')
helios_election.voters[3].vote = helios_election.encrypt_ballot('[[1,4]]')

# Verify votes of voters
for v in helios_election.voters:

# Tally election
helios_election.num_cast_votes = 4
helios_trustee = helios_election.get_helios_trustee()

# Result of election
assert helios_election.result == [[2, 2, 0, 0, 2]]

For more complex example refer to tests

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for helios-lib, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size helios_lib-0.0.1-py2-none-any.whl (55.7 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size helios_lib-0.0.1.tar.gz (46.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page