Skip to main content

Threshold ElGamal cryptosystem.

Project description

Threshold ElGamal cryptosystem

Library that provides functions for encryption, decrpytion and DKG algorithm using the ElGamal cryptosystem.

Installation

pip install threshold-elgamal

Getting started

The simplest way you can test out this library is by running its main function:

from threshold_elgamal import run_tc_scheme

res = run_tc_scheme(3, 5, m=10)
if res is True:
    print("Success!")

You can also create your own threshold scheme manually, and then encrypt and decrypt a message of your choosing:

from threshold_elgamal import create_tc_scheme

public_key, players, scheme = create_tc_scheme(3, 5)
c1, c2 = scheme.encrypt(public_key, message=10)
decryption_shares = {player.id: player.get_decryption_share(c1) for player in players}
decrypted_msg = scheme.decrypt(c2, decryption_shares)

if decrypted_msg == 10:
    print("Success!")

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

threshold_elgamal-0.0.10.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

threshold_elgamal-0.0.10-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file threshold_elgamal-0.0.10.tar.gz.

File metadata

  • Download URL: threshold_elgamal-0.0.10.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.0

File hashes

Hashes for threshold_elgamal-0.0.10.tar.gz
Algorithm Hash digest
SHA256 582beb5178cde2002e12932ab336838daef7cfa6b7d278688e2a129ee31eab87
MD5 860d79442c4391abb84fbcbfb973c258
BLAKE2b-256 ba715435af6d3e2f2f46cb4b36a087fa4b251aa4a1826ff3edc8b83902dfc729

See more details on using hashes here.

File details

Details for the file threshold_elgamal-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for threshold_elgamal-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ac5edc85df64a8d835a0c7d78af26daeb0e97d656e8cccf812eb572f7c55f4
MD5 da578b49a4385e671e703e5849693447
BLAKE2b-256 0a27ef8f8bfe1e20fdc81fc6503b222a3473ba5b027935d189ca139e913af51e

See more details on using hashes here.

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