Most descriptions of and implementations of Shamir secret sharing are a bit intimidating. If however you just need a system where any two people with shares can reconstruct the secret then SSS can be very short and simple.
Let
a0 = the secret
p = a prime number > a0
a1 = a random integer in [1, p-1]
Assign each person who is to receive a share of the secret an ID in [1, p-1]. It is OK to simply assign IDs sequentially starting at 1.Here is how to generate the share for the person with ID i:
Si = (a0 + i*a1) % p
Tell each person their ID and given them their share. When each person has received their ID and share you can delete a0 and a1.To recover the secret given Si from person with ID i and Sj from person with ID j, do this in Python 3.8 or later:
a0 = ((j*Si - i*Sj) * pow(j-i, -1, p)) % p
Pow(x, -1, m) for integers x and m in Python >= 3.8 computes the modular inverse of x mod m.If you need to generate a share for a new person or regenerate a share for an existing person get shares from two people and recover a0 as described above. Recover a1 like this:
a1 = ((Sj - Si) * pow(j-i, -1, p)) % p
You can then use a0 and a1 to issue or reissue shares as described earlier.