This is a comprehensive question about Shamir's Secret Sharing (SSS) and its mathematical foundation. Let me break this down into parts:
- Explain Shamir's secret sharing
- Explain Lagrange interpolation
- Show how they work together
- Prove that k points uniquely determine a degree k-1 polynomial
Let me organize this properly.
Shamir's Secret Sharing
The basic idea is:
- You have a secret S that you want to share among n people
- The secret can only be recovered if at least k people (the threshold) cooperate
- Any k-1 or fewer people cannot recover the secret
- This is achieved using polynomial interpolation over finite fields
The Mathematical Foundation
Polynomial Construction
-
Choose a degree k-1 polynomial over a finite field (usually GF(p)):
f(x) = a₀ + a₁x + a₂x² + ... + a_{k-1}x^{k-1}
where a₀ = S (the secret)
and a₁, a₂, ..., a_{k-1} are random coefficients
-
Calculate n shares:
sᵢ = f(i) for i = 1, 2, ..., n
Give share sᵢ to person i
-
To recover the secret:
- Collect any k shares: (x₁, y₁), (x₂, y₂), ..., (x_k, y_k) where yᵢ = f(xᵢ)
- Use Lagrange interpolation to reconstruct f(x)
- The constant term f(0) = S is the secret
Why This Works
- With k points: You can uniquely determine a degree k-1 polynomial
- With k-1 points: Many polynomials pass through k-1 points with the same constant term
- When you have k-1 points, there's a one-parameter family of degree k-1 polynomials satisfying those constraints. Since you have k coefficients but only k-1 equations, infinitely many solutions exist, making every possible secret value equally plausible.
Lagrange Interpolation
Given k points (x₁, y₁), (x₂, y₂), ..., (x_k, y_k) with distinct xᵢ, there exists a unique polynomial of degree at most k-1 passing through all of them.
f(x) = Σᵢ₌₁ᵏ yᵢ · Lᵢ(x)
where Lᵢ(x) = ∏_{j=1, j≠i}^k (x - xⱼ)/(xᵢ - xⱼ)
Proof that k points uniquely determine degree k-1 polynomial
Theorem: Given k distinct points (x₁, y₁), (x₂, y₂), ..., (x_k, y_k), there exists a unique polynomial of degree at most k-1 that passes through all these points.
Proof:
-
Existence: Lagrange interpolation constructs such a polynomial explicitly.
-
Uniqueness: If two polynomials p(x) and q(x) of degree at most k-1 both pass through all k points, then their difference r(x) = p(x) - q(x) has degree at most k-1 and vanishes at all k points. A nonzero polynomial of degree at most k-1 can have at most k-1 roots, so r(x) must be identically zero, meaning p(x) = q(x).
-
Application to SSS:
- With k shares: The k points uniquely determine the degree k-1 polynomial, so the secret S = f(0) is uniquely determined.
- With k-1 shares: Only k-1 points exist, but infinitely many degree k-1 polynomials pass through them, leaving the secret undetermined.
From an information-theoretic standpoint, any possible value of f(0) appears equally plausible to an adversary holding k-1 shares. The system presents k-1 linear equations in k unknowns (the polynomial coefficients), creating a one-dimensional solution space that reveals nothing about the secret.
Consider a concrete example with n=5, k=3 in GF(17). If the secret is 7, I construct a degree-2 polynomial f(x) = 7 + 3x + 5x². Computing the shares at x = 1,2,3,4,5 gives (1,15), (2,16), (3,10), (4,14), (5,11) respectively. With just three shares like (1,15), (2,16), (3,10), Lagrange interpolation recovers the original polynomial and thus the secret.
Setting up the basis polynomials: L₁(0) = 3, L₂(0) = 3, L₃(0) = 1 (after computing the products and divisions). Evaluating at x=0 yields f(0) = 15·3 + 16·3 + 10·1 = 45 + 48 + 10 = 103 ≡ 3 (mod 17). But this should equal 7, so something's off in my calculation—I need to recheck the Lagrange basis coefficients.
Actually, recalculating more carefully: L₂(0) = -3 ≡ 14 (mod 17), not 3. So f(0) = 15·3 + 16·14 + 10·1 = 45 + 224 + 10 = 279 ≡ 7 (mod 17). That matches.
Shamir's Secret Sharing with Lagrange Interpolation
Overview
Shamir's Secret Sharing (SSS) enables secure distribution of a secret among n participants such that any k cooperating participants can recover it, but any group of k-1 or fewer learns nothing.
The SSS Scheme
Setup
- Secret: S (an integer)
- Threshold: k (minimum people needed to recover S)
- Shares: n (total people)
- Field: GF(p) where p is prime (or any finite field)
Distribution Phase
Step 1: Construct a random degree k-1 polynomial:
f(x)=a0+a1
where:
- a0=S (the secret is the constant term)
- a1,a are random coefficients chosen from GF(p)
Step 2: Generate n shares:
si=f(i)(modp)for i=
Give share si to participant i (keep pairs (i,si) secret).
Recovery Phase
Any k participants pool shares (x1,y1),(x where .
Using Lagrange interpolation, reconstruct f(x), then evaluate f(0)=S.
Lagrange Interpolation
Given k points with distinct x-coordinates, the unique degree ≤ k-1 polynomial is:
f(x)=∑i=1kyi
where the Lagrange basis polynomials are:
Li(x)=∏j=1,j
Evaluating at x = 0 (Secret Recovery)
S=f(0)=∑i=1ky
where:
Li(0)=∏j=
All arithmetic is performed modulo p.
Proof: k Points Uniquely Determine Degree k-1 Polynomial
Theorem: Given k distinct points (x1,y1),…,(x, there exists a polynomial of degree at most satisfying for all .
Proof
Uniqueness (the key result):
Suppose two polynomials p(x) and q(x) both have degree ≤ k-1 and pass through all k points.
Define their difference:
r(x)=p(x)−q(x)
Properties of r:
- deg(r)≤k−1 (difference of degree ≤ k-1 polynomials)
- r(x for all
Conclusion: r(x) has k distinct roots: x1,x2,…,.
But a non-zero polynomial of degree ≤ k-1 can have at most k-1 roots (Fundamental Theorem of Algebra).
Since r(x) has k roots and degree ≤ k-1, we must have:
r(x)≡0⟹p(x)=q(x)
Therefore, the polynomial is unique. ✓
Existence: Lagrange interpolation explicitly constructs such a polynomial.
Why k-1 Shares Don't Reveal the Secret
With k-1 shares, an adversary sees k-1 equations:
f(x1)=y1
But they have k unknowns (the coefficients a0,a1,…,ak−1).
Result:
- System is underdetermined (more unknowns than equations)
- One-parameter family of solutions exists
- Every possible value of S=a0 is consistent with the observed shares
- Information-theoretic security: adversary gains zero information about S
Worked Example
Parameters: n=5, k=3, working in GF(17), secret S=7
Polynomial: f(x)=7+3x+5x2
Shares:
Recovery with shares (1,15), (2,16), (3,10):
L1(0)=(1−2)(1−3)
L2(0)=
L3(0)=(3−1)(3−2)
S=15(3)+16(14)+10(1)(mod17)
✓
Security Summary
| Scenario | Shares | Information about S |
|---|
| Adversary has k | Complete | 1 bit: the secret itself |
| Adversary has k-1 | Incomplete | 0 bits: uniform distribution |
| Any fewer | Much less | 0 bits |
The mathematical foundation is solid: polynomial interpolation provides information-theoretic security.