Skip to main content

Cryptographic recipes and primitives used in IVXV.

Project description

pyivxv

A Python3 library for common IVXV operations. IVXV is the codename for the current Estonian internet voting system.

This is an independent, 3rd party library. It is not developed or endorsed by the Estonian State Electoral Office. The official IVXV repositories can be found at github.com/valimised.

NB! This library should not be used in production settings, see Security for more details.

You can install pyivxv with:

pip install pyivxv

Usage examples:

from pyivxv.crypto.keys import PublicKey
from pyivxv.encoding.message import decode_from_point

pk = PublicKey.from_public_bytes(b"...")

message = "0000.101"
ct = pk.encode_and_encrypt(message, store_ephemeral=True)

unblinded = ct.unblind(pk.H)
decoded = decode_from_point(unblinded, pk.curve).decode()

print("Message:", message)
print("Encryption randomness:", ct.ephemeral_random)
from pyivxv.crypto.keys import generate_private_key
from pyivxv.crypto.zkp import generate_decryption_proof

sk = generate_private_key()
pk = sk.public_key

message = "0000.101"
ct = pk.encode_and_encrypt(message)
M = sk.decrypt(ct)

proof = generate_decryption_proof(M, ct, sk)
proof.verify(M, ct, pk)

Security

This library is designed for testing and quick scripting, rather than for production use.

This library does not protect against side-channel attacks!

Do not use it to process sensitive data, such as a legitimate vote during an election.
If you do, at a minimum, ensure that no attacker can observe your system during encryption or ciphertext unblinding. This includes, for example:

  • Timing measurements
  • Power consumption measurements
  • RF emissions measurements
  • Running code on the device

Other vulnerabilities may also exist.

Project details


Download files

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

Source Distribution

pyivxv-0.0.1a5.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyivxv-0.0.1a5-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file pyivxv-0.0.1a5.tar.gz.

File metadata

  • Download URL: pyivxv-0.0.1a5.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyivxv-0.0.1a5.tar.gz
Algorithm Hash digest
SHA256 70f1c8a4e43afbe06d7208e0d2f1ab21c5e4467a2d2005404dc161931e89f82d
MD5 a9e5d8cc633d02996acd641be7dbd5fe
BLAKE2b-256 bec92cff17c84ea2e2ed6215f5976dfb99ff6383acee5f6b519bed0a5e880bbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyivxv-0.0.1a5.tar.gz:

Publisher: pypi-publish.yml on takakv/pyivxv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyivxv-0.0.1a5-py3-none-any.whl.

File metadata

  • Download URL: pyivxv-0.0.1a5-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyivxv-0.0.1a5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3fde174feac123d0a19af95c26302841090e21910a54c2e72cccbe9b1dd1d4
MD5 58d062037a11758660edc3bac8495d94
BLAKE2b-256 a6fe4d34d024924fc45252e3af6aabf65e568c57c7cae578431994e3e6250da9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyivxv-0.0.1a5-py3-none-any.whl:

Publisher: pypi-publish.yml on takakv/pyivxv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page