Shamir's secret sharing implementation. Splitting and joining secrets.
Project description
Shamira
Implements Shamir's secret sharing algorithm. Splits a string or a byte sequence byte-per-byte into n<255 shares, with any k of them sufficient for reconstruction of the original input.
Outputs the shares as hexadecimal, Base32 or Base64 encoded strings.
Installation
From pip
Run pip install shamira.
From the source
Can be run straight from the cloned repository by executing the package with python -m shamira or built with python -m build and installed with pip install dist/shamira*.whl.
Usage
As a CLI application
Run shamira split ... for splitting and shamira join ... for joining the shares back. Appending --help will show you the documentation.
As a library
from shamira import generate, generate_raw, reconstruct, reconstruct_raw
help(function) will show the documentation.
Issue tracker
Please report your issues to https://trac.19x19.cz/shamira/report
Performance
Being written in pure Python, the code is not especially fast. It is therefore recommended to split rather keys to encrypted files than the files themselves.
Benchmark results, as obtained by running shamira benchmark. All values mean seconds per byte of the secret length:
| k / n parameters | Split | Join |
|---|---|---|
| 2 / 3 (a Raspberry Pi 3) | 0.000142 | 0.000448 |
| 2 / 3 (a laptop) | 7.88e-06 | 4.28e-05 |
| 254 / 254 (a Raspberry Pi 3) | 0.0268 | 0.0287 |
| 254 / 254 (a laptop) | 0.00183 | 0.00156 |
License
The code is licensed under GNU GPL v3. If this doesn't fit your needs, reach me and we can negotiate relicensing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shamira-1.0.tar.gz.
File metadata
- Download URL: shamira-1.0.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b823ce54381ada09c70ce8e5bc39e637d67a620f00442bc33a91605562dabfd7
|
|
| MD5 |
e29fa3aaa859b7fb46bbb04294ab99d3
|
|
| BLAKE2b-256 |
7d97084b0bbe140fca79adb95a9fbd0bc2b3d752ede464c8f90d3473acc0087c
|
File details
Details for the file shamira-1.0-py3-none-any.whl.
File metadata
- Download URL: shamira-1.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe85fbc739999b2d0567b8548ee95f646015d697b31f9adca835c23524c1f500
|
|
| MD5 |
f620c72057efbbdbe31fb4d308f3d96f
|
|
| BLAKE2b-256 |
5776ffed095a7762f2913e6af8c8ea53cc6255b5a66acc0a5342e242a08c74eb
|