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).
Get the free 5-minute weekday brief
Scam alerts you can act on, major breaches, and our free Scam Survival Kit (PDF). Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
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):
- Turn the secret into a number D.
- Choose a random polynomial of degree k minus 1 whose constant term (its value at x = 0) is D.
- Compute the polynomial’s value at x = 1, 2, 3 and so on up to n. Each (x, value) pair is one share.
- 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.
| Step | Value |
|---|---|
| Secret D | 7 |
| Prime p | 11 (bigger than both 7 and 3) |
| Random line | q(x) = 7 + 3x, calculated modulo 11 (the 3 is the random choice) |
| Share 1 | x = 1, q(1) = 10 |
| Share 2 | x = 2, q(2) = 13 mod 11 = 2 |
| Share 3 | x = 3, q(3) = 16 mod 11 = 5 |
| Rebuild from shares 1 and 2 | The 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 shows | Share 1 alone is consistent with every possible secret, because any secret from 0 to 10 matches some slope |
Where it is used
- Protecting encryption keys in software. HashiCorp Vault’s default configuration uses Shamir’s Secret Sharing to split its unseal key into shares and requires a threshold of shares to reconstruct it, so operators add shares one at a time until the threshold is met (HashiCorp Vault documentation).
- Disaster recovery and key backup. Shares can be given to different people or stored in different places so that losing one does not lose the key, and stealing one does not expose it.
- Organizations that want shared control. A threshold means no single administrator can unlock something alone.
- Wider threshold cryptography. NIST has a project on threshold schemes for cryptographic primitives, where secret sharing is one of the building blocks (NIST Threshold Cryptography).
Risks and limits
- When the secret is rebuilt, it is in one place. The scheme protects the secret while it is split, not at the moment someone puts it back together.
- Shares must be protected. Anyone who collects the threshold number of shares gets the secret. Spread them across people and locations, and track who holds which.
- Lose too many shares and the secret is gone. With a 3-of-5 setup, losing 3 shares means no recovery. Choose k and n to balance loss against theft.
- Do not build it yourself. Use well-reviewed tools. Details such as random number quality and share handling matter.
- Plain Shamir sharing does not detect a bad share. If someone hands you a wrong piece, you may rebuild the wrong secret unless the tool adds verification.
Secret sharing vs a password manager or hardware wallet backup
| Approach | Good for | Watch out for |
|---|---|---|
| Secret sharing (k of n) | Splitting one critical key or recovery secret among people or places | Complexity, and keeping track of who holds shares |
| Password manager | Everyday logins for a person or team | Its own master password and recovery method still need protecting |
| Written backup in a safe | Simple recovery for an individual | A 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
- Adi Shamir, “How to Share a Secret,” Communications of the ACM 22(11), November 1979
- Copy of the paper hosted on Tel Aviv University’s site
- HashiCorp Vault documentation: Seal/Unseal
- NIST: Threshold Cryptography project
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.