Python port of Shamir key Split and Combine methods from Hashicorp Vault.
Project description
Description
Python port of Shamir key Split and Combine methods from Hashicorp Vault.
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
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.0.4.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file pyshamir-1.0.4.tar.gz
.
File metadata
- Download URL: pyshamir-1.0.4.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 971fa89a054f351afb3ac788e25c845486ebe0a200ea0d570beec4ca81c73b24 |
|
MD5 | 1456524c26af4fa5b48e7f5de72ecf3c |
|
BLAKE2b-256 | b51b95e9c6f58f54b2a76e6861bf60241eac0001af93b7bbde42290af7511ee3 |
File details
Details for the file pyshamir-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: pyshamir-1.0.4-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69f9ab0277ed1fc7de99a52f5373619efae0355d54ba75d049ea694c463d9bc8 |
|
MD5 | ee8fbeeeffc12d43b1961c9c128e4a06 |
|
BLAKE2b-256 | 2da8615132073ef0cf47a3f8c81786b213ed92e5498b102d871cd87b76adf7e7 |