Usar Shamir's Secret Sharing a dividir claves
Shamir's Secret Sharing splits un secret en n shares, any k de que puede reconstruct it. Useful para clave escrow, distributed custody, y eliminating single points de 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 Generador de bytes aleatorios →
Generar 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 Exponenciación modular →
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.
Preguntas frecuentes
- 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.
- ¿Es SSS information-theoretically seguro?
- 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.