4 ms·
I have heard of Shamir's Secret Sharing algorithm a few times in the past six months or so. Today I finally decided to read the Wikipedia page and figure out h
by war1025 6y ago
I have heard of Shamir's Secret Sharing algorithm a few times in the past six months or so.
Today I finally decided to read the Wikipedia page and figure out how it works.
Really neat. Uses the fact that you need `k` points to uniquely define a `k-1` degree polynomial.
So if you want the secret to be recoverable by any `k` pieces, you just need to define a `k-1` degree polynomial and generate a series of points along that curve, with the secret at a known location on the curve
Basically it sets your secret to the polynomial constant term (i.e. the y value for x=0), generates random coefficients for the rest of the polynomial factors, and then computes however many points you requested. The shares are just encoded (x,y) pairs.
There is slightly more complicated math it to better obscure the secret, but in essence that's all it is. I thought that was really neat.