Shamir Secret Sharing
Split a password or recovery phrase into N shares so that any M of them rebuild it, with Shamir's secret sharing over GF(256), locally in your browser.
Splitting and combining run entirely in your browser. The secret and the shares are never sent anywhere; random numbers come from crypto.getRandomValues.
Split a secret
Combine shares
How to split a secret
- Type or paste the text to protect into Secret (text): a recovery phrase, a master password, an encryption key…
- Set the Number of shares (N) and the Shares needed to rebuild (M). For example, N = 5 and M = 3 means any 3 of the 5 shares rebuild the secret, and 2 shares reveal nothing.
- Click Split secret. Each share appears on its own line with a Copy button; you can also Copy all shares or Download shares (.txt).
- Click Test: combine the first M shares to check that the shares work before you hand them out.
- Give each share to a different person or store it in a different place. Do not keep them all together, or the split is pointless.
How to rebuild the secret
- Paste at least M shares into Shares, one per line, in any order. Blank lines are ignored.
- Click Combine shares. The text appears under Recovered secret, and the status says which share numbers were used.
- If a share has a typo, comes from another split or appears twice with different content, the tool says which one and why, instead of returning garbage.
How Shamir’s secret sharing works
Adi Shamir published the scheme in 1979. To share one byte s with threshold M, pick a random polynomial of degree M − 1 whose constant term is s: f(x) = s + a₁x + … + a₍M−1₎x^(M−1). Share number x is the value f(x). Any M points determine the polynomial, so Lagrange interpolation at x = 0 gives back s; with fewer than M points, every value of s is equally likely, so the shares leak nothing about the secret.
This tool works in the finite field GF(256) (the one used by AES, with the reduction polynomial x⁸ + x⁴ + x³ + x + 1), so each byte of the UTF-8 secret gets its own polynomial and shares are exactly as long as the secret. The random coefficients come from crypto.getRandomValues, the browser’s cryptographic random generator. Everything runs locally: the secret and the shares never leave your device.
Share format
A share looks like 3-2-5f1c…: the threshold M, the share number X (1 to 255), then hexadecimal data. The data holds the polynomial values for the secret followed by a 4-byte CRC-32 of the secret, and ends with a 4-byte CRC-32 checksum of the share itself. The checksum catches copying mistakes; the inner CRC shows when shares from different secrets were mixed. Shares made by other Shamir tools use other formats and cannot be combined here.
Frequently asked questions
How should I choose N and M?
M is how many people or places must cooperate, N − M is how many shares you can afford to lose. 3 of 5 is a common choice: two shares can be lost or destroyed, and no pair of holders can rebuild the secret on their own.
Is it safe to store one share in the cloud?
A single share, or any group smaller than M, reveals nothing about the secret. Still, keep fewer than M shares in any one account or place, otherwise that place alone holds the secret.
Does this tool encrypt the secret?
Not in the usual sense: there is no password. The protection comes from the threshold. You can combine both, for example by splitting the passphrase of an encrypted file.
What happens if I give more than M shares?
The first M shares rebuild the secret and the extra ones are checked against them. A share that does not fit is reported, which helps spot a damaged or foreign share.
Can I split a file?
This tool splits text up to 10,000 bytes. For a file, encrypt it with a strong random passphrase and split the passphrase instead.
Related tools
- Password Generator Free password generator that creates strong random passwords of 4 to 128 characters in your browser with a secure RNG. Nothing is stored or sent.
- Passphrase Generator Create strong, memorable passphrases from the EFF word list or a French list, with entropy shown in bits. Generated securely in your browser.
- Text Encryption Tool Encrypt and decrypt text with a passphrase in your browser, using AES-256-GCM and PBKDF2 with 600,000 iterations. Nothing is uploaded. Honest limits explained.
- TOTP and HOTP Code Generator Generate TOTP and HOTP 2FA codes from a Base32 secret or an otpauth:// URI, with SHA-1, SHA-256 or SHA-512, a live countdown and a QR code for 2FA apps.