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.11.tar.gz (11.0 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.11-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: threshold_elgamal-0.0.11.tar.gz
  • Upload date:
  • Size: 11.0 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.11.tar.gz
Algorithm Hash digest
SHA256 ae0fe9e38a875de90b93e7a836a3347e23e9663fd66a542f67b8bb43f2bcf612
MD5 96da00951a93ba88bde32373f71756d7
BLAKE2b-256 5eb1b7a6103ee99a84afd44dc1fd49db91e759ae965371289b07e9fd9e65a7d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for threshold_elgamal-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c30051baa35e8a15adb70ab77fb14d32277d4bad8f67250f8b9b1c6d6d62fad0
MD5 295510bc9dc0cc3d608d0783882b6606
BLAKE2b-256 6aea14f07500d7f4a457ee8a340dd073f0a698d593f06d89ade3862901378dd4

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