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. The free password qr code generator runs entirely client-side — nothing you enter or generate is ever stored or transmitted.

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

The Shamir Secret Sharing Splitter turns one password, passphrase or encryption key into several shares, so that no single person or device ever holds the whole thing. You choose how many shares to create and how many are needed to rebuild the original, and any group of shares that meets your threshold recovers the secret exactly while a smaller group learns nothing. This guide explains the math behind Shamir's secret sharing, walks through a full example with real numbers, and shows you how to pick safe settings for your own backups.

How Shamir's Secret Sharing Works When You Split a Secret

Adi Shamir described the method in 1979, and it remains the most widely used secret sharing scheme for key management. The idea is simple to state: a secret is divided into n pieces so that any k of them can be combined to reconstruct the secret, but any k minus 1 pieces are useless on their own. This is called a threshold scheme, and it is written as a (k, n) split, for example 3-of-5. It only takes a moment to generate a security question answer, and nothing you enter ever leaves your device.

The tool follows the same secret sharing algorithm every serious implementation uses: hide the secret inside a random polynomial, hand out points on that curve as shares, and later use those points to find the curve again. Nothing about it depends on guessing hard problems, which is why it counts as an information-theoretically secure design rather than a merely computationally secure one. It is cryptography built on nothing more than high-school algebra, so the same idea, often shortened to SSS, works in a browser tab as well as in a hardware security module.

Properties that make the scheme useful

Four traits explain why the method outlived many newer designs. It is minimal, because no share is larger than the secret. It is extensible, so you can create extra secret shares for new holders without touching the ones already issued. It is dynamic: you can replace the polynomial from time to time, keeping the same secret, and issue fresh shares that make any stolen old ones worthless. And it is flexible, since an organization with a hierarchy can give senior people several shares each while everyone else holds one. Together they let a team share a secret without ever trusting one person with all of it, and every group of shareholders sees only the piece it was given.

Splitting a secret into shares

To split a secret, you provide three things: the secret itself, the number of shares you want to hand out, and the threshold. The splitter converts your secret into numbers, builds a random polynomial whose constant term is that secret, and evaluates the polynomial at the points 1, 2, 3 and so on. Each result, paired with its point number, is one share you can store or send separately.

  • Secret: the password, passphrase, seed phrase or private key you want to protect.
  • Number of shares (n): how many pieces exist in total, one per holder or location.
  • Threshold (k): the minimum number of shares needed to recover the secret.

Recovering the secret from shares

To rebuild the original, you combine shares: enter any k of them and the tool uses Lagrange interpolation to find the one polynomial that passes through those points, then reads off its constant term. Supplying fewer than k shares does not produce a close guess or a partial result. It produces nothing useful at all, which is exactly the property that makes the method trustworthy.

How to Use the Shamir Secret Sharing Splitter Step by Step

Using the tool takes about a minute, and the order matters more than the speed. Follow the same routine every time so that a recovery months later never surprises you. It only takes a moment to generate an email alias, and nothing you enter ever leaves your device.

  1. Type or paste the secret you want to protect, and keep the original somewhere safe until you have tested a recovery.
  2. Enter the total number of shares, n, matching the number of people or places that will each keep one.
  3. Enter the threshold, k, the smallest group that should be able to open the secret.
  4. Click the split button and copy each share into a separate password manager entry, printout or message.
  5. Rebuild the secret from exactly k shares to confirm the whole cycle works, then store the (k, n) settings alongside the instructions.

Because the shares are generated from fresh random numbers each time, splitting the same secret twice gives two unrelated sets. Never mix shares from different splits when you recover.

The Polynomial Behind Secret Sharing

Every share comes from a single polynomial of degree k minus 1. Two points define a line, three points define a parabola, and in general k distinct points pin down exactly one polynomial of that degree. With one point fewer, infinitely many polynomials still fit, so the secret stays hidden.

For a threshold of k, the polynomial is written as:

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

Here S is the secret, which sits in the constant term, and every other coefficient is chosen uniformly at random. These random coefficients are discarded after the shares are produced. A share is the pair \((x_{i}, f(x_{i}))\), and you create it by asking the tool to evaluate the polynomial at a nonzero point \(x_{i}\).

Why a finite field and a prime modulus

Ordinary integer arithmetic leaks information. If shares were plain whole numbers, a small share would tell an attacker the secret must also be small, shrinking the search. Working in a finite field removes that leak: every result wraps around a prime number p, so each value from 0 to p minus 1 is equally likely. This is the modulo operation written as \(\pmod{p}\) above, and it is why the method needs a prime larger than the secret.

Production tools usually pick a field built for bytes. The field GF(2^8) handles one byte at a time, which suits text and binary keys, while a large prime field suits secrets treated as one huge number. Both give the same guarantees.

The leading coefficient matters

The highest-degree leading coefficient must be drawn from the full field just like the others, including zero. Some implementations reject zero to keep the polynomial at exactly degree k minus 1, which sounds harmless and is not, as the pitfalls section below shows. The splitter draws every coefficient, the leading one included, from the full field, so the shares it returns keep the secret fully hidden.

Turning text into numbers

A password is text, and polynomials need numbers. The splitter first encodes your secret into bytes, usually UTF-8, and treats each byte as its own value in a byte field, or joins them into one large integer for a prime field. A 16-character password becomes 16 byte-sized secrets, each split with its own random polynomial, and every share is the list of 16 results plus the point number. This is why each share is exactly as long as the original secret, plus a small label.

Worked Example: Splitting a Secret 3-of-5

To see the Shamir's secret sharing scheme end to end, take a deliberately small case you can check by hand. You want to protect the secret S = 58 using the prime p = 97, creating five shares of which any three recover it, a (3, 5) split. A degree-2 polynomial is needed, so two coefficients are drawn at random: a1 = 31 and a2 = 44.

$$f(x) = 58 + 31x + 44x^{2} \pmod{97}$$

Evaluating the polynomial at x = 1 through 5 gives the five shares:

Worked Example: Splitting a Secret 3-of-5
Share (x)CalculationShare value f(x) mod 97
158 + 31 + 44 = 13336
258 + 62 + 176 = 2965
358 + 93 + 396 = 54762
458 + 124 + 704 = 88613
558 + 155 + 1100 = 131352

You then hand share (1, 36) to one holder, (2, 5) to another, and so on, and destroy the polynomial. Every holder knows only a single pair of numbers, and a lone point on a parabola says nothing about its constant term.

Recovering the Secret with Lagrange Interpolation

Suppose the holders of shares 1, 3 and 5 get together. They do not need shares 2 and 4. The secret is the value of the polynomial at x = 0, which Lagrange interpolation computes directly from the three points:

$$S = \sum_{i} y_{i} \prod_{j \neq i} \frac{-x_{j}}{x_{i} - x_{j}} \pmod{p}$$

Each share receives a weight. For x = 1 the weight is \(\frac{(-3)(-5)}{(1-3)(1-5)} = \frac{15}{8}\), which equals 14 modulo 97. For x = 3 it is \(\frac{(-1)(-5)}{(3-1)(3-5)} = \frac{5}{-4}\), equal to 23, and for x = 5 it is \(\frac{(-1)(-3)}{(5-1)(5-3)} = \frac{3}{8}\), equal to 61. Multiplying each share by its weight gives 36 × 14 = 504 (which is 19 mod 97), 62 × 23 = 1426 (68 mod 97) and 52 × 61 = 3172 (68 mod 97).

Adding the three contributions gives 19 + 68 + 68 = 155, and 155 minus 97 leaves 58, the original secret. Try the combination 2, 4 and 5 instead and you arrive at 58 again, because every group of three points lies on the same parabola. This interpolation step is the heart of how any Shamir's secret sharing tool handles recovery.

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.

Why Fewer Shares Reveal Nothing: Perfect Secrecy

Security here is not about effort. Information-theoretic security means an attacker with unlimited computing power still cannot do better than guessing, and perfect secrecy is the name for that property. Return to the example: someone holds the two shares (1, 36) and (3, 62). A parabola needs three points, so for every candidate secret from 0 to 96 there is exactly one polynomial that passes through both shares and has that candidate as its constant term. All 97 secrets stay equally likely, so the two shares carry no information.

The moment a third share arrives, only one polynomial fits, and exactly one secret survives. The jump from 97 possibilities to 1 is sudden, which is why the threshold must be chosen carefully before any shares are distributed.

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.

This also explains the link to the one-time pad: a two-share, two-out-of-two split is the one-time pad written as secret sharing, with one share as the pad and the other as the masked message.

Choosing the Threshold and Number of Shares

A good split balances two risks: losing too many shares to recover, and having too many people able to collude. The minimum number of shares you set is the collusion limit, and the gap between n and k is the number of shares you can lose before the secret is gone for good.

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.
Choosing the Threshold and Number of Shares
Split (k-of-n)Shares you can loseTypical use
2-of-31Personal backup across three locations
3-of-52Small team holding a shared password
4-of-73Board or committee guarding a vault code
5-of-94Large group with strict collusion limits

Rules of thumb for the threshold

  • Set k above half of n when you worry more about collusion than loss.
  • Keep n minus k at two or more for any secret you cannot regenerate.
  • Give every holder a different location so one fire or breach cannot take two shares.
  • Write down the (k, n) values separately from the shares, since every holder needs them.

Splitting a Backup Passphrase with a Secret Sharing Splitter: A Six-Person Co-op Case

Marguerite Oyelaran is treasurer of a small food co-op's backup system, and its restic repository is locked by a 27-character passphrase that only she knows. If she is unavailable, nobody can restore the books. She wants six board members to each hold a piece, with any four able to open it and no two able to.

In the secret sharing splitter she pastes the passphrase, enters 6 for the number of shares and 4 for the threshold, and clicks the split button. The tool encodes the passphrase as 27 bytes, builds a degree-3 polynomial over GF(2^8) for each byte, and returns six shares. Each is 28 bytes long, the 27 results plus a one-byte point number, which shows as 56 hexadecimal characters.

Before she sends anything, she checks the recovery. Entering shares 2, 3, 5 and 6 returns her passphrase exactly. Entering only shares 2, 3 and 5 returns a different string that matches nothing, which is the proof that a three-person group learns nothing. With six holders and a threshold of four, two shares can be lost, one more spare than HashiCorp Vault's default 3-of-5, which tolerates two losses from five.

  • Result: 4-of-6, tolerating 2 lost shares.
  • Next step: she stores shares 1 to 6 in six different password managers and records a SHA-256 hash of the passphrase to confirm any future rebuild.
  • Rerun trigger: if a holder leaves the board, she changes the passphrase and splits again, so the departing person's share is worthless.

Her last action is a test restore of the repository using a recovered passphrase, which succeeds, and then she deletes the original from her notes.

Security Pitfalls When You Split Secrets

The mathematics is sound, but the implementation can fail in ways that cost you the guarantees. The most important pitfalls are worth knowing before you trust any secret splitting tool.

The zero share problem and rejection sampling

If a tool rejects a random leading coefficient of zero, an attacker gains bias. Take a tiny two-share example over GF(3): seeing the point (1, 2) lets the attacker rule out a secret of 2, because the only line through it would need a zero slope. This rejection sampling flaw is the zero share problem, and it is worst over a small field such as 256 elements.

Corrupted shares and reconstruction integrity

The scheme will happily interpolate wrong data. A mistyped digit, a damaged file or a malicious holder yields corrupted shares and a confident but wrong answer. Basic SSS has no integrity check, so you should verify the rebuilt value, for example by comparing a stored hash of the secret.

Entropy and side-channel risks

Shares are only as random as the generator behind them, so the coefficients must come from a cryptographic source. Weak entropy makes shares guessable. Secrets that are not uniformly random, like a short human-chosen password, should be encrypted first, with the encryption key split instead. Timing and side-channel leaks matter too, which is why audited libraries aim for constant-time behaviour, even though JavaScript cannot fully guarantee it.

  • Never reuse the same random coefficients across two different secrets.
  • Normalize text input the same way every time so a recovery does not fail on a hidden character difference.
  • Test a recovery with the minimum threshold before you destroy the original secret.

Real-World Uses for a Secret Splitting Tool

Whenever a single master key is too valuable to live in one place, running it through the splitter removes the single point of failure without handing control to anyone alone. Each use below is just a different choice of shares and threshold.

  • Password manager recovery: split the root key of a password manager 2-of-3 so a locked-out user can still be recovered by trusted contacts.
  • Cryptocurrency wallet backup: spread a seed phrase or the passphrase protecting a cryptocurrency wallet across family members or safe deposit boxes.
  • Company vault codes: require several managers to agree before a vault combination can be rebuilt.
  • Disaster recovery: keep an encrypted archive's key safe even if one site is lost, a common disaster recovery pattern.
  • Distributed trust: the splitter issues one share per approver for shared admin credentials, and a threshold equal to the approvals you require means authentication to a critical system needs that many people, a simple form of access control.

When you divide a secret across an organization, give a director two of the shares and each manager one, which is the weighting described earlier in practice. It also blunts theft: a thief who steals one device gets a single share, and one share is not enough for an attack to go anywhere.

Beyond Shamir: Robust and Computationally Secure Secret Sharing

Pure Shamir splitting has one practical cost: every share is as large as the secret. Splitting a large file this way multiplies storage, so computationally secure variants encrypt the data with a symmetric key such as AES-GCM and apply Shamir to the key alone. Robust secret sharing adds checks so a few bad shares are detected and discarded instead of silently breaking recovery, which is useful for self-healing cloud storage.

For everyday use on a password or a key, the plain scheme is the right tool: shares are tiny and the guarantees are the strongest available.

Implementations and Libraries for Shamir's Scheme

The same method appears in many places: the Python ecosystem has several packages, HashiCorp's Vault ships a Go library, and a zero-dependency TypeScript package handles Uint8Array data in browsers. A browser splitter like this one computes the shares locally, so the secret never has to leave your device, which is the safest way to distribute them, and its output follows the standard scheme described above.

Whichever implementation you pick, confirm that it draws coefficients from a secure random source, that its leading coefficient can be any field value, and that it has been independently audited. Then run a full split and recover cycle before relying on it.

Storing and Handing Out Shares Safely

Splitting is only half the job; the shares still need to live somewhere. Treat each one as a key in its own right, label it with its point number and the (k, n) values, and store it apart from the others: one in a password manager, one in a sealed envelope at home, one with a lawyer or a trusted relative. Avoid email attachments and shared cloud folders, since a single compromised account would then hold several shares at once.

Review the holders once a year. People move, devices fail and passwords change, and a share nobody can find counts against your margin. If a share is lost or exposed, do not try to patch the set: recover the secret with the remaining holders, change the underlying password or key, and run a fresh split so the old shares become worthless.

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