Shamir's secret sharing scheme

Let’s consider a scenario where it’s essential to secure a bank vault. It is regarded as completely inaccessible without the key, which you are issued on your first day of work. Your goal is to ensure the key's security.

Suppose you decide to keep the key with you at all times, granting access to the vault as needed. But you will quickly realize that this solution does not scale well in practice, as every time the vault needs to be opened, your physical presence is required. What about the vacation you were promised? Even more alarming is the question: what if you lose the only key?

Thinking about the vacation, you decide to make a copy of the key and entrust it to another employee. However, you understand that this isn’t ideal either. Doubling the number of keys also doubles the opportunities for a key to be stolen.

Desperate, you destroy the duplicate and decide to split the original key in half. Now, you think, two trusted individuals with key fragments must be physically present to assemble the key and unlock the vault. This means a thief needs to steal both fragments, making it twice as hard to steal one key. However, you soon realize this scheme is not much better than having a single key since if someone loses half of the key, the complete key cannot be recovered.

The problem can be addressed with a series of additional keys and locks, but such an approach will quickly require many keys and locks. You conclude that an ideal scheme should split the key so that security does not rely entirely on one person. You also conclude that there should be some threshold number of fragments, such that if one fragment is lost (or someone goes on vacation), the entire key remains functional.

How to split a secret

This type of key management scheme was conceived by Adi Shamir in 1979, when he published his work "How to Share a Secret". The paper briefly explains the so-called Shamir's secret sharing scheme threshold scheme for effectively dividing a secret value (e.g., a cryptographic key) into Shamir's secret sharing scheme parts. Then, when and only when at least Shamir's secret sharing scheme from Shamir's secret sharing scheme parts are gathered, the secret can be easily reconstructed. Shamir's secret sharing scheme.

From a security perspective, an important property of this scheme is that an attacker should not learn anything at all unless they have at least Shamir's secret sharing scheme pieces. Even having Shamir's secret sharing scheme pieces should not provide any information. We call this property semantic security..

Polynomial Interpolation

Shamir's threshold scheme Shamir's secret sharing scheme is built around the concept of polynomial interpolation.If you are not familiar with this concept, it is actually quite simple. In general, if you have ever plotted points on a graph and then connected them with lines or curves, you have already used it!

Shamir's secret sharing scheme
Through two points, an unlimited number of degree 2 polynomials can be drawn. To select a single one from them, a third point is needed. Illustration: Wikipedia

Let's consider a polynomial of degree one, Shamir's secret sharing scheme. If you want to plot this function on a graph, how many points do you need? Well, we know that it is a linear function that forms a line, so at least two points are necessary. Next, consider a polynomial function of degree two, Shamir's secret sharing scheme. This is a quadratic function, so at least three points are required to plot the graph. How about a polynomial of degree three? At least four points. And so on and so forth.

The really cool thing about this property is that, given the degree of the polynomial function and at least Shamir's secret sharing scheme points, we can derive additional points for this polynomial function. The extrapolation of these additional points is called polynomial interpolation..

Secret Sharing

You might have already realized that the clever Shamir scheme comes into play here. Let's assume that our secret Shamir's secret sharing scheme — this is Shamir's secret sharing scheme. We can turn Shamir's secret sharing scheme into a point on the graph Shamir's secret sharing scheme and create a polynomial function of degree Shamir's secret sharing scheme, which satisfies this point. Remember that Shamir's secret sharing scheme will be our threshold of required pieces, so if we set the threshold to three pieces, we need to choose a polynomial function of degree two.

Our polynomial will take the form of Shamir's secret sharing scheme, where Shamir's secret sharing scheme and Shamir's secret sharing scheme — randomly chosen positive integers. We are simply constructing a polynomial of degree Shamir's secret sharing scheme, where the constant term Shamir's secret sharing scheme is our secret Shamir's secret sharing scheme, and each subsequent Shamir's secret sharing scheme members have a randomly chosen positive coefficient. If we return to the original example and assume that Shamir's secret sharing scheme, then we will obtain a function Shamir's secret sharing scheme.

At this stage, we can generate fragments by connecting Shamir's secret sharing scheme unique integers in Shamir's secret sharing scheme, where Shamir's secret sharing scheme (because this is our secret). In this example, we want to distribute four fragments with a threshold of three, so we randomly generate points Shamir's secret sharing scheme and send one point to each of the four trusted individuals, the key custodians. We also inform the individuals that Shamir's secret sharing scheme, as this is considered public information and is necessary for recovery Shamir's secret sharing scheme.

Secret Recovery

We have already discussed the concept of polynomial interpolation and that it underlies Shamir's threshold scheme Shamir's secret sharing scheme. When any three of the four trusted parties want to recover Shamir's secret sharing scheme, they only need to interpolate Shamir's secret sharing scheme with their unique points. To do this, they can determine their points Shamir's secret sharing scheme and calculate the Lagrange interpolation polynomial using the following formula. If programming is clearer to you than mathematics, then pi is essentially an operator for, which multiplies all results, while sigma is for, which sums everything up.

Shamir's secret sharing scheme

Shamir's secret sharing scheme

Upon Shamir's secret sharing scheme we can solve this as follows and return our original polynomial function:

Shamir's secret sharing scheme

Since we know that Shamir's secret sharing scheme, recovery Shamir's secret sharing scheme is straightforward:

Shamir's secret sharing scheme

Using insecure integer arithmetic

Although we successfully applied the core idea of Shamir Shamir's secret sharing scheme, we have a problem that we have ignored until now. Our polynomial function uses insecure integer arithmetic. Keep in mind that for each additional point the attacker gets on the graph of our function, fewer possibilities remain for other points. You can see this for yourself when you plot the graph with an increasing number of points for the polynomial function using integer arithmetic. This is counterproductive to our stated security goal because an attacker should not learn anything at all until they have at least Shamir's secret sharing scheme fragments.

To demonstrate how weak the scheme with integer arithmetic is, consider a scenario in which an attacker obtained two points Shamir's secret sharing scheme and knows the public information that Shamir's secret sharing schemeFrom this information, one can deduce Shamir's secret sharing scheme, equal to two, and plug known values into the formula Shamir's secret sharing scheme and Shamir's secret sharing scheme.

Shamir's secret sharing scheme

Then an attacker can find Shamir's secret sharing scheme, calculating Shamir's secret sharing scheme:

Shamir's secret sharing scheme

Since we have defined Shamir's secret sharing scheme as randomly chosen positive integers, there are a limited number of possible Shamir's secret sharing scheme. With this information, an attacker can derive Shamir's secret sharing scheme, since anything greater than 5 will make Shamir's secret sharing scheme negative. This turns out to be true, as we have defined Shamir's secret sharing scheme

Then an attacker can calculate possible values Shamir's secret sharing scheme, replacing Shamir's secret sharing scheme downward API support (simultaneously with this in Shamir's secret sharing scheme:

Shamir's secret sharing scheme

With a limited set of options for Shamir's secret sharing scheme it becomes clear how easy it is to guess and verify values Shamir's secret sharing scheme. There are only five options here.

Solving the problem of unsafe integer arithmetic

To eliminate this vulnerability, Shamir suggests using modular arithmetic by replacing Shamir's secret sharing scheme to Shamir's secret sharing scheme, where Shamir's secret sharing scheme and Shamir's secret sharing scheme — the set of all prime numbers.

Let's quickly recall how modular arithmetic works. Clock hands are a familiar concept. It uses a clock that is Shamir's secret sharing scheme. Once the hour hand passes twelve, it resets back to one. An interesting property of this system is that just by looking at the clock, we cannot determine how many full rotations the hour hand has made. However, if we know the hour hand has passed 12 four times, we can fully determine the number of hours that have passed with a simple formula Shamir's secret sharing scheme, where Shamir's secret sharing scheme — this is our divisor (here, Shamir's secret sharing scheme), Shamir's secret sharing scheme — this is the coefficient (how many times the divisor fits into the original number without a remainder, here, Shamir's secret sharing scheme), and Shamir's secret sharing scheme — this is the remainder, which is usually returned by the modulo operator call (here, Shamir's secret sharing scheme). Knowing all these values allows us to solve the equation for Shamir's secret sharing scheme, but if we skip the coefficient, we will never be able to recover the original value.

We can demonstrate how this enhances the security of our scheme by applying the scheme to our previous example and using Shamir's secret sharing scheme. Our new polynomial function Shamir's secret sharing scheme, and the new points Shamir's secret sharing scheme. Now, the key holders can once again use polynomial interpolation to recover our function, but this time the operations of addition and multiplication must be accompanied by reduction modulo Shamir's secret sharing scheme (e.g. Shamir's secret sharing scheme).

Using this new example, suppose the attacker learned two of these new points, Shamir's secret sharing scheme, and the public information Shamir's secret sharing schemeThis time, the attacker uses all the information available to him to derive the following functions, where Shamir's secret sharing scheme is the set of all positive integers, and Shamir's secret sharing scheme represents the modulus coefficient Shamir's secret sharing scheme.

Shamir's secret sharing scheme

Now our attacker finds himself again Shamir's secret sharing scheme, calculating Shamir's secret sharing scheme:

Shamir's secret sharing scheme

Then he tries again to derive Shamir's secret sharing scheme, replacing Shamir's secret sharing scheme downward API support (simultaneously with this in Shamir's secret sharing scheme:

Shamir's secret sharing scheme

This time he has a serious problem. The formula lacks values Shamir's secret sharing scheme, Shamir's secret sharing scheme and Shamir's secret sharing scheme. Since there are an infinite number of combinations of these variables, he cannot obtain any additional information.

Security considerations

Shamir's secret sharing scheme offers security from the perspective of information theory. This means the mathematics is robust even against an attacker with unlimited computational power. However, the scheme still contains several known issues.

For example, Shamir's scheme does not create verifiable shares, meaning that individuals can freely present counterfeit shares and hinder the recovery of the correct secret. A malicious share holder with sufficient information could even produce another share by altering Shamir's secret sharing scheme at will. This issue is addressed by verifiable secret sharing schemes, such as Feldman's scheme.

Another problem is that the length of any share is equal to the length of the corresponding secret, making it easy to determine the length of the secret. This issue is solved through trivial padding the secret with arbitrary numbers to a fixed length.

Finally, it is important to note that our security concerns may extend beyond the scheme itself. For real cryptographic applications, there is often a threat of side-channel attacks, where an attacker attempts to extract useful information from application runtime, caching, failures, etc. If this is a concern, protective measures such as constant-time functions and searches should be carefully considered during development to prevent memory from being written to disk and to think about a number of other things that go beyond this article.

Demo

At this page There is an interactive demonstration of Shamir's secret sharing scheme. The demonstration is based on the ssss-jslibrary, which is itself a JavaScript port of the popular program ssssPlease note that computing large values Shamir's secret sharing scheme, Shamir's secret sharing scheme and Shamir's secret sharing scheme may take some time.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster