Free · runs in your browser

Shamir Secret Sharing Splitter

Shamir Secret Sharing Splitter. Enter a secret and share settings, then click Split Secret to run real Shamir's Secret Sharing instantly. Hotel and restaurant owners cut typos and front desk questions when the free password qr code generator puts the router login on a printed card.

Your values
Mode

Processed in your browser only. Each byte is split with its own random polynomial over GF(2^8).

How the secret is typed when splitting, and how the recovered secret is shown when combining.

How many shares to create in total, one per holder or location.

The minimum number of shares needed to recover the secret. Must not exceed the number of shares.

Result

Shares / Recovered secret
—
Threshold scheme
—
Share size
—
Secret in hex
—
Finite field
—
Random source
—
  • No account, no logging
  • Open formulas explained below
  • Works offline once loaded

Use a Shamir Secret Sharing Splitter when you want to turn one secret into several shares, so that no single person ever holds the whole thing. Shamir's secret sharing is a cryptography method in which any threshold number of shares rebuilds your private key, such as a bitcoin signing key, while one share fewer reveals nothing. Here you will see how the process works, a full example you can check by hand, and the mistakes that quietly break it.

How a Shamir Secret Sharing Splitter Works

A secret sharing scheme hides your secret as the constant term of a random polynomial of degree k-1, where k is the threshold. Adi Shamir published this algorithm in 1979, and George Blakley found a geometric version the same year. The mathematics is school algebra: two points fix a line, three points fix a parabola, and four fix a cubic curve. In general, k distinct points pin down one unique polynomial of degree k-1, and rebuilding it is polynomial interpolation. With fewer points, countless curves still fit, so any k shares finish the job and fewer cannot. The secret is the y-intercept, also called the free coefficient, at x = 0. If you want to find out who sold your address, generate an email alias for every signup and note which tag gets spam.

Generating the Shares from a Random Polynomial

Pick the number of shares n and the threshold k, then choose k-1 random coefficients. Write the polynomial and evaluate it at x = 1, 2, 3 and so on; each pair \((x, f(x))\) is one share for your holders.

$$f(x) = S + a_1 x + a_2 x^{2} + \ldots + a_{k - 1} x^{k - 1}$$

Recover the Secret with Lagrange Interpolation

To reconstruct the secret, combine any k shares and evaluate the curve at zero. Each share's y value is multiplied by a weight that depends only on the x positions, and the weighted sum is your secret. This reconstruction never needs to know the polynomial itself, so it is fast, and Lagrange interpolation stays the usual method for it.

Waterfall chart showing three weighted shares of 19, 68 and 68 adding to 155, then reduced modulo 97 to recover the secret 58
Recovering the secret 58 from shares 1, 3 and 5 of the worked 3-of-5 split.
$$S = f(0) = \sum_{j=1}^{k} y_j \prod_{m \neq j} \frac{x_m}{x_m - x_j} \pmod{p}$$

Shamir's Secret Sharing Worked Example with Real Numbers

Suppose you want a 3 of 5 sharing of the secret 1234, so any three of five holders can rebuild it. Work modulo the prime 2089 and pick two random coefficients, 166 and 94. The polynomial is: When a reset form asks personal questions, the free security question answer generator outputs a random answer per question, so a social media post cannot unlock it.

$$f(x) = 1234 + 166x + 94x^{2} \pmod{2089}$$

Evaluating it at x = 1 to 5 gives these five shares:

Shamir's Secret Sharing Worked Example with Real Numbers
HolderxCalculationShare f(x)
A11234 + 166 + 941494
B21234 + 332 + 3761942
C32578 − 2089489
D43402 − 20891313
E54414 − 2 × 2089236

Now bring holders A, B and C together. Their Lagrange weights at zero are 3, −3 and 1, so the secret is 3 × 1494 − 3 × 1942 + 489 = −855, which equals 1234 modulo 2089. Shares B, D and E reconstruct the same value. Holders A and B alone get 1046, a wrong number delivered without any warning.

Choosing a Prime and a Threshold

The prime must exceed both the secret and the number of shares, so real secrets use a much larger one. A higher threshold raises resistance to theft but makes rebuilding harder when holders disappear, which is why a majority such as three of five is common. Pick the threshold before you hand out shares, because changing it later means generating a new polynomial and redistributing every share.

Heatmap of spare shares for thresholds k of 2 to 4 and totals n of 4 to 9, with the 3-of-5 split outlined
How many shares you can lose for each threshold and total, with the 3-of-5 example outlined.

Why Splitting a Secret Needs a Finite Field

Plain integer arithmetic leaks information. Because every value is bounded, a few shares narrow the search and an attacker can brute-force the rest. Doing the sums in a finite field, also called a Galois field, removes the leak, since every value from 0 to p-1 stays equally likely. Prime fields suit secrets of any size, while a field of order 256 suits byte-by-byte secrets. Finite field arithmetic also keeps every share the same size as the secret.

Shamir's Scheme in Practice: A Treasurer Shares a Recovery Code

A volunteer treasurer needs the club's wallet recovery code to survive any one board member quitting, yet never sit with one person. The bylaws already ask for three of four signatures on spending, so the treasurer picks k = 3, n = 4. The code becomes the number 6482, the prime is 7919, and the random coefficients are 1357 and 2204.

Bar chart showing 97 candidate secrets remain with zero, one or two shares and only one remains with three shares
Candidate secrets left for an attacker holding 0, 1, 2 or 3 shares of the 3-of-5 example.

Running the splitter gives the shares (1, 2124), (2, 2174), (3, 6632) and (4, 7579). To check the work, the treasurer recovers the secret from shares 1, 2 and 3 with the Lagrange weights 3, −3 and 1: 3 × 2124 − 3 × 2174 + 6632 = 6482. Holders 2, 3, 4 and holders 1, 3, 4 return 6482 too, so every trio of the four works.

Shamir's Scheme in Practice: A Treasurer Shares a Recovery Code
ScenarioResult
Holders 1, 2, 3 (all correct)6482
Holders 1, 2, 3 with share 2 off by 1006182
Holders 1 and 2 only2074

The sensitivity rerun is the part worth noticing: a share mistyped by 100 moves the answer by exactly 300, because share 2 carries a weight of −3 in that trio. The result looks like a valid number, so nothing flags the error. The treasurer's rule is therefore to rebuild the secret from two different trios and accept it only when both match, and the number to watch is that agreement, not the share count. Two holders alone get 2074, which is useless but looks just as confident.

The caveat: the weights change with the holders' x positions, so shares must keep their original labels. Losing the label for share 3 means guessing, and a wrong guess silently gives a wrong secret. The treasurer writes each x value next to its share.

Why You Can Split a Secret Without Leaking It

The guarantee is information-theoretic: with fewer shares than the threshold, every possible secret stays equally likely, so more computing power does not help. It holds only when each coefficient is drawn uniformly at random. You get confidentiality and reliability together: participants may lose or withhold a few shares, yet the secret stays recoverable by the rest and hidden from everyone else. This gives real security without a vault. Shareholders need not fully rely on each other, since distributed trust replaces one trusted custodian.

Removing a Single Point of Failure

Keeping one copy of an encryption key invites theft, while keeping several copies multiplies the attack surface. A k-of-n threshold removes that trade-off, because losing one or two is harmless and stealing one is useless. Unavailable holders no longer block access either.

Protecting a Private Key

A bitcoin signing key, a master password or a vault seed is a natural fit for shares. Splitting it also adds access control and stronger security: the threshold is set to three, so a quorum of three managers must agree before the key exists again in one place.

What Can Go Wrong with Secret Splitting

Many implementations draw the leading coefficient with rejection sampling to keep it nonzero. That bias lets an attacker eliminate candidate secrets, which is dangerous in small fields or when the same secret is shared repeatedly. Basic sharing also has no share authentication: a corrupted share silently yields the wrong secret, as the 1046 result showed. Verifiable secret sharing adds checks for this. The dealer who runs the sharing sees the secret, and protocols such as FROST use distributed key generation to avoid that. Predictable randomness or a careless implementation voids the security argument entirely.

Choosing Audited Software

Whichever Shamir Secret Sharing Splitter you pick, prefer maintained, open-source code with a cryptographically secure random generator and tested field arithmetic. HashiCorp Vault uses this method for its unseal keys, and its Go package is widely reused. Always rehearse a full recovery with a threshold of shares before you rely on a backup. A flawed setup on a bitcoin backup stays invisible until the day you need it.

Shamir's Scheme for Bitcoin and Hardware Wallet Backups

For bitcoin custody, SLIP-0039 standardizes splitting a wallet's master secret, often written as a seed phrase, into groups of shares. A typical setup keeps five shares and needs three, stored in separate geographic locations so one fire or burglary cannot end the bitcoin holdings; that is disaster recovery without a single copy. On the Lightning Network, a 2-of-3 setup keeps one share on the always-online node and two offline, so a hacked server cannot spend bitcoin alone. Each share is a k-of-n piece of the master secret, so no single location matters. Never keep two shares in one place. Shares are interchangeable, so if one is lost, a quorum can rebuild the secret and re-share it with a fresh polynomial, which retires the missing share for good. Bitcoin wallets that support the standard also let you check a share before storing it.

Frequently Asked Questions

How is this different from just encrypting the secret and splitting the ciphertext?
Splitting an encrypted blob in half gives each half zero information (useless without the other half AND the key), which isn't the same guarantee -- Shamir's Secret Sharing has a mathematical property called information-theoretic security: any K-1 shares reveal absolutely nothing about the secret, not even a probabilistic hint, while any K shares reconstruct it exactly. There's no key to separately protect.
What happens if I lose some shares?
As long as at least K shares survive (out of the original N), the secret is fully recoverable -- that's the entire point of the threshold. Losing shares beyond that point means the secret is permanently unrecoverable, so choose N and K based on how much loss you realistically need to tolerate versus how many people/locations you're comfortable trusting.
Can someone with fewer than K shares guess the secret?
No -- not even with unlimited computing power. With fewer than K points, the underlying polynomial (and therefore the secret) is mathematically underdetermined; any possible secret value remains equally consistent with the shares you have. This is fundamentally different from encryption, which can theoretically be brute-forced given enough time.
What format are the shares in?
Each share is a small index number (1 to N) followed by a hyphen and the share's data in hex -- e.g. "3-a1b2c3...". The index is not secret (it just tells the math which point on the curve this share represents); the hex portion is what actually needs protecting.
Is my secret or my shares sent anywhere?
No. Both splitting and combining happen entirely in your browser -- nothing is transmitted, logged, or stored. Distribute the resulting shares yourself, ideally via separate channels or to separate trusted parties.

About the author

Vinitha Pu

Founder and designer

Vinitha Pu is a graphic designer based in Palakkad, Kerala, who builds free, privacy-friendly browser tools. She studied Textile and Apparel Design at Avinashilingam University and completed a C-Tech in Graphic Design at Image Creative Education in 2025. She designs, builds and maintains the password generators, strength checkers, hash tools and security calculators on PasswordHive.

  • Content author: Vinitha Pu
  • Fact checked by: Vinitha Pu. Each tool's output is checked against official test vectors or a reference implementation, and every strength and crack-time figure against the formula it uses, before it goes live.
  • Published Updated