Vol. I · No. 1 — A working specimen
Threshold cryptography · since 1979

Shamir's Secret Sharing

k of n · polynomial interpolation · GF(2⁸) & GF(p) shareable via URL hash · runs locally · no server

A secret split into n pieces, such that any k of them can rebuild it — and any k−1 reveal nothing at all. Adi Shamir's 1979 trick exploits a small algebraic fact: a polynomial of degree k−1 is pinned down by exactly k points. Fewer points, and the polynomial could be anything — including the one that hides any secret you can imagine.

Encode a secret

Operates byte-wise over GF(2⁸) — any UTF-8 string works
How the encoding works

For each byte s of the secret, we build a polynomial f(x) = s + a₁x + a₂x² + … + a_{k−1}x^{k−1} with random coefficients drawn from crypto.getRandomValues, all over GF(2⁸) with the AES irreducible polynomial 0x11b. Share i is the pair (i, f(i)). Reconstruction is Lagrange interpolation evaluated at x = 0.

Resulting shares

Each share is hex: 2 hex chars = 1 byte index · rest = ciphered bytes
Generate shares to see them here.

Recover the secret

Paste any k shares (one per line). Order does not matter.
Awaiting shares.
What if I supply the wrong shares?

Shamir's scheme has no built-in integrity check. Any k pairs (x, y) will produce some reconstructed bytes — they just won't be your secret if the points came from different polynomials. In production you'd pair each share with an HMAC or use a scheme like SLIP-0039 that bakes in checksums.

See the polynomial

A toy version over GF(p) — small prime, small integer secret — so we can actually plot it.
Hit "Re-roll polynomial" to render.

Prove perfect secrecy

Use only k−1 shares. Watch: every candidate secret in your range fits some valid polynomial through those points.

This is the unforgeable property of Shamir's scheme. With fewer than k shares, the attacker can construct a perfectly valid polynomial through their points for every possible secret. There's no signal to lock onto. The table below proves it: pick k−1 share points, then for a range of guessed secrets, we build the polynomial that forces f(0) = guess and fits the given points. Every row is a real, consistent polynomial.

Configure above and run to see how attackers gain zero information from k−1 shares.
What this is and isn't proving

This is the information-theoretic core: given fewer than k points, the remaining degrees of freedom in the polynomial are exactly enough to make any secret consistent. So the attacker's posterior over the secret equals their prior — zero information leaked. Note this is over GF(p); the byte-wise implementation in the Split tab gives the same guarantee per byte over GF(2⁸).

· · · ✿ · · ·
copied