Skip to content

Shamir’s Secret Sharing Online

Shamir’s Secret Sharing is a cryptographic technique invented by Adi Shamir in 1979. It allows a secret (password, private key, seed phrase, etc.) to be split into multiple parts called shares.

This tool provides a fully functional implementation of Shamir’s Secret Sharing. The implementation uses polynomial interpolation over GF(257) with a custom share encoding. Versioned shares record the threshold, share set and encoding, with integrity checks on shares and recovered data. You can find the implementation details here.

Reconstruct Secret

Tool Documentation and Usage

Using this scheme, you can specify:

  • Number of Shares (N) – Total shares to be generated
  • Threshold (K) – Minimum number of shares needed to reconstruct the secret

Coefficients are sampled uniformly across GF(257). Reconstruction requires the recorded threshold of shares from the same generation.

General secret-sharing use cases include:

  • Splitting crypto wallet keys
  • Storing passwords securely
  • Enterprise access control
  • Multi-person authorization

2. Explanation of All Fields in the Form

🔹 Secret

This is the actual sensitive value you want to split. You can enter text, numbers, hex strings, binary, or encoded values depending on the selected mode.

🔹 Mode (UTF-8 / HEX / Binary)

Determines how the secret is interpreted and validated.

  • UTF-8: Normal text input (passwords, phrases, etc.)
  • HEX: Must contain complete hexadecimal byte pairs (0-9, A-F)
  • Binary: Must contain complete eight-bit bytes using only 0 and 1

🔹 Number of Shares (N)

Total number of shares you wish to generate. Example: If N = 5, the tool will produce 5 independent shares.

🔹 Threshold (K)

Minimum shares required to rebuild the secret. If K = 3, any 3 of the total shares can recover the secret.

🔹 Share Outputs

The encoded-values payload in each versioned share contains two components:

  • Index (X) – Position of the share
  • Value (Y) – Computed polynomial output

Example share structure:

SSS1:k:n:mode:set-id:encoded-values:sha256-checksum

The share payload includes a split integrity digest; no public hash of the secret is exposed. Always copy the complete share, including its metadata and checksum.

4. How to Read & Understand Generated Shares

Each share has a unique x coordinate and encoded polynomial values. Public metadata identifies the share set, threshold, total count and mode; payload length also reveals the secret length. The encoded-values component begins with x, followed by polynomial values. An illustrative payload prefix (not a complete share) looks like this:

Share with x = 1 → 00108c0af0f101209304b0d909a

Structure:

  • 001 → X coordinate (share index)
  • 08c0af0f101209304b0d909a → three-hex-digit Y values (polynomial output)

When K shares are combined, polynomial interpolation is performed to find:

S = f(0)
which is the original secret.

This tool performs a custom Shamir-style computation using:

  • Finite field arithmetic over GF(257) in every mode
  • Random polynomial generation:
    f(x) = S + a1x + a2x² + ... + a(k-1)x^(k-1)
  • Evaluation at distinct random x coordinates from 1 to 255
  • SecureRandom coefficients sampled uniformly from 0 through 256
  • Reconstruction using Lagrange interpolation

5. Advantages & Disadvantages

Advantages

  • Threshold-based recovery with uniformly random field coefficients
  • Improves safety of passwords, crypto keys, and sensitive secrets
  • Shares can be distributed among trusted people
  • Based on a well-known scheme; this particular implementation is not certified

Disadvantages

  • If fewer than K valid shares remain, reliable reconstruction is not possible
  • Shares must be stored safely to avoid tampering
  • Not suitable for extremely large secrets without encoding

Real-World Use Cases

  • Splitting a crypto wallet private key among 3–5 people
  • Storing an API key securely across multiple teams
  • Multi-party recovery of master passwords
  • Offline secure backup for seed phrases

7. Frequently Asked Questions (FAQ)

What happens if I lose some shares?
Keep at least K valid shares from the same generation. Fewer shares do not reliably recover the secret. This tool enforces the recorded threshold and checks recovered payload integrity. Checksums do not prove the identity of the share creator.
Are my secrets stored on your server?
Secrets and shares are transmitted to the DevGlan server and processed in memory by the tool. This is not an offline or browser-only implementation.
Can I use this tool for crypto wallet seed phrases?
Secret sharing can be used for seed phrases, private keys and passwords. This tool uses a custom SSS1 format over GF(257), not SLIP-0039 mnemonic shares. SLIP-0039 specifies its own mnemonic encoding, GF(256) arithmetic and group thresholds. SSS1 shares cannot be imported as SLIP-0039 shares; changing the text encoding does not convert between them. Use a compatible implementation for your wallet's backup and recovery workflow. SLIP-0039 specification.
What is the best N and K combination?
Popular combinations include:
  • 5 / 3 – balanced security & recovery
  • 6 / 3 – higher redundancy
  • 8 / 4 – stronger protection
Does UTF / HEX / Binary mode affect security?
Encoding modes change how bytes are represented, not the field arithmetic. All modes use the same GF(257) implementation with uniformly sampled coefficients and versioned share validation.
Does a valid checksum authenticate a share?
No. The SSS1 SHA-256 checksum is unkeyed: it detects accidental changes, but anyone who edits a share can recalculate it. The secret's integrity digest is split inside the payload and checked after reconstruction; it does not prove who created the shares either. These checks are not a MAC or digital signature. Authenticate the source and protect share storage and delivery separately. RFC 2104 describes keyed message authentication.

❤️ Liked this tool?

If it saved you time, consider buying me a coffee to support future improvements.

Help Others Find This

References