Skip to main content

Python port of Shamir key Split and Combine methods from Hashicorp Vault.

Project description

pyshamir banner

Description

Python port of Shamir key Split and Combine methods from Hashicorp Vault.

Requirements

  • Python 3.9 or higher

Installation

pip install pyshamir 

Usage

Split & Combine

from pyshamir import split, combine
import secrets

# generate a random secret, here secret is a 32 bytes
secret = secrets.token_bytes(32)

# set the number of shares; i.e. the number of parts to split the secret into
num_of_shares = 5

# threshold is minimum number of keys required to get back the secret
threshold = 3

# split to get a list of bytearrays which can be combined later to get back the secret
parts = split(secret, num_of_shares, threshold)

# Now, the parts be combined to get back the secret
recomb_secret = combine(parts)

References

  1. Shamir Secret Sharing | Wikipedia
  2. Go Implementation | HashiCorp Vault

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

pyshamir-1.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

pyshamir-1.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file pyshamir-1.1.0.tar.gz.

File metadata

  • Download URL: pyshamir-1.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyshamir-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c99eab3eb50e0c8eca654f776acdf832534b717adb9e0d9127a60a0432c160f5
MD5 738a55fc26a3c022b627c01671d42ba5
BLAKE2b-256 eadbbffb0ec4de6e0a855b58cde7937b680f06388d86f2fbbb5fdda3b21777ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyshamir-1.1.0.tar.gz:

Publisher: release.yml on konidev20/pyshamir

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

File details

Details for the file pyshamir-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyshamir-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyshamir-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4446174d0d0195f8d4fdd7f972917aeacbff9828f1f97cf89bce58edd8260e1
MD5 b34055da9d2bb4ddc7e6b52cdd97b526
BLAKE2b-256 ac72278e9821cceb4c5d1356a4dac924cdf03515565c12076bc5bc680c36e3fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyshamir-1.1.0-py3-none-any.whl:

Publisher: release.yml on konidev20/pyshamir

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