Use Shamir's Secret Sharing to split keys
Shamir's Secret Sharing splits a secret into n shares, any k of which can reconstruct it. Useful for key escrow, distributed custody, and eliminating single points of failure.
- 1
Shamir's Secret Sharing (SSS) is based on polynomial interpolation over a finite field. To share a secret S with threshold k among n parties: generate a random polynomial f of degree k-1 where f(0) = S. Each party gets f(i) for i = 1..n. Any k shares reconstruct f and thus S; k-1 shares reveal nothing.
- 2 Random Bytes Generator →
Generate the random coefficients for the polynomial. The constant term is the secret; all other coefficients are random. Use a CSPRNG — the security depends on the randomness of the coefficients.
- 3 Modular Exponentiation →
Evaluate the polynomial at distinct points to create shares. Each share is (x, f(x)) where x is the point index. Use Lagrange interpolation to reconstruct the secret from k shares.
- 4
Use cases: splitting an encryption key among multiple trustees (e.g., 3 of 5 required to recover), distributed backup of a master key, social recovery for cryptocurrency wallets. The threshold k determines the trust model — higher k means more parties must cooperate, lower k means faster recovery but less security.
Frequently asked questions
- What is the threshold k?
- k is the minimum number of shares needed to reconstruct the secret. With k=3 and n=5, any 3 of 5 shares can recover the secret, but 2 shares reveal nothing. Choose k based on your trust model: how many parties must cooperate, and how many failures can you tolerate.
- Is SSS information-theoretically secure?
- Yes. With fewer than k shares, every possible secret is equally likely — there is no information leakage regardless of computational power. This is stronger than computational security (e.g., RSA), which could be broken by a quantum computer.
Learn more
Want to understand why?