Secret Sharing — Shamir's Scheme
debt(d9/e7/b5/t7)
Closest to 'silent in production until users hit it' (d9); detection_hints.automated is no — the absence of secret sharing is an operational/architectural gap invisible to tooling, only surfaced when the key holder is unavailable in a disaster.
Closest to 'cross-cutting refactor across the codebase' (e7); introducing Shamir's scheme isn't a one-liner — it requires key ceremony procedures, share distribution, custody policy, and recovery testing, touching ops and code paths around the master key.
Closest to 'persistent productivity tax' (b5); custody of shares, rotation, and reconstruction ceremonies impose ongoing process weight across the org, though limited to disaster recovery flows per common_mistakes.
Closest to 'serious trap' (t7); misconception states devs equate it with multi-key encryption, which is fundamentally different — K-1 shares reveal zero info, while multi-encryption needs each key individually, contradicting intuition from familiar crypto.
Also Known As
TL;DR
Explanation
Shamir's Secret Sharing (1979) splits a secret S into N shares using polynomial interpolation — any K shares reconstruct S; K-1 shares reveal nothing (information-theoretic security). Use cases: root CA private keys (3-of-5 ceremony), disaster recovery keys (2-of-3: company safe + lawyer + escrow), cryptocurrency wallet seeds, HSM master keys. AWS CloudHSM and HashiCorp Vault implement secret sharing for key material ceremonies.
Common Misconception
Why It Matters
Common Mistakes
- Threshold K too low (1-of-N) — defeats the purpose
- All shares stored in the same location or with the same person
- Not testing reconstruction before destroying the original
- Using secret sharing for routine operations — it is for disaster recovery, not daily use
Code Examples
// Single root key — single point of failure:
$rootKey = file_get_contents('/etc/app/root.key');
// Compromised: all encrypted data exposed
// Lost: all encrypted data permanently unrecoverable
// Shamir's 3-of-5 distribution:
$shares = SecretSharing::split($rootKey, shares: 5, threshold: 3);
// Share 1: CTO (sealed envelope in office safe)
// Share 2: Company lawyer (offsite)
// Share 3: Company safe (separate location)
// Share 4: Escrow service
// Share 5: Backup HSM
// Any 3 parties must cooperate to reconstruct — no single point of failure