Secret Sharing Explained: Shamir’s Scheme Simply

By George Bailey   Published: 12/04/26   6 min read

The scheme is described from Adi Shamir’s original 1979 paper. The numbers in the example are tiny on purpose; real systems use far larger values and tested software.

What secret sharing is

Secret sharing is a way to split a secret, such as an encryption key, into several pieces called shares, so that no single share reveals anything. The secret can only be rebuilt when enough shares, a set threshold, are brought together. It avoids keeping a key in one place where one loss or one thief decides everything.

Shamir described the goal this way: divide data D into n pieces so that D is easily reconstructable from any k pieces, but even complete knowledge of k minus 1 pieces reveals absolutely no information about D. Such a scheme is called a (k, n) threshold scheme (Shamir, How to Share a Secret, Communications of the ACM, November 1979).

Think of a bank vault that needs any 3 of 5 managers to open. Any 3 can open it. Any 2 cannot, and learning what 2 managers know tells you nothing about the third.

Shamir’s secret sharing in plain English

Shamir’s method uses a simple fact from algebra: a straight line is fixed by any 2 points, a curve of the next degree by any 3 points, and so on. In general, k points determine exactly one polynomial of degree k minus 1. The scheme works like this (copy of the paper hosted by Tel Aviv University):

  1. Turn the secret into a number D.
  2. Choose a random polynomial of degree k minus 1 whose constant term (its value at x = 0) is D.
  3. Compute the polynomial’s value at x = 1, 2, 3 and so on up to n. Each (x, value) pair is one share.
  4. To rebuild, take any k shares and use interpolation to find the polynomial, then read its value at x = 0. That is the secret.

Shamir does the math using modular arithmetic: integers modulo a prime number p that is bigger than both the secret and n. With fewer than k shares, every possible secret remains equally likely, so the shares give an attacker nothing to work with.

A simple example

This is a toy example (k = 2, n = 3) so you can follow it by hand. Real use needs software that has been reviewed, not hand calculation.

StepValue
Secret D7
Prime p11 (bigger than both 7 and 3)
Random lineq(x) = 7 + 3x, calculated modulo 11 (the 3 is the random choice)
Share 1x = 1, q(1) = 10
Share 2x = 2, q(2) = 13 mod 11 = 2
Share 3x = 3, q(3) = 16 mod 11 = 5
Rebuild from shares 1 and 2The line through (1, 10) and (2, 2) has slope (2 minus 10) = minus 8 = 3 modulo 11. Going back to x = 0 gives 10 minus 3 = 7, the secret.
Rebuild from shares 2 and 3 (or 1 and 3)Also gives 7
What one share showsShare 1 alone is consistent with every possible secret, because any secret from 0 to 10 matches some slope

Where it is used

Risks and limits

Secret sharing vs a password manager or hardware wallet backup

ApproachGood forWatch out for
Secret sharing (k of n)Splitting one critical key or recovery secret among people or placesComplexity, and keeping track of who holds shares
Password managerEveryday logins for a person or teamIts own master password and recovery method still need protecting
Written backup in a safeSimple recovery for an individualA single place that can be lost, burned or stolen

For everyday accounts, a password manager is the right tool; see our password best practices. Secret sharing is for the rare, high-value secret. For the algorithms that sit around it, see common encryption methods, and for the short definitions, our encyclopedia entries on secret sharing and Shamir’s secret sharing.

Frequently asked questions

What is secret sharing in cryptography?

It is a method of splitting a secret, such as a key, into shares so that a chosen number of shares are needed to rebuild it and fewer reveal nothing. Source: Shamir, 1979.

What is Shamir’s secret sharing?

It is a (k, n) threshold scheme published by Adi Shamir in 1979. It hides the secret in a random polynomial and gives each person one point on it; any k points rebuild the polynomial and the secret. Source: Communications of the ACM.

What does (k, n) mean?

n is the total number of shares made, and k is how many are needed to rebuild the secret. For example, 3-of-5 means any 3 of 5 shares work, and 2 shares reveal nothing.

Is secret sharing the same as encryption?

No. Encryption protects data with a key. Secret sharing protects the key (or any secret) by splitting it. The two are often used together.

Where is Shamir secret sharing used?

It is used in key management systems. For example, HashiCorp Vault’s default configuration splits its unseal key into Shamir shares and needs a threshold of them to unseal. Source: Vault documentation.

What happens if I lose some shares?

As long as you still have k shares, you can rebuild the secret. If fewer than k remain, the secret cannot be recovered, so choose the numbers and backup plan carefully.

Sources

George Bailey

George Bailey is the byline of the CyberExperts editorial desk, the team behind the CyberExperts Daily Brief. The desk covers vulnerabilities, breaches and security news from vendor advisories, CISA alerts and other primary sources, and links those sources in every story. Questions or corrections: [email protected].