Shamir Secret Sharing
Split a secret into n shares so any k recover it, and combine shares, locally.
Try an example: Split a recovery code into 5 shares, any 3 recover it (demo seed) · Combine 3 shares · Split into 3 Base64 shares, 2 needed (demo seed)
How it works
Splits a secret (recovery code, password, key) into n shares with a threshold k using Shamir's scheme over GF(256): any k shares reconstruct it, fewer reveal nothing. Combines and verifies shares with an optional checksum. With JavaScript on, splitting and combining happen in your browser.
- Each byte of the secret is the constant term of its own random polynomial of degree k−1 over GF(2^8) (field polynomial x^8+x^4+x^3+x+1, as in AES). Share i holds the value of every polynomial at x = i (i = 1…n), so a share is as long as the secret.
- Combining uses Lagrange interpolation at x = 0. Any k shares give the secret; with k−1 or fewer, every possible secret is equally consistent with the shares (information-theoretic security).
- Optional checksum: the first 4 bytes of SHA-256(secret) are appended before splitting. After combining, a wrong share or too few shares are detected with probability 1 − 2^−32.
- Shares are written as "<index>-<data>" in hex or Base64. The format is not interchangeable with other tools (e.g. ssss-split, which uses a larger field).
- With JavaScript on, the page splits and combines in your browser with crypto.getRandomValues; the secret is not sent to the server. Without JavaScript or via the API the server does it with Node.js crypto and does not store anything.
Store shares in different places and test recovery before relying on them. Anyone holding k shares can recover the secret.
Sources
For scripts and AI agents
- JSON API:
POST https://shamirsecretsharing.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://shamirsecretsharing.usefulweb.site/mcp· tool nameshamir_secret_sharing
Example request
curl -s -X POST https://shamirsecretsharing.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"action":"split","secret":"correct horse battery staple","shares":5,"threshold":3,"seed":"demo"}'Related tools
- Password & Passphrase Generator – Strong random passwords and passphrases, made in your browser, with exact entropy.
- Local File Encryption Studio – Encrypt and decrypt files with AES-256-GCM and a password, locally in your browser.