Shamir Secret Sharing Online | Split & Recover Secrets (GF(256))
Password & Security How It Works
This tool implements Shamir's Secret Sharing over GF(256) — the same finite field used in AES encryption. Split a secret into N shares where any K (threshold) shares can reconstruct the original via Lagrange polynomial interpolation, but fewer than K shares reveal absolutely nothing — providing information-theoretic security stronger than any computational scheme. All computation runs 100% in your browser.
Threshold Security Reference
How different (K, N) configurations affect security and recoverability:
| Config | Security Level | Recovery | Use Case |
|---|---|---|---|
2-of-3 | Low | Easy (any 2 of 3) | Simple backup with recovery option |
3-of-5 | Medium | Balanced | Family recovery, team key management |
5-of-9 | High | Harder (need 5 of 9) | Cryptocurrency seed backup |
K-of-N (K>5) | Very High | Requires majority | Enterprise key escrow, HSM backup |
Code Examples
Implement Shamir's Secret Sharing programmatically:
// JavaScript (GF(256) arithmetic)
// Each byte of the secret is split independently.
// For byte b, construct random polynomial f(x) where f(0) = b.
// Share i gets value f(i). Recover via Lagrange interpolation at x=0.
// Using a well-audited library:
import { share, combine } from 'shamir-secret-sharing'
const secret = new TextEncoder().encode('my secret')
const shares = share(secret, 3, 5) // 3-of-5 threshold
const recovered = combine(shares.slice(0, 3)) // any 3 shares # Python (secret-sharing library)
from secret_sharing import split_and_recover
shares = split_and_recover('my secret', 3, 5)
recovered = split_and_recover(shares[:3]) # any 3 shares Security Notes
- Information-theoretic security — fewer than K shares provide zero information about the secret, regardless of computational power.
- Distribute shares physically — never store multiple shares in the same location or transmit them over the network.
- Use K=ceil(N/2)+1 or higher — ensures no single party can reconstruct alone and majority consensus is required.
- Test recovery before relying on it — always verify you can reconstruct the secret from K shares before distributing them.
Related Tools
Looking for a different approach to secret backup? The BIP39 Mnemonic Validator works with crypto seed phrases. To understand the entropy strength of your secrets, try the Entropy Calculator. For encrypting data before splitting, the AES Encrypt/Decrypt tool adds an extra layer of protection.
Frequently Asked Questions
What happens if I have fewer shares than the threshold?
With fewer than K shares, reconstruction is mathematically impossible. An attacker with K-1 shares gains zero information about the secret — every possible secret of the same length remains equally likely. This is called "information-theoretic security" and is stronger than computational security.
What format are the shares in?
Each share is a string in the format "index-hexdata" (e.g., "1-a3f2b1c4"). The index identifies which share number it is (1 to N), and the hex data is the share value. You can copy all shares at once using the "Copy All Shares" button.
What input encodings are supported?
Three encodings for the secret: plain text (UTF-8), hexadecimal, and Base64. The same encoding must be used for both splitting and combining. Shares are always output in hex format regardless of input encoding.
Is this tool safe for production use?
This tool is designed for learning, experimentation, and generating reference values. The implementation uses cryptographically secure random bytes (Web Crypto API) and a well-known GF(256) field. For production secret management, consider dedicated HSM or key management services.
What threshold (K) should I choose?
It depends on your security requirements. K=2 means any 2 shares can recover (simple recovery, lower security). K=3-of-5 means you need 3 out of 5 shares (balanced). Higher K values increase security but make recovery harder if shares are lost. A common choice is K=ceil(N/2)+1.
Privacy: This tool runs entirely in your browser — nothing is uploaded or stored. · Disclaimer: For educational purposes only. Not professional security advice.
More in Password
Password Generator
Generate secure random passwords online with customizable length, character types, symbols, and exclusion rules. Quick presets available.
Password Strength Checker
Check password strength and estimate crack time online. zxcvbn-based entropy analysis, multiple attack scenarios, and pattern recognition.
Passphrase Generator
Generate strong passphrases from random dictionary words online. EFF wordlist, configurable separators, and color-coded strength.
Entropy Calculator
Calculate password and passphrase entropy online. Crack time estimates, character pool analysis, and strength ratings.
KDF Hash Generator
Derive cryptographic keys using PBKDF2, Argon2, or Scrypt online. OWASP 2024 parameters, PHC output, adjustable iterations and memory.