DNS (for Domain Name System) maps human-memorable Internet domains like joyofcryptography.com to machine-readable IP addresses like 104.21.52.139.
The traditional DNS protocol is not authenticated, meaning that a malicious DNS server could answer client queries with incorrect IP addresses.
An extension to DNS, called DNSSEC, adds some cryptographic authentication to the protocol, to prevent this problematic behavior.
DNSSEC requires one “master key,” which holds authority over the entire Internet's DNS information.
The organization that maintains the DNSSEC master key has chosen the following interesting backup strategy:
The master key is split into seven pieces, with each piece given to a trusted human.
In order to recover the key, one must combine any five of these seven pieces.
On the other hand, combining any four of the seven pieces reveals no information about the key!
How is this possible?
The answer is a primitive called a secret-sharing scheme, the topic of this chapter.
3.1.Defining secret sharing
Secret sharing is a way to encode a value M into several pieces, called shares.
The encoding is associated with a threshold value t such that:
It is possible to recover M from anyt of the shares.
Any collection of fewer than t shares reveals nothing about M.
It's often useful to think of one person, called the dealer, having the secret M, generating the shares, and then distributing each share to a separate user.
(This is not the only way to use secret sharing, but it is the easiest to talk about.)
We will number the users 1 through n, and name the shares S1,…,Sn, with user i receiving share Si.
Any subset U⊆{1,…,n} can refer to a set of users, and we use the following notation to refer to their corresponding set of shares:
The reason we replace shares with null, rather than removing them altogether to make a shorter list, is that it preserves information about which share belongs to which user—information that can be used by the algorithm that recovers the secret from the shares.
A t-out-of-nsecret sharing scheme consists of the following algorithms:
Share: a randomized algorithm that takes a value M∈M as input, and outputs a list of nsharesS∈Sn.
Reconstruct:
a deterministic algorithm that takes a partial list of shares S∈(S∪{null})n as input, and outputs a value M∈M.
The value t is called the threshold of the scheme.
The scheme is correct if, for all M∈M and all U⊆{1,…,n} with ∣U∣=t, we have:
Pr[Reconstruct(Filter(U,Share(M)))=M]=1.
In other words, the secret M can be recovered just from the shares belonging to users U.
The goal of secret sharing is that any collection of fewer than t shares should reveal nothing about the secret.
We formalize this security requirement in an attack scenario in which a victim runs the Share algorithm.
Since the only input to the Share algorithm is not a key, we can let the adversary have control over it.
Next, the output of Share is passed through the Filter function before being given to the adversary, to ensure that the adversary sees fewer than t shares.
Finally, we can rephrase the informal security goal in the real-or-random paradigm:
Any collection of fewer than t shares appears uniformly distributed (i.e., looks like random junk).
Thus, we define two libraries that give output Filter(U,S1,…,Sn) to the adversary.
In one library, S1,…,Sn are valid shares, and in the other they are chosen uniformly.
The question remains: Where does U come from?
We want our security guarantee to apply no matter whatU is used, as long as ∣U∣<t.
Thus, we simply let the adversary chooseU.
The library enforces the constraint ∣U∣<t by simply returning an error if the adversary chooses U too large.
Definition 3.1.2 (Security for secret sharing schemes)
A t-out-of-n secret sharing scheme Σ is secure
if the following two libraries are interchangeable:
Lss-realΣ
ss.share(M,U):
if ∣U∣⩾Σ.t: return err
(S1,…,Sn):=Σ.Share(M)
return Filter(U,S1,…,Sn)
≡
Lss-randΣ
ss.share(M,U):
if ∣U∣⩾Σ.t: return err
for i=1 to Σ.n:
Si↞Σ.S
return Filter(U,S1,…,Sn)
A Bad Secret Sharing Scheme:
The “obvious” way to split a secret is to simply chop it into pieces.
The secret can then be reconstructed by concatenating these pieces.
This obvious approach is not a secure secret sharing scheme!
Example 3.1.3 (Naïve secret sharing scheme)
The following is not a secure n-out-of-n secret sharing scheme:
M:={0,1}nk
Share(M):
write S1∥S2∥⋯∥Sn:=M
// this means: chop M into n
// pieces, each k bits long; Si
// is the ith piece
return (S1,S2,…,Sn)
// n-out-of-n scheme, so
// each Si is non-null
Reconstruct(S1,…,Sn):
return S1∥⋯∥Sn
In other words, the following two libraries are not interchangeable:
Lss-real
ss.share(M,U):
if ∣U∣⩾n: return err
// Share(M):
S1∥S2∥⋯∥Sn:=M
return Filter(U,S1,…,Sn)
≡
Lss-rand
ss.share(M,U):
if ∣U∣⩾n: return err
for i=1 to n:
Si↞{0,1}k
return Filter(U,S1,…,Sn)
The reason is simple: Each share reveals some information about the secret!
The first share reveals the first k bits of M, and so on.
The attack is therefore quite simple:
A
M:=0nk
U:={1,…,n−1}
(S1,…,Sn):=ss.share(M,U)
return S1==0k
When A is linked to Lss-real,S1 contains the first k bits of M=0nk, which are all zeros.
So A returns true with probability 1 in this case.
However, when A is linked to Lss-rand,S1 is sampled uniformly from {0,1}k, so A outputs true only with probability 1/2k.
3.2.2-out-of-2 secret sharing
The simplest possible flavor of a secret sharing scheme is 2-out-of-2: The secret is split into two shares, both of which are needed to reconstruct the secret.
Believe it or not, you've already seen a 2-out-of-2 secret sharing scheme: one-time pad!
One share is the key, and the other is the ciphertext.
The key alone reveals nothing about the plaintext; the ciphertext alone also reveals nothing about the plaintext.
But by combining the two together in the right way, you can learn the plaintext.
Construction 3.2.1 (2-out-of-2 secret sharing based on OTP)
OTP secret sharing is defined by the following:
MS={0,1}ℓ={0,1}ℓ
Share(M):
S1↞{0,1}ℓ
S2:=S1⊕M
return (S1,S2)
// 2-out-of-2 scheme, so both
// shares must be present
Reconstruct(S1,S2):
return S1⊕S2
To see why construction 3.2.1 is correct, we can use the usual rules of xor:
Reconstruct(S1,S2)=S1⊕S2=S1⊕(S1⊕M)=M.
Claim 3.2.2 (Security of OTP secret sharing)
Construction 3.2.1 is a secure 2-out-of-2 secret sharing scheme.
In other words,
Lss-real
ss.share(M,U):
if ∣U∣⩾2: return err
// (S1,S2):=Share(M)
S1↞{0,1}ℓ
S2:=S1⊕M
return Filter(U,S1,S2)
≡
Lss-rand
ss.share(M,U):
if ∣U∣⩾2: return err
S1↞{0,1}ℓ
S2↞{0,1}ℓ
return Filter(U,S1,S2)
Proof:
The only legal choices for U are:
U=∅, causing ss.share to output (null,null),
U={1}, causing ss.share to output (S1,null), and
U={2}, causing ss.share to output (null,S2).
There is not much to say about the first case, but we need to show that in the other cases, the output share is distributed uniformly.
The case of S1 is simple, because Share literally samples S1 uniformly.
The case of S2 is exactly the one-time secrecy of OTP.
The Lss-* libraries treat all choices of U in the same manner (this was the purpose of introducing the Filter function).
But, as we just saw, different choices of U demand different justifications for their security.
So the first step of our security proof introduces a hybrid library that handles the different cases of U in different branches of an if-statement.
That way, we can apply different reasoning steps to these different parts of the library's code.
First, separate the cases for U into different branches of an if-statement. Within each branch, we can inline the behavior of Filter(U,⋅). These changes have no effect on the library's behavior.
S2 is not used at all in the if-branch, so it can be removed without affecting the library's behavior.
The “else if" branch generates and returns a OTP encryption of M, using S1 as the key. We can use the security of OTP to show that the resulting output is uniform. In this three-hop maneuver, S1 becomes K from the Lotp-real library and S2 becomes C.
The branches of the if-statement can now be unified by writing them in terms of Filter. The result is Lss-rand, which completes the proof.
Lss-real
Lss-rand
ss.share(M,U):
if ∣U∣⩾2: return err
if U={1}:
S1↞{0,1}ℓ
S2:=S1⊕M
//
Share(M)
Filter({1},(S1,S2)):
return (S1,null)
else if U={2}:
S1↞{0,1}ℓ
S2
:=
S1⊕M
otp.enc(M)
↞{0,1}ℓ
// Filter({2},(S1,S2)):
return
Filter(U,S1,S2)
(null,S2)
Filter(U,S1,S2)
else: // U=∅
// Filter(∅,(S1,S2)):
return (null,null)
⋄
Lotp-real
otp.enc(M):
K↞{0,1}ℓ
C:=K⊕M
return C
Lotp-rand
otp.enc(M):
C↞{0,1}ℓ
return C
3.3.Polynomial interpolation
You are probably familiar with the fact that two points determine a line.
It is also true that three points determine a parabola, and so on.
The final secret-sharing scheme in this chapter is based on the following principle:
d+1 points determine a unique degree-d polynomial.
Notation & Terminology
In this section, if F is a polynomial that can be written as:
F(X)=cdXd+cd−1Xd−1+⋯+c0,
then we will describe F as degree-d.
It would be more accurate to describe F as a polynomial of degree at mostd, since the leading coefficient could be zero.
Throughout this section, we will use capital X to denote the formal variable of a polynomial, and lowercase xi's to denote specific values/scalars.
The process of finding the polynomial that passes through a given set of points is called interpolation.
Theorem 3.3.1 (Polynomial interpolation)
Let {(x1,y1),…,(xd+1,yd+1)}⊆R2 be a set of points whose xi values are all distinct.
Then there is a unique degree-d polynomial F(X) with real coefficients that satisfies yi=F(xi) for all i.
Proof:
As a warm-up, consider the following polynomial:
A(X)=(X−x2)(X−x3)⋯(X−xd+1).
This is the product of d terms, so it has degree d.
Additionally:
On input x1, we get A(x1)=(x1−x2)(x1−x3)⋯(x1−xd+1),
which is nonzero because all of the xi values are distinct.
On input xi for i=1,A(xi) includes a term (xi−xi)=0, so the output is zero.
Of course A(X) can be evaluated at any point, but we care only about its behavior on these special points.
Suppose we divide A(X) by the fixed, nonzero value A(x1):
The pattern is that the numerator is “missing” the term (X−xj) and the denominator is missing the term (xj−xj), to avoid dividing by zero.
Polynomials of this kind are called Lagrange polynomials.
They are all degree-d, and they satisfy the property:
Lj(xi)={10 if i=j if i=j.
Now consider the following polynomial:
F(X)=y1L1(X)+y2L2(X)+⋯+yd+1Ld+1(X).
This F(X) is degree-d since it is the sum of degree-d polynomials (the yi values are just scalars).
Evaluating F(X) on one of the special xi values results in:
So F(xi)=yi for every xi;
in other words, F(X) interpolates the given points.
Next, we show that F is unique.
Suppose some other polynomial F′ also interpolates the given points: F(xi)=F′(xi)=yi for all i∈{1,…,d+1}.
Then the polynomial G(X)=F(X)−F′(X) also is degree-d, and it satisfies G(xi)=0 for all i.
In other words, G(X) has (at least) d+1 roots.
But the only degree-d polynomial with d+1 roots is the identically-zero polynomial G(X)=0.
If G(X)=0 then F=F′; thus, F is unique.
Example 3.3.2 (Polynomial interpolation)
What is the degree-3 polynomial that passes through the points (3,1),(4,1),(5,9), and (2,6)?
i
1
2
3
4
xi
3
4
5
2
yi
1
1
9
6
First, let's construct the appropriate Lagrange polynomials:
Addition, subtraction, and multiplication are simple operations mod n.
Just perform the operation over the integers and reduce the result mod n.
In this way, we can define operations on Zn whose results are always in Zn.
This section is about how to make sense of division mod n.
How can we divide two numbers in Zn to obtain a result also in Zn?
It is helpful to rethink what an expression like “1/2” means in the first place.
The best way to define “1/2” is the solution to the equation 2x=1.
Try to convince yourself that any time you divide by two, what you are really doing is multiplying by the value x that satisfies 2x=1.
Even though there is no solution to 2x=1in the integers, there could be a solution mod n.
If x∈Zn satisfies 2x≡n1, then it is reasonable for us call x “1/2.”
Example 3.4.1 (“1/2” under different moduli)
6 is a solution to 2x≡111.
Thus, “1/2” in Z11 is 6.
8 is a solution to 2x≡151.
Thus, “1/2” in Z15 is 8.
There is no solution to 2x≡101.
If x is an integer, then 2x is even, and its remainder mod 10 is also even, and thus cannot equal 1.
So “1/2” does not exist in Z10.
More generally, dividing by b is just multiplying by the x that satisfies xb=1.
This special value x is called the multiplicative inverse of b.
Definition 3.4.2 (Multiplicative inverse)
x is a multiplicative inverse of b mod n if xb≡n1.
When this is the case, we often write x≡nb−1.
Example 3.4.3 (Multiplicative inverses)
6 is an inverse of 2 mod 11, since 6⋅2≡111.
3 is an inverse of 7 mod 10, since 3⋅7≡101.
4 is its own inverse mod 15, since 4⋅4≡151.
3.4.1.Computing inverses
You might be disappointed if you write (1/2) % 11 (sometimes the operator is named mod) in your favorite programming language—the result might be 0.5.
Your program divided 1/2 to get a real number (floating point) 0.5, then divided 0.5 by 11 and computed the remainder, which of course was 0.5.
We can always add, subtract, or multiply mod n by first performing the operation over the integers and then reducing the result mod n.
This works because adding, subtracting, or multiplying integers always gives an integer result,
But division of integers doesn't always result in an integer, so
division mod n is not equivalent in general to dividing over the integers and reducing the result mod n.
So how can you actually compute inverses mod n?
We discuss the algorithms behind modular inverses in more detail in chapter 15, but for now you can simply use a good numerical library.
Numerical examples in this book will use SageMath (sagemath.org), an open-source system that uses Python syntax.
Sage's built-in % operator is smart enough to do what we want:
sage: (1/2) % 11
6
Beware that Sage treats expressions like 1/2 and 0.5 differently:
sage: 0.5 % 11
0.500000000000000
Sage stores 1/2 as a rational number with exact precision (it stores the numerator and denominator separately as integers), instead of converting it to a floating point number.
It can therefore interpret (a/b)%n as ab−1%n.
If you want to be even more explicit, you can define a Mod object, which “knows” that it lives in Zn and overloads its arithmetic operations to be the mod-n operations:
sage: x = Mod(2,11)
sage: 1/x
6
sage: x + 100
3
A Mod object can be converted back into an integer with the lift method:
sage: x.lift() + 100
102
3.4.2.Prime moduli
We have seen examples where multiplicative inverses exist and other examples where they don't.
If you want to know the rule that characterizes exactly when b has a multiplicative inverse mod n, take a look at chapter 15.
For this chapter, we only need to understand the case where the modulus is prime.
Claim 3.4.4 (Multiplicative inverses modulo a prime)
When n is a prime, every b∈{1,…,n−1} has a multiplicative inverse mod n.
This algebraic property is one reason prime numbers are useful in cryptography.
Proof:
For the sake of contradiction, suppose that none of the integers b,2b,3b,… are congruent to 1 mod n.
Reduce that sequence mod n to obtain:
b%p,(2a)%p,(3a)%n,…
Each item in the sequence is an integer in the range {0,…,n−1}, and we have assumed that no term is equal to 1.
With only n−1 values possible in this sequence, there must be a repeat within the first n terms:
(i⋅b)%n=(j⋅b)%n, for some distinct i,j∈{1,…,n}.
Equivalently,
i⋅b≡nj⋅b⟹∣i−j∣⋅b≡n0⟹n divides ∣i−j∣⋅b.
An important fact about primes is the following:
Fact 3.4.5 (Prime divisors)
If n is a prime, and u and v are integers such that n∣uv,
then n∣u or n∣v (or both).
From this fact, we can conclude that n divides either ∣i−j∣ or b.
But both ∣i−j∣ and b are positive, and strictly less than n.
(∣i−j∣ is the difference of distinct elements of {1,…,n}.)
This gives us the desired contradiction: n cannot divide a positive number smaller than itself.
Interpolation:
In the previous section we proved that d+1 points determine a unique degree-d polynomial.
More precisely, we proved the statement with respect to the real numbers.
It is also true working modulo a prime:
Theorem 3.4.6 (Polynomial interpolation modulo a prime)
Let n be a prime, and let {(x1,y1),…,(xd+1,yd+1)}⊆(Zn)2 be a set of points whose xi values are all distinct.
Then there is a unique degree-d polynomial F(X) with coefficients in Zn that satisfies yi≡nF(xi) for all i.
Proof:
The proof is essentially the same as that of theorem 3.3.1.
In that proof we defined the Lagrange polynomials as:
These expressions are valid modulo a prime;
to be completely precise, you can imagine multiplying the numerator by the inverse of the denominator.
To prove that a unique polynomial interpolates the given points, we used the fact that the only degree-d polynomial with more than d roots is the identically zero polynomial.
This fact is also true in Zn when n is prime, but we do not prove it here.
Example 3.4.7 (Polynomial interpolation modulo a prime)
Suppose we are interested in the polynomial that interpolates the points from the previous section's example, but this time in Z11:
i
1
2
3
4
xi
3
4
5
2
yi
1
1
9
6
We previously computed the example over the real numbers as:
F(X)=21(X3−4X2−9X+38).
To get the answer in Z11 (i.e., a polynomial with coefficients in Z11), just replace “division by 2” with “multiplication by 2's inverse mod 11,” which in this case is 6.
(If you like, you could also replace negative coefficients with positive ones by reducing mod 11, obtaining F(X)=6X3+9X2+X+8.)
We can double-check that F gives the correct values:
This section introduces Shamir's secret sharing scheme, a t-out-of-n secret sharing scheme that cleverly uses polynomial interpolation.
The idea is that the shares are points that all lie on the same degree-(t−1) polynomial Q(X).
We have seen that any t such points uniquely determine Q(X).
The secret is just another special point on the polynomial, usually Q(0).
To share a secret M, the dealer must choose a polynomial Q(X) of degree t−1 satisfying Q(0)=M.
It does this by fixing Q's constant coefficient to be M and choosing the t−1 other coefficients uniformly at random from Zp, where p is a prime.
Then the n shares are Q(1),…,Q(n), with all operations taken mod p.
Construction 3.5.1 (Shamir secret sharing)
Let p be a prime and let t and n be integers with t⩽n<p.
Then Shamir secret sharing consists of the following algorithms and parameters M=S=Zp:
Share(M):
// uniformly chosen degree-(t−1)
// polynomial with Q(0)=M
q0:=M
for i=1 to t−1:
qi↞Zp
Q(X):=qt−1Xt−1+⋯+q0
for i=1 to n:
Si:=Q(i)%p
return (S1,…,Sn)
// expect t of the Si's to be non-null
Reconstruct(S1,…,Sn):
for i=1 to n:
if Si=null:
I:=I∪{(i,Si)}
// I = points on which to interpolate
Q(X):=unique degree-(t−1)polynomial interpolatingpoints in I
return Q(0)%p
The restriction n<p comes from the fact that the shares are Q(1),…,Q(n) and the secret is Q(0), so the numbers {0,…,n} must be distinct mod p.
Example 3.5.2 (Shamir secret sharing)
Here is an example of 4-out-of-7 Shamir sharing over Z11.
Suppose the secret is M=8,
then the Share algorithm will define a polynomial Q(X) by sampling t−1=3 coefficients q1,q2,q3 and fixing coefficient q0=M=8.
Suppose the results are
q1=1,q2=9,q3=6,
and so the secret polynomial is Q(X)=6X3+9X2+X+8.
The 7 shares are:
Any four of these shares can be combined to reconstruct the secret.
Suppose users 2, 3, 4, and 5 combine their shares Q(2),Q(3),Q(4),Q(5).
They use polynomial interpolation to recover Q(X) — in this case, their computation is precisely what is described in example 3.4.7.
Upon recovering Q(X), they evaluate it at zero to obtain the secret q0=8.
Next, we turn our attention to the security of Shamir secret sharing.
We must show that if you see less than t shares, then those shares look like random junk.
Claim 3.5.3 (Security of Shamir secret sharing)
Shamir secret sharing (construction 3.5.1) is a secure secret sharing scheme.
That is, the following libraries are interchangeable:
Lss-real
ss.share(M,U):
if ∣U∣⩾t: return err
// (S1,…,Sn):=Share(M):
q0:=M
for i=1 to t−1:
qi↞Zp
Q(X):=qt−1Xt−1+⋯+q0
for i=1 to n:
Si:=Q(i)%p
return Filter(U,S1,…,Sn)
≡
Lss-rand
ss.share(M,U):
if ∣U∣⩾t: return err
for i=1 to n:
Si↞Zp
return Filter(U,S1,…,Sn)
Proof:
Rather than showing a sequence of hybrids, for this proof we will reason directly about output probabilities, similar to our security proof for OTP in chapter 1.
The output of ss.share(M,U) is a list containing Zp-elements in the positions given by U and null everywhere else (assuming ∣U∣<t).
Thus, there are p∣U∣ outputs possible for a specific choice of U, and our goal is to show that the output of ss.share is uniformly distributed among these possibilities.
We will consider only the case where ∣U∣=t−1;exercise 3.1 asks you to show that this special case implies security in general.
We will show that for any M∈Zp and any ∣U∣=t−1, the output of ss.share(M,U) is uniformly distributed, among the pt−1 possibilities that are consistent with this choice of U.
Fix a particular M∈Zp and U⊆{1,…,n} with ∣U∣=t−1, and a particular list (S1,…,Sn) that consists of Zp-elements in the positions given in U and contains null everywhere else.
It suffices to prove that:
Pr[ss.share(M,U)=(S1,…,Sn)]=1/pt−1.
This event happens only when Share chooses a polynomial Q(X) such that Q(i)≡pSi for all i∈U.
Additionally, Sharealways chooses a polynomial satisfying Q(0)≡pM.
But there is only one Q(X) of degree t−1 that interpolates these t specific values.
So the probability that ss.share(M,U)=(S1,…,Sn) is exactly the probability that Share chooses this one particular polynomial Q(X).
But Share chooses each coefficient q1,…,qt−1uniformly from Zp, and they will match the coefficients of this particular Q(X) with probability 1/pt−1.
Thus, the output of ss.share is uniformly distributed.
Exercises
The libraries in definition 3.1.2 require the adversary to choose U with ∣U∣<t.
When this is not the case, they return an error.
Prove that it suffices to restrict the adversary to U with ∣U∣=t−1.
In other words, if Σ is a secret sharing scheme for which the following libraries are interchangeable,
then Σ is also secure according to definition 3.1.2.
ss.share(M,U):
if ∣U∣=t−1: return err
(S1,…,Sn):=Σ.Share(M)
return Filter(U,S1,…,Sn)
≡
ss.share(M,U):
if ∣U∣=t−1: return err
for i=1 to n:
Si↞Σ.S
return Filter(U,S1,…,Sn)
,
There are three major divisions at PizzaCorp: the crust division, the sauce division, and the cheese division.
Each division has an executive board consisting of five people.
The CEO of PizzaCorp would like to divide the secret family recipe among the executives so that they can recover it only if a majority of executives from each division cooperate.
If any division does not have a majority of executives present, then nobody should learn anything about the secret recipe.
Assuming that the CEO is aware of t-out-of-n secret sharing schemes, describe clearly how they can distribute values to the executives to achieve the desired outcome, and describe how the executives will recover the secret.
You should give some informal reasoning about the security of your proposal, but the CEO of PizzaCorp is not interested in hearing a formal security proof.
Propose a security definition for secret sharing, using the left-or-right paradigm (section 2.7).
Formally prove that if a secret sharing scheme satisfies the real-or-random definition (definition 3.1.2), then it also satisfies your definition.
Suppose a t-out-of-n secret sharing scheme has message space M and share space S.
Prove that if the scheme is secure, then ∣M∣⩽∣S∣.
Use exercise 2.14 as inspiration.
Generalize construction 3.2.1 to the n-out-of-n case.
Propose an n-out-of-n secret sharing scheme and prove that it is secure.
Let Σ3 be a 3-out-of-3 secret sharing scheme, and
Σ2 be a 2-out-of-2 secret sharing scheme that is capable of sharing shares from Σ3 (i.e., Σ3.S⊆Σ2.M).
In this exercise we consider the following 2-out-of-3 scheme Σ∗:
Σ∗.Share(M):
(S1,S2,S3):=Σ3.Share(M)
(T1→2,T1→3):=Σ2.Share(S1)
(T2→1,T2→3):=Σ2.Share(S2)
(T3→1,T3→2):=Σ2.Share(S3)
S1∗:=(S1,T2→1,T3→1)
S2∗:=(S2,T1→2,T3→2)
S3∗:=(S3,T1→3,T2→3)
return (S1∗,S2∗,S3∗)
Describe the corresponding Σ∗.Reconstruct algorithm.
Prove that Σ∗ is a secure 2-out-of-3 secret sharing scheme.
Let Σss be a 2-out-of-2 secret sharing scheme, and
let Σske-1 and Σske-2 be encryption schemes with plaintext spaces Σske-1.M=Σske-2.M=Σss.S; in other words, Σske-1 and Σske-2 can encrypt shares from Σss.
Define the following new encryption scheme Σ∗:
Prove that Σ∗ has left-or-right one-time secrecy (definition 2.7.1) if Σss is a secure secret sharing scheme, and either of Σske-1,Σske-2 has left-or-right one-time secrecy.
Your proof should involve two cases:
In the first case, assume that Σske-1 is secure, but assume nothing about Σske-2.
Then repeat, swapping the roles of Σske-1 and Σske-2.
Why do you suppose this question asks about left-or-right security rather than real-or-random?
Generalize the previous exercise to the t-out-of-n case.
Given n different encryption schemes, describe how to construct a new encryption scheme that has (left-or-right) one-time secrecy if anyt of the underlying schemes do.
Prove security of your construction.
Be careful about choosing the threshold for any secret sharing scheme you use.
It is not necessary to compute the entire polynomial during the reconstruction phase of Shamir secret sharing.
All that is needed is the value Q(0).
Given x1,…,xt, all distinct and all nonzero, show how to construct coefficients c1,…,ct such that
Q(0)=c1Q(x1)+c2Q(x2)+⋯+ctQ(xt),
for all degree-(t−1) polynomials Q.
To be clear, the ci coefficients depend only on the xi's but not on Q.
We didn't prove that multiplicative inverses are unique mod n.
Prove the following:
If x and x′ are both multiplicative inverses of b mod n,
then x≡nx′.
Prove that if n is composite, then there is some integer b∈{1,…,n−1} that does not have a multiplicative inverse mod n.
Give an example of a nonzero, degree-d polynomial over Zn that has more than d roots.
Of course, n cannot be prime.
Let n be a prime and consider the following variant of OTP:
K=M=C={1,…,n−1}
Enc(K,M):
C:=K⋅M%n
return C
Give the corresponding Dec algorithm and show that it is correct.
Prove that the scheme has one-time secrecy.
Below are parameters for Shamir's secret sharing scheme along with a set of shares.
What is the secret, and what are the missing shares?
h
Suppose n users hold secret shares of M and M′, generated by Shamir's scheme with the same threshold t and same prime p.
Each user holds a share of M and a share of M′.
Prove that if each user locally adds their shares (mod p), the result is a valid sharing of M+M′%p.
In other words, prove that the following procedure always outputs M+M′%p:
(S1,…,Sn):=Share(M)
(S1′,…,Sn′):=Share(M′)
for i=1 to n:
Si∗:=(Si+Si′)%p
output Reconstruct(S1∗,…,Sn∗)
What polynomial do the new shares lie on?
Implement the algorithms of Shamir secret sharing in Sage.
h
Secret sharing schemes must satisfy two properties: (1) any collection of t shares is enough to reconstruct the secret; (2) any collection of t−1 shares reveals no information about the secret.
Suppose we are interested only in condition (1) and not (2).
Describe a way to split an ℓ-bit secret into n “shares” of length roughly ℓ/t (not ℓ), so that the secret can be reconstructed from any collection of t shares.
Unlike in secret sharing, these “shares” are now allowed to leak information about the “secret.”
As such, there is no security property to prove.
Instead of encoding the target value as Q(0), encode it as the entire polynomial Q.
Chapter Notes
Secret sharing was proposed independently by Shamir [200] and by Blakley [47].
The scheme from [200] is the ubiquitous one still known as Shamir's scheme.
When you must choose from several reasonable choices for a cryptographic algorithm, you may live in fear that your chosen algorithm is broken.
A combiner is a way to combine several cryptographic algorithms into a single algorithm that is secure if at least one of its components is secure, even if all the others are broken.
Exercise 3.7 describes a simple combiner for one-time secrecy.
Several other exercises throughout the book explore combiners for other primitives.
Cryptographic combiners were first explicitly studied by Herzberg [121], who called them “tolerant” constructions.
The term “combiner” is due to Harnik, Kilian, Naor, Reingold, and Rosen [120].
The problem in exercise 3.17 is called information dispersal, and was introduced by Rabin [186].