Skip to main content

Python library with a minimal native implementation of Shamir's Secret Sharing algorithm.

Project description

Python library with a minimal native implementation of Shamir’s Secret Sharing algorithm.

PyPI version and link.

Purpose

The library provides functions for computing secret shares given an integer input value, as well as for reassembling an integer from its corresponding shares using Lagrange interpolation over finite fields. The native python random.randint function is used to generate the polynomial when creating shares.

Package Installation and Usage

The package is available on PyPI:

python -m pip install shamirs

The library can be imported in the usual way:

import shamirs

Examples

The library provides functions for splitting a value into a number of shares across a number of parties, and for reassembling those share back into the value they represent:

>>> shares = shamirs.share(5, 3, 17)
>>> shamirs.build(shares, 17)
5
>>> shamirs.build(shamirs.share(123, 12, 15485867), 15485867)
123

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

shamirs-0.1.0.0.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file shamirs-0.1.0.0.tar.gz.

File metadata

  • Download URL: shamirs-0.1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shamirs-0.1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fb14efb4a531af1bcff00dce55120a5cecbba20e68249970bd6cc25f9e58e3f
MD5 949ab9e53a841b14242a50763011dfe9
BLAKE2b-256 14a7785c3274274973b0aa917718d17e5b9b833f2353c9f0aa17b5afde8fc361

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