Shamir's Secret Sharing Visualizer

Visualize how a secret can be split and reconstructed using polynomials.

1. Configuration

2. Select Shares

Selected: 0

Generate a polynomial to see shares.

Click shares to toggle selection. You need at least k shares.

3. Reconstruct Secret

Result will be shown here.

Polynomial Visualization

Secret Available Share Selected Share
Welcome! Press "Generate" to begin.

How It Works: The Intuition Behind the Magic

This tool demonstrates Shamir's Secret Sharing, a cryptographic algorithm by Adi Shamir. It solves a critical problem: how do you secure vital information without a single point of failure?

The Problem: The "Key Under the Doormat" Dilemma

Imagine a treasure chest key. Hiding it creates a single point of failure. If you lose it, or the person holding it is unavailable, the treasure is lost. Cutting it in half doesn't work.

Shamir's scheme splits a "key" (the secret number) into multiple parts, called shares, with two special properties:

  1. A specific number of shares (the threshold `k`) must combine to recreate the key.
  2. Anyone with fewer shares has absolutely no information about the key.

The Solution: High School Math!

The solution uses a simple geometric fact: "It takes two points to define a unique line, three points to define a unique parabola, and so on."

  • The Secret is a Point: The secret number is the y-intercept of a graph (the red dot at x=0).
  • A Random Curve is Drawn: The algorithm generates a random polynomial (a curve) of degree `k-1` that passes through the secret point.
  • Shares are Other Points: The shares given out are just other points on that same secret curve.

To find the secret, you just need enough points (`k`) to uniquely identify the curve. With too few points, the secret is perfectly hidden among infinite possibilities.