How Shamir's Secret Sharing Works

Hacker News Top Tools

Summary

Explains how Shamir's Secret Sharing works using geometric intuition, and mentions its use in Ente's Legacy Kit for secure secret recovery.

No content available
Original Article
View Cached Full Text

Cached at: 05/26/26, 12:50 AM

# How Shamir's Secret Sharing Works Source: [https://ente.com/blog/how-shamirs-secret-sharing-works/](https://ente.com/blog/how-shamirs-secret-sharing-works/) Some secrets are too important to trust to one person, and too important to lose if that person disappears\. A company wants three officers present before the master key is used\. A family wants account recovery to need more than one envelope\. A team wants a backup that survives a missing member without handing anyone the whole thing\. Adi**S**hamir \(the**S**in R**S**A\), published a way to do this in 1979\. Split a secret into pieces so that some number of them can recover it, and any smaller number reveals nothing at all\. Not "is hard to crack\." Reveals nothing\. The core idea fits on a page\. ## Two points make a line Start with something you already know: two distinct points determine exactly one straight line\. A single point does not\. Infinitely many lines pass through one point, and each line crosses the vertical axis somewhere different\. ![Two points fix one line; one point allows infinitely many.](https://ente.com/how-shamirs-secret-sharing-works/images/01-two-points-one-line.svg) Now hide a secret where a line crosses the vertical axis\. Say the secret is the number 7\. Draw a random line through that height\. The slope is not important\. It is just randomness that hides the secret\. ![A line y = 2x + 7. The secret, 7, sits where it crosses the y-axis.](https://ente.com/how-shamirs-secret-sharing-works/images/02-secret-at-y-axis.svg) Give each person one point from the line\. Nobody gets the line itself\. A person with one point can draw many possible lines through it\. Each line implies a different secret\. Their share is compatible with every possible answer, so it tells them nothing useful by itself\. ![Bob holds one share. Many candidate lines pass through it, each implying a different secret.](https://ente.com/how-shamirs-secret-sharing-works/images/03-one-friend-alone.svg) Put two points together and the line is fixed\. Once you know the line, you can read the secret from where it crosses zero\. ![Alice and Bob's shares together pin down the line and reveal the secret.](https://ente.com/how-shamirs-secret-sharing-works/images/04-two-friends-together.svg) That is a 2\-of\-n secret sharing scheme\. You can create as many points as you want, but any two are enough to recover the line\. ## More people means more bend For a higher threshold, use a curve with more bend\. A parabola needs three points to determine it\. So if the secret is hidden where the parabola crosses the vertical axis, any three shares can recover the secret and any two cannot\. ![A parabola needs three points to determine; the secret sits at x = 0.](https://ente.com/how-shamirs-secret-sharing-works/images/05-parabola-three-of-five.svg) In general, a threshold of`k`uses a polynomial of degree`k \- 1`\. - 2 shares: a line - 3 shares: a parabola - 4 shares: a cubic Real implementations use finite\-field arithmetic rather than graph paper, but the shape of the idea is the same\. The secret is the value at zero\. The random coefficients hide it\. Each share is one point on the polynomial\. The useful part is not that the secret is hard to compute from too few shares\. It is that too few shares contain no information about the secret\. With one share missing, every possible secret is still possible\. ## Why we care We use this idea in Ente's[Legacy Kit](https://ente.com/blog/legacy-kit)\. Although, our problem was not just "how do we split a secret?", but also "how do we make recovery possible without turning the split secrets into a permanent recovery key?" Legacy Kit uses Shamir's scheme as one layer inside a larger flow\. The cards don't carry the recovery key\. They reconstruct a separate secret locally, which then participates in a server\-mediated recovery — so issued cards can be revoked, and a lost card is not a permanent liability\. This post is only the math behind the "any two, never one" part\. ## Further reading - [Adi Shamir's "How to Share a Secret"](https://cacm.acm.org/research/how-to-share-a-secret/) - [Bruce Schneier's "Sharing Secrets Among Friends"](https://www.schneier.com/essays/archives/1992/04/sharing_secrets_amon.html) - [Max Levchin's PayPal story](https://max.levch.in/post/724289457144070144/shamir-secret-sharing-its-3am-paul-the-head-of) - [Ente's source code](https://github.com/ente-io/ente)

Similar Articles

Introduction to Beaver Triples

Hacker News Top

The article introduces the concept of Beaver Triples in the context of Secure Multi-Party Computation (MPC) using a practical example of friends privately deciding on a restaurant. It explains how secret sharing allows participants to compute group-level scores based on private inputs without revealing individual data.

Unknowable Math Can Help Hide Secrets

Hacker News Top

A new type of zero-knowledge proof leverages Gödel's incompleteness theorems to overcome previous limitations of secrecy, establishing a striking connection between mathematical logic and cryptography.

Hidden-State Privacy Has an Empty Middle

arXiv cs.LG

This paper demonstrates that Gaussian releases of transformer hidden states cannot simultaneously achieve moderate privacy and utility, proving an 'empty middle' and proposing a split-memory architecture to overcome this limitation.

claude-share

Product Hunt

A tool to securely share Claude Code sessions with friends.

Hidden Thoughts Are Not Secret: Reasoning Trace Exposure in LLMs

arXiv cs.AI

This paper introduces Reasoning Exposure Prompting (REP), a method that uses shadow-model demonstrations in code-like formats to elicit hidden reasoning traces from LLMs, showing that interface-level trace hiding is insufficient to prevent extraction of useful reasoning signals.