Lion Cipher Lab

Implement Shamir's Secret Sharing from scratch (split a secret, prove t-1 shares leak nothing, then catch a tampered share with Feldman VSS)

Why it matters

Secret sharing is how the most important keys in the world are held: no single person can unlock them, and losing a few custodians does not lose the secret. HashiCorp Vault's unseal keys, hardware-security-module master-key ceremonies, and serious crypto-wallet backups all rest on Shamir's 1979 scheme -- split a secret S into n shares so ANY t reconstruct it and ANY t-1 learn NOTHING. That last clause is the magic and the whole reason to use it over 'just encrypt it' (which only moves the problem to one key someone still has to guard) or naive splitting (hand each person a piece of the secret…

What you'll learn

Steps in this lab

  1. What secret sharing is, in one breath
  2. When you'd actually reach for this (and when you would not)
  3. The maths you actually need (kept minimal)
  4. Set up a clean workspace
  5. Implement the split: build the polynomial and hand out shares
  6. Reconstruct with Lagrange interpolation -- and prove ANY t work
  7. Prove the other half: t-1 shares leak NOTHING
  8. Failure mode (a): do the arithmetic over the INTEGERS and it leaks
  9. Failure mode (b): reusing x-coordinates or the polynomial across secrets
  10. Failure mode (c): no verifiability -- and fixing it with Feldman VSS
  11. Failure mode (d): not constant-time, and other side channels
  12. Do it better in the real world: Vault unseal keys and the hybrid pattern
  13. The judgment call: what to carry out of this lab

Open the full interactive lab →