โ† Wiki Index / Computation & Algorithms / Shamir's Secret Sharing
๐Ÿ’ป Computation & Algorithms

Shamir's Secret Sharing

Shamir's Secret Sharing is an information-theoretically secure (k, n) threshold cryptographic scheme introduced by Adi Shamir in 1979 that encodes a secret as the constant term of a random degree-(k - 1) polynomial over a finite field so that any k shares reconstruct the secret via Lagrange interpolation while k - 1 shares reveal zero information.

Shamir's Secret Sharing (SSS) is a foundational (k, n) threshold cryptographic scheme in computation and algorithms that divides a secret S into n distinct cryptographic shares s1, s2, ..., sn such that any subset of k or more shares can deterministically reconstruct S, whereas any subset of k โˆ’ 1 or fewer shares reveals zero Shannon entropy information about S. Published by Israeli cryptographer Adi Shamir (co-inventor of the RSA cryptosystem) in 1979โ€”simultaneously with and independently of George Blakley's hyperplane-intersection threshold schemeโ€”Shamir's construction relies on the fundamental algebraic theorem that k points with distinct horizontal coordinates uniquely determine a polynomial of degree at most k โˆ’ 1 over a finite field.

Within computational complexity theory and modern cryptography, storing a root cryptographic private key on a single machine creates a single point of compromise (if stolen) and a single point of failure (if destroyed), whereas replicating the same key across n servers multiplies the attack surface by n. Shamir's (k, n) threshold scheme resolves both hazards simultaneously with unconditional information-theoretic security: even an adversary with unbounded quantum computing power who compromises k โˆ’ 1 custodians faces a uniform prior over every candidate secret Sโ€ฒ โˆˆ GF(q). Furthermore, because polynomial evaluation is a linear homomorphism, Shamir's Secret Sharing forms the mathematical core of secure multiparty computation (BGW protocol), threshold digital signatures, and zero-knowledge proof protocols.

Polynomial Construction Over Finite Fields and Lagrange Reconstruction

Share Generation via Random Degree-(k โˆ’ 1) Polynomials

Let GF(q) be a finite field of order q > n, where in practice q is chosen either as a prime p > max(S, n) (arithmetic modulo p) or as the binary extension field GF(28) or GF(2128) for byte-aligned implementation. To split a secret S โˆˆ GF(q) among n participants with reconstruction threshold k (1 โ‰ค k โ‰ค n < q):

  1. Constant-Term Secret Embedding: Set the constant coefficient a0 of a degree-(k โˆ’ 1) polynomial f(x) โˆˆ GF(q)[x] equal to the secret:
a0 = S = f(0)
  1. Uniform Random Higher-Order Coefficients: Sample k โˆ’ 1 coefficients a1, a2, ..., akโˆ’1 independently and uniformly at random from GF(q) using a cryptographically secure random number generator, defining the secret polynomial:
f(x) = a0 + a1 x + a2 x2 + ... + akโˆ’1 xkโˆ’1 (mod q)
  1. Evaluation at Non-Zero Public Abscissas: Assign each participant i โˆˆ {1, 2, ..., n} a distinct, non-zero public field element xi โˆˆ GF(q) \ {0} (commonly xi = i when q = p is prime) and distribute the point pair:
si = (xi, yi) where yi = f(xi) โˆˆ GF(q)

Evaluating f(xi) via Horner's rule (f(x) = a0 + x(a1 + x(a2 + ...))) requires k โˆ’ 1 field multiplications and k โˆ’ 1 field additions per share. Crucially, the evaluation coordinate x = 0 must never be assigned to any participant, because f(0) = a0 = S would expose the raw secret in a single share.

Secret Reconstruction via Lagrange Polynomial Interpolation

Given any subset of k distinct shares {(xj1, yj1), (xj2, yj2), ..., (xjk, yjk)}, there exists a unique polynomial f(x) โˆˆ GF(q)[x] of degree โ‰ค k โˆ’ 1 passing through all k points:

f(x) = โˆ‘m=1..k yjm ยท โ„“m(x) (mod q)

where โ„“m(x) is the m-th Lagrange basis polynomial, satisfying โ„“m(xjm) = 1 and โ„“m(xjr) = 0 for all r โ‰  m. Because only the constant term S = f(0) is required to recover the secret, one evaluates the Lagrange basis directly at x = 0:

โ„“m(0) = โˆ1โ‰คrโ‰คk, rโ‰ m ( (0 โˆ’ xjr) / (xjm โˆ’ xjr) ) = โˆ1โ‰คrโ‰คk, rโ‰ m ( xjr / (xjr โˆ’ xjm) ) (mod q)

where division in GF(q) is multiplication by the modular multiplicative inverse (xjr โˆ’ xjm)โˆ’1 mod q (computed via the Extended Euclidean Algorithm in O(log q) time). The secret S is then a linear combination of the k share values yjm:

S = f(0) = โˆ‘m=1..k yjm ยท โ„“m(0) (mod q)

Information-Theoretic Security Proof and Vandermonde Invertibility

Perfect Secrecy Against k โˆ’ 1 Colluding Parties

Suppose an adversary holds k โˆ’ 1 distinct shares (x1, y1), ..., (xkโˆ’1, ykโˆ’1). For any hypothesized candidate secret Sโ€ฒ โˆˆ GF(q) at x0 = 0, augmenting the k โˆ’ 1 known points with the k-th point (0, Sโ€ฒ) yields a system of k linear equations in the k unknown coefficients (a0, a1, ..., akโˆ’1):

  • Row 0 (at x = 0): 1 ยท a0 + 0 ยท a1 + ... + 0 ยท akโˆ’1 = Sโ€ฒ
  • Row i (for i = 1 .. k โˆ’ 1): 1 ยท a0 + xi a1 + xi2 a2 + ... + xikโˆ’1 akโˆ’1 = yi

The coefficient matrix V of this k ร— k system is a Vandermonde matrix over the k distinct abscissas {0, x1, ..., xkโˆ’1}, whose determinant is rigorously non-zero in GF(q):

det(V) = โˆ0โ‰คu<vโ‰คkโˆ’1 (xv โˆ’ xu) โ‰  0 (mod q)

Because V is invertible over GF(q), every candidate secret Sโ€ฒ โˆˆ GF(q) corresponds to one unique choice of the random coefficients (a1, ..., akโˆ’1) โˆˆ GF(q)kโˆ’1, which was chosen with uniform probability 1 / qkโˆ’1. Thus, conditioned on k โˆ’ 1 shares, every Sโ€ฒ โˆˆ GF(q) remains equally likely with posterior probability Pr[S = Sโ€ฒ | s1, ..., skโˆ’1] = 1/q = Pr[S = Sโ€ฒ], achieving Claude Shannon's criterion for perfect secrecy (H(S | s1, ..., skโˆ’1) = H(S)) on par with the one-time pad.

Secret Sharing / Threshold SchemeShare Size per ParticipantSecurity GuaranteeVerifiable Against Malicious Shares?Linearly Homomorphic?Primary Cryptographic Application
XOR (n, n) Additive SharingS(1.0ร— secret size)Information-theoretic (k = n only)NoYes (โŠ• addition)Two-party MPC, hardware HSM split keys
Blakley's (1979) Geometric Schemek ร—S(kร— expansion)Information-theoreticNoYes (affine planes)Historical threshold geometry
Shamir's (k, n) Scheme (1979)**S(Ideal 1.0ร— secret size)**Information-theoretic (Perfect)No (requires VSS or MAC)Yes (+, scalar ร—, degree-2 ร—)Root CA ceremonies, BGW MPC, SLIP-0039
Feldman's VSS (1987)S+ k group elementsComputational (S hidden if DLog hard)Yes (gf(xi) = โˆ (gaj)xij)Distributed Key Generation (DKG), threshold ECDSA/BLS
Pedersen's VSS (1991)2 ร—S(f(x) and r(x))Information-theoretic hidingYes (Computational binding)Zero-knowledge proof commitments, threshold Schnorr

Homomorphic Properties, Verifiable Secret Sharing (VSS), and Proactive Refresh

Additive Homomorphism, BGW Multiplication, and Proactive Secret Sharing

Because polynomial evaluation and Lagrange interpolation are linear operators over GF(q), if two secrets S1 = f(0) and S2 = g(0) are shared using degree-(k โˆ’ 1) polynomials at the same participant abscissas xi, then each participant i can compute a share of the linear combination ฮฑS1 + ฮฒS2 locally without communication:

h(xi) = ฮฑ f(xi) + ฮฒ g(xi) โ‡’ h(0) = ฮฑ S1 + ฮฒ S2

In the Ben-Orโ€“Goldwasserโ€“Wigderson (BGW, 1988) multiparty computation protocol, two shared secrets S1 and S2 can even be multiplied when 2k โˆ’ 1 โ‰ค n: multiplying local shares f(xi) ยท g(xi) produces points on a degree-(2k โˆ’ 2) polynomial (f ยท g)(x) with constant term S1 ยท S2, followed by a single round of Gennaroโ€“Rabinโ€“Rabin degree-reduction resharing back to degree k โˆ’ 1.

Furthermore, Herzberg, Jarecki, Krawczyk, and Yung (1995) introduced Proactive Secret Sharing: participants periodically generate a random degree-(k โˆ’ 1) polynomial ฮด(x) with zero constant term (ฮด(0) = 0) and add ฮด(xi) to their existing shares (siโ€ฒ = f(xi) + ฮด(xi)). The updated shares still interpolate to f(0) + ฮด(0) = S, but old shares captured by an attacker in previous epochs become algebraically incompatible with new shares.

Verifiable Secret Sharing (Feldman and Pedersen VSS)

In standard Shamir's Secret Sharing, a malicious Byzantine fault dealer could distribute inconsistent shares that do not lie on a single degree-(k โˆ’ 1) polynomial, or a malicious participant could submit a forged share yiโ€ฒ during reconstruction (shifting the interpolated secret by (yiโ€ฒ โˆ’ yi) โ„“i(0)). Feldman's Verifiable Secret Sharing (1987) solves both attacks by having the dealer broadcast commitments Cj = gaj mod P in a cyclic group where the discrete logarithm problem (as in Diffieโ€“Hellman key exchange and elliptic-curve cryptography) is hard, allowing every participant i to verify its share yi via:

gyi โ‰ก โˆj=0..kโˆ’1 (Cj)(xij) (mod P)

Conversely, viewing the n evaluations (f(x1), ..., f(xn)) of a degree-(k โˆ’ 1) polynomial as a codeword of a Reedโ€“Solomon error-correcting code of length n and dimension k allows the Berlekampโ€“Welch algorithm to detect up to n โˆ’ k corrupted shares and correct up to โŒŠ(n โˆ’ k)/2โŒ‹ malicious shares automatically.

Frequently Asked Questions

Why is it fatal to implement Shamir's Secret Sharing over ordinary integers instead of a finite field GF(q)?

If the polynomial f(x) = S + a1 x + ... + akโˆ’1 xkโˆ’1 is evaluated over ordinary integers โ„ or โ„ค without modular reduction in a finite field GF(q), even a single share (x1, f(x1)) leaks modular information about S because f(x1) โ‰ก S (mod x1), and the magnitude of f(xi) leaks bounds on the coefficients. Modular arithmetic in a prime field GF(p) or binary Galois field GF(2m) ensures that a1 x1 mod q is a uniform one-time pad over the entire field for every x1 โ‰  0.

Can the threshold k or the number of participants n be changed without reconstructing the secret in one place?

Yes. New shares sn+1 = (xn+1, f(xn+1)) can be issued to new participants by having k existing shareholders compute masked partial Lagrange contributions toward f(xn+1), and the threshold k can be raised or lowered via multiparty polynomial resharing without any single party ever learning S = f(0).

References

  1. Shamir, A. (1979). "How to share a secret." Communications of the ACM, 22(11), 612โ€“613. https://doi.org/10.1145/359168.359176
  2. Blakley, G. R. (1979). "Safeguarding cryptographic keys." Proceedings of the 1979 AFIPS National Computer Conference, Vol. 48, 313โ€“317. https://doi.org/10.1109/AFIPS.1979.98
  3. Feldman, P. (1987). "A practical scheme for non-interactive verifiable secret sharing." Proceedings of the 28th Annual Symposium on Foundations of Computer Science (FOCS 1987), 427โ€“438. https://doi.org/10.1109/SFCS.1987.4
  4. Ben-Or, M., Goldwasser, S., & Wigderson, A. (1988). "Completeness theorems for non-cryptographic fault-tolerant distributed computation." Proceedings of the 20th Annual ACM Symposium on Theory of Computing (STOC '88), 1โ€“10. https://doi.org/10.1145/62212.62213
  5. Pedersen, T. P. (1991). "Non-interactive and information-theoretic secure verifiable secret sharing." Advances in Cryptology โ€” CRYPTO '91, LNCS Vol. 576, 129โ€“140. https://doi.org/10.1007/3-540-46766-1_9
๐Ÿงฌ Support Open Science
Explore interactive science games on LowKey Games or browse scientific apparel & accessories in the CRV Science Shop.
๐Ÿ’ก Spot an inaccuracy or have primary literature to expand this article?
Submit a citation or revision note using your shared CRV Science / LowKey Games profile ID.
Suggest Revision