Skip to main content

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

Metadata

Release files for pyshamir 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyshamir 1.1.0
File Size Uploaded
pyshamir-1.1.0.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyshamir 1.1.0
File Interpreter ABI Platform
pyshamir-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / pyshamir-1.1.0.tar.gz

Download URL pyshamir-1.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c99eab3eb50e0c8eca654f776acdf832534b717adb9e0d9127a60a0432c160f5
BLAKE2b-256 checksum
How to use checksums
eadbbffb0ec4de6e0a855b58cde7937b680f06388d86f2fbbb5fdda3b21777ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release files / pyshamir-1.1.0-py3-none-any.whl

Download URL pyshamir-1.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4446174d0d0195f8d4fdd7f972917aeacbff9828f1f97cf89bce58edd8260e1
BLAKE2b-256 checksum
How to use checksums
ac72278e9821cceb4c5d1356a4dac924cdf03515565c12076bc5bc680c36e3fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page