Shamir's Secret Sharing
This Rust library implements Shamir's Secret Sharing scheme, a cryptographic algorithm that allows you to split a secret into multiple shares, where a specified minimum number of shares are required to reconstruct the original secret.
It is based on the original paper "How to Share a Secret" by Adi Shamir (Communications of the ACM, 1979).
What it does
- Split a secret into
n
shares, where anyk
shares are sufficient to reconstruct the secret - Secure against up to
k-1
compromised shares, as they reveal no information about the secret - Supports very large secrets and primes using the
num_bigint
crate - Includes additional extensions:
BlockScheme
for handling secrets larger than the prime modulus by splitting them into smaller blocks.HierarchicalScheme
enables assigning different numbers of shares to participants based on their role or importance.RefreshableScheme
supports generating entirely new sets of shares for the same secret, without having to redistribute the secret itself. This can be useful for regularly updating shares to maintain security.
Please see the documentation for more details on using these extensions.
Usage
Add this to your Cargo.toml
:
[]
= "0.1.0"
Then, you can use the library like this:
use BigUint;
use Scheme;