API & MCP

Everything a person can do on Shamir Secret Sharing, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Shamir Secret Sharing

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.

Inputs of Shamir Secret Sharing
FieldTypeDefaultDescription
actionselect (split, combine)"split"Action
secrettextarea—Secret (split). Text up to 10,000 characters (UTF-8).
sharesinteger5Number of shares (n)
thresholdinteger3Threshold (k shares needed). Split: any k shares recover the secret. Combine: used to check extra shares for consistency.
formatselect (hex, base64)"hex"Share format
checksumbooleantrueAdd a 4-byte SHA-256 checksum so wrong or too few shares are detected
sharesInputtextarea—Shares (combine), one per line
seedtext—Demo seed (optional, reproducible — never for real secrets). Split only. With a seed the shares are predictable; leave empty for real use.

Example request

Split a recovery code into 5 shares, any 3 recover it (demo seed)

curl -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"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "shamir-secret-sharing": { "type": "http", "url": "https://shamirsecretsharing.usefulweb.site/mcp" }
  }
}