# Threshold recovery, secrecy and authenticity

A reconstruction threshold is not a confidentiality guarantee. This finite
example compares three mechanisms without handling real secrets.

## Method and results

All arithmetic is modulo 17. For a secret s and coefficient a, a share at
coordinate x is y = s + a*x. Coordinates are 1, 2 and 3. Enumerate every
secret and coefficient in 0..16, then each of the three coordinate pairs.

| Check | Denominator | Result |
| --- | --- | --- |
| Two-share reconstruction | 17 secrets x 17 coefficients x 3 pairs | 867 correct |
| Single-share likelihood, zero included | 3 coordinates x 17 observations | All 51 retain every secret with one compatible coefficient each |
| Single-share likelihood, zero excluded | Same 51 observations, coefficient in 1..16 | Every observation rules out one secret |
| Alter one share | One specified constructed case | Reconstruction changes from 7 to 6 without an authentication error |

For the zero-excluded variant, observing y rules out s = y at any nonzero x.
That is information leakage even though all pairs generated by this variant
still recover their input. With the full uniform coefficient distribution,
each observation has probability 1/17 for every fixed secret; this equality
preserves any prior secret distribution, not only a uniform prior.

In the independent systematic code example, payload (u,v) is stored as
(u,v,u+v). Any two fragments recover the payload, but a data fragment directly
reveals one payload symbol. The secret-sharing example stores one payload
symbol in three shares, whereas this code stores two in three fragments.
They are not equal-rate storage alternatives.

## Scope

This is an exhaustive, deterministic teaching example, not a production
cryptographic library, randomness generator, performance benchmark or
POTSHARDS implementation. It does not implement share authentication,
secure erasure, proactive refreshing, archive placement or recovery protocols.
The modified-share case establishes that basic interpolation is not
authentication; it does not evaluate a protocol with authenticated shares.

Shamir's [original paper](https://web.mit.edu/6.857/OldStuff/Fall03/ref/Shamir-HowToShareASecret.pdf),
section 2, specifies uniform coefficients over the full field, including zero.
POTSHARDS is documented separately in the [corpus](https://hesela.dev/terms/potshards/);
its [2007 paper](https://www.usenix.org/legacy/event/usenix07/tech/full_papers/storer/storer.pdf)
must be assessed at the archive-protocol level as well as the sharing layer.

## Reproduce

Use Node.js 22 or later with no extra packages:

```sh
node model.mjs --check
node --test model.test.mjs
```

Files: [model](model.mjs), [tests](model.test.mjs),
[complete results](results.json), [source metadata](sources.json).
Run `node model.mjs --write` to regenerate the result file.
No sampling, seed or confidence interval is applicable to this enumeration.
