{
  "id": "shamir-secret-sharing",
  "title": "Shamir Secret Sharing",
  "lang": "en",
  "source_lang": "en",
  "summary": "Shamir secret sharing divides a secret into shares so that a threshold number reconstructs it, while fewer shares reveal no information about it.",
  "category": "computer-science",
  "subcategory": "networks-security",
  "type": "concept",
  "aliases": [
    "Shamir’s secret sharing",
    "Shamir threshold scheme",
    "Shamir’s threshold scheme",
    "SSS"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/shamir-secret-sharing/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/shamir-secret-sharing/",
      "json": "https://aiwiki.page/zh/shamir-secret-sharing.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Shamir secret sharing is a cryptographic scheme that divides a secret into \\(n\\) shares so that any \\(t\\) distinct shares can reconstruct it, while fewer than \\(t\\) shares reveal no information about the secret. Introduced by Adi Shamir in 1979, it is a threshold secret-sharing scheme based on evaluating a randomly chosen polynomial over a finite field. Its confidentiality guarantee is information-theoretic: under the scheme’s assumptions, even unlimited computing power cannot extract information about the secret from an insufficient number of shares."
    },
    {
      "heading": "Threshold model",
      "text": "A \\((t,n)\\) scheme has a reconstruction threshold \\(t\\) and a total of \\(n\\) shares, with \\(1\\leq t\\leq n\\). The threshold determines both confidentiality and availability:\n\n- Reconstruction: any set of at least \\(t\\) valid, distinct shares determines the secret.\n- Privacy: any set of fewer than \\(t\\) shares has a distribution independent of the secret.\n- Loss tolerance: as many as \\(n-t\\) shares may be lost without preventing reconstruction, provided the remaining shares are valid.\n\nFor example, a \\((3,5)\\) scheme allows any three of five custodians to recover a secret, while one or two custodians learn nothing about its value from their shares alone.\n\nThe basic construction assumes an honest dealer: an entity that knows the secret, creates the shares correctly, and distributes them confidentially to their intended holders. It does not by itself verify that the dealer behaved honestly or that participants later submit correct shares."
    },
    {
      "heading": "Mathematical construction",
      "text": "Choosing the field and polynomial\n\nThe scheme operates over a finite field \\(\\mathbb{F}_q\\), containing \\(q\\) elements, where \\(q\\) is a prime power. The secret must be represented as an element \\(s\\in\\mathbb{F}_q\\). There must also be enough nonzero field elements to assign a distinct evaluation point to each participant, so \\(n\\leq q-1\\).\n\nA simple version uses arithmetic modulo a prime \\(p\\). The dealer independently samples \\(t-1\\) uniformly random field elements,\n\n\\[a_1,a_2,\\ldots,a_{t-1},\\]\n\nand defines the polynomial\n\n\\[f(x)=s+a_1x+a_2x^2+\\cdots+a_{t-1}x^{t-1}.\\]\n\nThus, the secret is the constant term:\n\n\\[f(0)=s.\\]\n\nThe polynomial has degree at most \\(t-1\\). All coefficients, including the highest one, are sampled from the entire field; it is not necessary to force the highest coefficient to be nonzero.\n\nCreating shares\n\nThe dealer chooses distinct, nonzero public coordinates \\(x_1,\\ldots,x_n\\). Participant \\(i\\) receives\n\n\\[(x_i,y_i),\\qquad y_i=f(x_i).\\]\n\nThe coordinate identifies the evaluation point and need not be secret. When coordinates are fixed by a protocol, a share may contain only \\(y_i\\), with its coordinate supplied by the participant’s identifier.\n\nZero cannot be used as an ordinary share coordinate because \\(f(0)\\) is the secret itself. Repeated coordinates do not provide additional independent shares.\n\nReconstructing the secret\n\nAny \\(t\\) evaluations at distinct coordinates uniquely determine a polynomial of degree at most \\(t-1\\). Using Lagrange interpolation, reconstruction can evaluate that polynomial directly at zero without explicitly recovering every coefficient.\n\nFor a set \\(I\\) of \\(t\\) share indices,\n\n\\[s=f(0)= \\sum_{i\\in I} y_i \\prod_{\\substack{j\\in I\\\\j\\ne i}} \\frac{-x_j}{x_i-x_j}.\\]\n\nEvery operation takes place in the chosen field. Division means multiplication by a multiplicative inverse, not ordinary integer division. The denominators are nonzero because the coordinates are distinct."
    },
    {
      "heading": "Worked example",
      "text": "Consider a \\((3,5)\\) scheme over \\(\\mathbb{F}_{17}\\), with secret \\(s=5\\). Suppose the dealer’s randomly chosen coefficients are \\(3\\) and \\(2\\), giving\n\n\\[f(x)=5+3x+2x^2\\pmod{17}.\\]\n\nThe resulting shares are:\n\nCoordinate \\(x_i\\) | Share value \\(f(x_i)\\)\n1 | 10\n2 | 2\n3 | 15\n4 | 15\n5 | 2\n\nEqual share values at different coordinates are permitted; the coordinates, rather than the values, must be distinct.\n\nFor coordinates \\(1,2,3\\), the Lagrange coefficients at zero are \\(3,-3,1\\). Therefore,\n\n\\[s=3(10)-3(2)+15=39\\equiv5\\pmod{17}.\\]\n\nTwo shares do not determine the secret. For every candidate secret in \\(\\mathbb{F}_{17}\\), exactly one polynomial of degree at most two has that constant term and passes through the two specified points. Because the original coefficients were sampled uniformly, none of these candidate secrets is favored by observing those two shares.\n\nThe small field in this example is illustrative; actual field sizes and encodings depend on the application."
    },
    {
      "heading": "Why fewer shares reveal nothing",
      "text": "The privacy guarantee is stronger than saying that reconstruction is computationally difficult. An unauthorized set of shares does not change the probability distribution of the secret.\n\nSuppose an observer obtains \\(k<t\\) shares. For every possible secret \\(s\\), exactly\n\n\\[q^{t-1-k}\\]\n\ncoefficient vectors produce the observed share values. Consequently, the probability of observing those shares is the same for every secret.\n\nWriting \\(S\\) for the secret and \\(Y_A\\) for a set of fewer than \\(t\\) shares,\n\n\\[\\Pr(S=s\\mid Y_A=y)=\\Pr(S=s)\\]\n\nwhenever the conditioning event has positive probability. This is perfect secrecy for unauthorized sets.\n\nThe guarantee does not require the secret itself to be uniformly distributed. It means that the shares add no information beyond an observer’s prior knowledge. Other disclosures—such as a public check value, exposed application data, or leakage from a device—can still reveal information independently of the sharing scheme.\n\nExact information-theoretic privacy assumes uniform, independent coefficient randomness. An implementation using a cryptographic pseudorandom number generator instead relies on that generator’s computational security for its approximation to ideal randomness."
    },
    {
      "heading": "Efficiency and storage",
      "text": "Each share contains one field element of secret-dependent data, plus its coordinate and any protocol metadata. When the secret is one field element, this makes Shamir sharing an ideal secret-sharing scheme: a share’s field-element payload is the same size as the secret.\n\nHowever, the total storage across all \\(n\\) participants is approximately \\(n\\) times the secret’s size, excluding metadata. Sharing is not compression.\n\nStraightforward polynomial evaluation takes \\(O(nt)\\) field operations to generate all shares. Direct Lagrange reconstruction takes \\(O(t^2)\\) field operations, although precomputed coefficients and faster algorithms can improve particular workloads.\n\nLong secrets can be divided into field-sized blocks and shared block by block, using fresh independent coefficient randomness for each block. Another common design encrypts a larger object and shares only its encryption key. In that design, confidentiality of the object also depends on the encryption scheme and key handling."
    },
    {
      "heading": "Applications and extensions",
      "text": "Distributed custody and recovery\n\nShamir sharing supports threshold custody of cryptographic keys and recovery secrets. It can distribute recovery authority across people, devices, organizations, or locations rather than placing it in one repository.\n\nUnlike ordinary backup, possession of one copy-like object does not necessarily permit recovery. Unlike splitting a file into consecutive fragments, each subthreshold collection reveals nothing about the shared value under the mathematical assumptions.\n\nSecure multiparty computation\n\nShamir shares can represent intermediate values in secure multiparty computation, allowing participants to compute jointly without first reconstructing their private inputs.\n\nThe scheme is linear. If \\(f\\) and \\(g\\) share secrets \\(s\\) and \\(r\\) over the same coordinates, then participants can locally add their share values to obtain shares of \\(s+r\\):\n\n\\[f(x_i)+g(x_i)=(f+g)(x_i).\\]\n\nMultiplication by a public constant is similarly local. Multiplying two shared values is more involved because multiplying their polynomials increases the degree and generally requires an additional protocol.\n\nThreshold cryptography\n\nIn threshold cryptography, multiple participants jointly perform operations such as signing or decryption without reconstructing the complete private key at one location.\n\nShamir sharing is often a building block, but sharing a key alone does not create a threshold signature or threshold decryption protocol. Such systems require additional mechanisms for computation, verification, randomness, and adversarial behavior.\n\nVerifiable and proactive sharing\n\nVerifiable secret sharing adds mechanisms for checking that distributed shares are consistent with a suitable sharing of a secret. The resulting guarantees and assumptions depend on the protocol.\n\nProactive secret sharing periodically refreshes shares without changing the secret. A basic refresh adds evaluations of a fresh random polynomial whose constant term is zero. Protection against an adversary that compromises participants over time depends on the refresh protocol, corruption limits, and effective erasure of obsolete shares."
    },
    {
      "heading": "Limitations and implementation concerns",
      "text": "Confidentiality does not provide integrity\n\nBasic Shamir sharing does not authenticate shares or detect malicious replacements. With exactly \\(t\\) distinct-coordinate submissions, even an incorrect value determines some interpolating polynomial and therefore some reconstructed result.\n\nMessage authentication codes, digital signatures, or verifiable-sharing protocols can provide additional checks, depending on the trust model. Authentication establishes a share’s origin and integrity; it does not necessarily prove that a malicious dealer generated it consistently.\n\nShamir shares are closely related to Reed–Solomon codes. If \\(m\\) submitted evaluations contain at most \\(e\\) erroneous values and\n\n\\[m\\geq t+2e,\\]\n\nsuitable decoding algorithms can uniquely recover the degree-at-most-\\(t-1\\) polynomial. Ordinary interpolation alone does not provide this correction.\n\nField arithmetic and encoding\n\nArithmetic over arbitrary integers, composite moduli, or floating-point numbers is not interchangeable with finite-field arithmetic. Composite moduli can leave nonzero denominators without inverses, while floating-point calculations introduce rounding and do not preserve the scheme’s security argument.\n\nFormats must unambiguously identify the field, threshold, coordinates, and sharing instance. Without this context, shares from different secrets or refresh periods may be accidentally combined.\n\nRandomness and correlated disclosures\n\nPredictable or biased coefficients can undermine confidentiality. Reusing coefficients across different secrets can expose relationships between them. For example, if two sharing polynomials differ only in their constant terms, subtracting their evaluations at the same coordinate reveals the difference between the secrets.\n\nOperational trust boundaries\n\nThe threshold protects against obtaining too few valid shares; it does not prevent an authorized threshold coalition from reconstructing the secret. Nor does it protect a secret after reconstruction on a compromised device.\n\nShares held under common administrative control, stored together, or exposed through the same infrastructure may fail together. Consequently, the effective protection depends on the system’s threat model, distribution of custody, transport security, and handling of reconstructed secrets—not only on the numerical threshold."
    }
  ],
  "links": [
    "cryptography",
    "finite-field",
    "polynomial",
    "polynomial-interpolation",
    "perfect-secrecy",
    "pseudorandom-number-generator",
    "data-compression",
    "encryption",
    "data-backup",
    "message-authentication-code",
    "digital-signature",
    "reed-solomon-code"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}