Crypto Journal Part I : Secret Sharing

how to decentralize the non-evident - why more means less

I wrote this blogpost on an 18 hour trip :) that I take once or twice a year to go home . I’ve been lately spending more time studying the mathematical foundations of cryptography, and a blog was deemed necessary to move from the theoretical to the intuitive.

Cryptography started as a casual reading and puzzles,then it became a target and now a passion .

In a series of blogpost I’ll try to explain in an intuitive way what I find the most interesting parts in cryptography I have no idea how long the series will span but let’s just say that it would be at least 3 blogposts long .

Secret Sharing

Secret Sharing is exactly how it sounds like , how do you share a secret among a group without any participant knowing the secret as a whole . It was invented by Adi Shamir (The S in RSA) and George Blakley independently in 1979 invented mean the creation of a viable scheme for the process. Both schemes Shamir Secret Sharing and Blakley’s are based on mathematical intuition . We will do the same start from the intuitive explanation moving to explaining both schemes .

Secret Sharing enables you (for ex) to split your Ethereum private key between n persons and set a threshold t of necessary parts to reconstruct it back . And from this principle we can think of multiple applications in the field of MPC or even Blockchains .

Intuition

Emm do you see it ? Suppose your secret is 5 the straight line above has a parametric equation y = x+5 And to evaluate your secret you need to compute f(0) = 5 .

So if a person knows one point for example f(4) = 9 he can’t compute f(0) it can be anything . Now we can share the secret which is 5 into two parts :

And give each one to a different person .

What we did here is pick a straight line such as f(0) is equal to our secret we pick two random numbers from the line and give them to two other parties . Now you may ask me but how do I reconstruct the secret from those two ? And I’ll tell you to plot the points on a graph :) or find the slope because the secret is actually the y-intercept .

Now that we have an intuition let’s make things harder for our adversary,let’s make it more complex . What if instead of choosing a straight line you want to use something more difficult , more curved ? :

polynome

The graph above is of a quadratic function and f(x) = 5

deeper

The equation of the above function is :

A Quadratic function is also refeered to as a second degree polynomial , and to find the secret you need at least 3 points (since 3 points determine one quadratic line).

Remember our secret is f(0) let’s split it among 3 participants we can do even four or more but the least number of shares required , is always the degree of our polynomial + 1 . Why ? Well because to reconstruct it we will use polynomial interpolation and it’s proven that you always need n+1 point to interpolate a polynomial of degree n at most .

Now a polynomial is defined as such :

And for each order or degree k you need k+1 shares at least to retrieve the secret using polynomial interpolation (Lagrange or Hermite depending on the efficiency and complexity of the problem).

I won’t delve into the computational stuff such as the error or the noise or efficiency of which interpolation to use .

Shamir Secret Sharing

The scheme we described above was invented by Adi Shamir let’s describe it in a series of steps :

Shamir scheme is both ideal and efficient and also extendable :

Blakley Scheme

Blakley intuition was beyond the idea of lines but of planes and hyperplanes . A Hyperplane is the vector space K-1 for example :

The hyperplane of the 3D Space is the plane (2D) , the hyperplane of the 2D space is the straight line (1D) .

sec

I won’t go into much detail here because the scheme is rarely used it’s not space efficient (apparently) .

I hope this small intro made you think intuitively about the problem and maybe invent your own scheme :)