1001Ferramentas
🧩 Security

Shamir Secret Sharing (Split & Combine)

Splits a secret into shares with Shamir's scheme and rebuilds the original from the minimum number of shares. Runs in your browser.

Everything runs inside this page. The secret and the shares never leave your browser: no upload, no request, no logging.

0 bytes

How the split works

Adi Shamir published the scheme in 1979. Each byte of the secret becomes the constant term of a random polynomial of degree minimum minus one, evaluated over GF(256), the same 256-element field AES uses. Each share is one point of that curve, written as a two-digit index plus the payload in hex.

With fewer shares than the threshold you get no partial information at all: every possible secret of that length stays equally likely. With the threshold reached, Lagrange interpolation at x = 0 returns the original bytes exactly. Note that the length of the secret is visible in the share size, so pad short secrets if that matters.

Split a secret into recoverable shares

Writing a wallet seed on a single sheet of paper creates one point of failure: lose the paper and the money is gone, and whoever finds it takes everything. Shamir's scheme fixes both sides at once. Pick five shares with a threshold of three, store each one somewhere different, and any three of them rebuild the original secret. Two shares on their own are worth nothing at all.

The method dates from 1979 and the maths fits in a paragraph. Every byte of the secret becomes the constant term of a polynomial whose degree is the threshold minus one, with the remaining coefficients drawn at random. Shares are points on that curve computed over GF(256), the 256 element finite field that AES also uses. Rebuilding means running Lagrange interpolation at zero and reading back the hidden term.

Here is the part rarely mentioned: the size of a share gives away the size of the secret. A share carrying 44 hex digits announces 21 bytes of content, which already narrows the search space for anyone who finds one. Pad the text to a fixed length first when that matters. Test a rebuild before you distribute anything, because a share copied down wrong only shows up on the day you need it.

Frequently asked questions

Do two shares of a 5 of 3 scheme leak half the secret?
They leak nothing. Below the threshold, every secret of that length stays equally likely: there is no partial rebuild, no first byte, no hint. That property is what separates Shamir from chopping a text into chunks, where each chunk already hands over a readable fragment.
Can I keep one share on my phone and another in the cloud?
Yes, provided the threshold is higher than the number of places one person can reach alone. A 3 of 2 scheme with two shares in the same cloud account is only as strong as that account password, not as strong as Shamir. Spread shares across people and locations that do not fail together.
Will these shares work in another Shamir implementation?
Not always. The algorithm is standard but the storage format is not: each tool picks its own way to encode the index, chooses GF(256) or a large prime, and may append a checksum. Note down where the shares came from, or test the import in the destination tool before you rely on them.

Related Tools