Shamir’s Secret Sharing is an algorithm in cryptography created by Adi Shamir. It is a form of secret sharing, where a secret is divided into parts, giving each participant its own unique part. To reconstruct the original secret, a minimum number of parts is required.
Suppose we want to use a threshold scheme to share our secret , where ; and is a prime number.
Choose random positive integers with . Build the polynomial
Let us construct any n points out of it, for instance set to retrieve . Every participant is given a point (a non-zero integer input to the polynomial, and the corresponding integer output) along with the prime which defines the finite field to use. Given any subset of of these pairs , we can find the coefficients of the polynomial using interpolation. The secret is the constant term .
Example:
Enter message:1155112410
Enter n:5
Enter k:3
P: 1155112423
Secret:
(1, 452597065)
(2, 216943235)
(3, 448150920)
(4, 1146220120)
(5, 925989)