The Reed-Solomon erasure code uses the same math in 1960.

When s is a finite subset of the field values and y(t) is the value of the polynomial for each t in s, Lagrange’s formula is:

p(x) = Σ[t in s] ((y(t))
(Π[j in s but not t] (x − j))/
(Π[j in s but not t] (i − j))).

For some q and n Shamir showed how to code a small secret S, such as an encryption key, in n values, called *shares* of the same size as S so that any subset of q of those values can be combined to easily compute S.
Of course 0 < q ≤ n.
In both the programs below `split` produces the shares and `join` retrieves the secret.

Warning!! We use the stock random number generator. You must replace it if you really want to keep a secret!!

67 is prime and 67^{4} > 2^{24}.
We use GF(67), the field of integers modulo 67.
We want to produce k<67 versions of a secret so that we may
reconstruct the message when q (0<q<k) versions of the secret are
available. (“q” for quorum).
Here is the code for the fields GF(67).

and for GF(2^{8}) = GF(256).