Secret sharing using the Chinese remainder theorem

From HandWiki

Secret sharing consists of recovering a secret S from a set of shares, each containing partial information about the secret. The Chinese remainder theorem (CRT) states that for a given system of simultaneous congruence equations, the solution is unique in some Z/nZ, with n > 0 under some appropriate conditions on the congruences. Secret sharing can thus use the CRT to produce the shares presented in the congruence equations and the secret could be recovered by solving the system of congruences to get the unique solution, which will be the secret to recover.

Secret sharing schemes: several types

Main page: Secret sharing

There are several types of secret sharing schemes. The most basic types are the so-called threshold schemes, where only the cardinality of the set of shares matters. In other words, given a secret S, and n shares, any set of t shares is a set with the smallest cardinality from which the secret can be recovered, in the sense that any set of t − 1 shares is not enough to give S. This is known as a threshold access structure. We call such schemes (t, n) threshold secret sharing schemes, or t-out-of-n scheme.

Threshold secret sharing schemes differ from one another by the method of generating the shares, starting from a certain secret. The first ones are Shamir's threshold secret sharing scheme, which is based on polynomial interpolation in order to find S from a given set of shares, and George Blakley's geometric secret sharing scheme, which uses geometric methods to recover the secret S. Threshold secret sharing schemes based on the CRT are due to Mignotte and Asmuth–Bloom, they use special sequences of integers along with the CRT.

Chinese remainder theorem

Main page: Chinese remainder theorem

Let [math]\displaystyle{ k \geqslant 2, m_1,...,m_k \geqslant 2 }[/math], and [math]\displaystyle{ b_1,...,b_k \in \mathbf{Z} }[/math]. The system of congruences

[math]\displaystyle{ \begin{cases} x \equiv & b_1 \ \bmod \ m_1 \\ & \vdots \\ x \equiv & b_k \ \bmod \ m_k \\ \end{cases} }[/math]

has solutions in Z if and only if [math]\displaystyle{ b_i \equiv b_j \bmod (m_i,m_j) }[/math] for all [math]\displaystyle{ 1 \leqslant i,j \leqslant k }[/math], where [math]\displaystyle{ (m_i,m_j) }[/math] denotes the greatest common divisor (GCD) of mi and mj. Furthermore, under these conditions, the system has a unique solution in Z/nZ where [math]\displaystyle{ n = [m_1,...,m_k] }[/math], which denotes the least common multiple (LCM) of [math]\displaystyle{ m_1,...,m_k }[/math].

Secret sharing using the CRT

Since the Chinese remainder theorem provides us with a method to uniquely determine a number S modulo k-many relatively prime integers [math]\displaystyle{ m_1, m_2, ..., m_k }[/math], given that [math]\displaystyle{ S \lt \prod_{i=1}^k m_i }[/math], then, the idea is to construct a scheme that will determine the secret S given any k shares (in this case, the remainder of S modulo each of the numbers mi), but will not reveal the secret given less than k of such shares.

Ultimately, we choose n relatively prime integers [math]\displaystyle{ m_1\lt m_2\lt ...\lt m_n }[/math] such that S is smaller than the product of any choice of k of these integers, but at the same time is greater than any choice of k − 1 of them. Then the shares [math]\displaystyle{ s_1, s_2, ..., s_n }[/math] are defined by [math]\displaystyle{ s_i = S \bmod \ m_i }[/math] for [math]\displaystyle{ i=1, 2, ..., n }[/math]. In this manner, thanks to the CRT, we can uniquely determine S from any set of k or more shares, but not from less than k. This provides the so-called threshold access structure.

This condition on S can also be regarded as

[math]\displaystyle{ \prod_{i=n-k+2}^n m_i \lt S \lt \prod_{i=1}^k m_i. }[/math]

Since S is smaller than the smallest product of k of the integers, it will be smaller than the product of any k of them. Also, being greater than the product of the greatest k − 1 integers, it will be greater than the product of any k − 1 of them.

There are two secret sharing schemes that utilize essentially this idea, the Mignotte and Asmuth–Bloom schemes, which are explained below.

Mignotte threshold secret sharing scheme

As said before, the Mignotte threshold secret sharing scheme uses, along with the CRT, special sequences of integers called the (k, n)-Mignotte sequences which consist of n integers, pairwise coprime, such that the product of the smallest k of them is greater than the product of the k − 1 biggest ones. This condition is crucial because the scheme is built on choosing the secret as an integer between the two products, and this condition ensures that at least k shares are needed to fully recover the secret, no matter how they are chosen.

Formally, let 2 ≤ kn be integers. A (k, n)-Mignotte sequence is a strictly increasing sequence of positive integers [math]\displaystyle{ m_1 \lt \cdots \lt m_n }[/math], with [math]\displaystyle{ (m_i,m_j) = 1 }[/math] for all 1 ≤ i < jn, such that [math]\displaystyle{ m_{n-k+2} \cdots m_n \lt m_1 \cdots m_k }[/math]. Let [math]\displaystyle{ \alpha = m_{n-k+2} \cdots m_n }[/math] and [math]\displaystyle{ \beta = m_1 \cdots m_k }[/math]; we call the integers lying strictly between [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] the authorized range. We build a (k, n)-threshold secret sharing scheme as follows: We choose the secret S as a random integer [math]\displaystyle{ \alpha \lt S \lt \beta }[/math] in the authorized range. We compute, for every 1 ≤ in, the reduction modulo mi of S that we call si, these are the shares. Now, for any k different shares [math]\displaystyle{ s_{i_1}, \ldots, s_{i_k} }[/math], we consider the system of congruences:

[math]\displaystyle{ \begin{cases} x \equiv & s_{i_1} \ \bmod \ m_{i_1} \\ & \vdots \\ x \equiv & s_{i_k} \ \bmod \ m_{i_k} \\ \end{cases} }[/math]

By the Chinese remainder theorem, since [math]\displaystyle{ m_{i_1}, \ldots, m_{i_k} }[/math] are pairwise coprime, the system has a unique solution modulo [math]\displaystyle{ m_{i_1} \cdots m_{i_k} }[/math]. By the construction of our shares, this solution is nothing but the secret S to recover.

Asmuth–Bloom threshold secret sharing scheme

This scheme also uses special sequences of integers. Let 2 ≤ kn be integers. We consider a sequence of pairwise coprime positive integers [math]\displaystyle{ m_0 \lt ... \lt m_n }[/math] such that [math]\displaystyle{ m_0 \cdot m_{n-k+2} \cdots m_n \lt m_1 \cdots m_k }[/math]. For this given sequence, we choose the secret S as a random integer in the set Z/m0Z.

We then pick a random integer α such that [math]\displaystyle{ S + \alpha \cdot m_0 \lt m_1 \cdots m_k }[/math]. We compute the reduction modulo mi of [math]\displaystyle{ S + \alpha \cdot m_0 }[/math], for all 1 ≤ in, these are the shares [math]\displaystyle{ I_i=(s_i,m_i) }[/math]. Now, for any k different shares [math]\displaystyle{ I_{i_1},...,I_{i_k} }[/math], we consider the system of congruences:

[math]\displaystyle{ \begin{cases} x \equiv & s_{i_1} \ \bmod \ m_{i_1} \\ & \vdots \\ x \equiv & s_{i_k} \ \bmod \ m_{i_k} \\ \end{cases} }[/math]

By the Chinese remainder theorem, since [math]\displaystyle{ m_{i_1}, ... , m_{i_k} }[/math] are pairwise coprime, the system has a unique solution S0 modulo [math]\displaystyle{ m_{i_1} \cdots m_{i_k} }[/math]. By the construction of our shares, the secret S is the reduction modulo m0 of S0.

It is important to notice that the Mignotte (k, n)-threshold secret-sharing scheme is not perfect in the sense that a set of less than k shares contains some information about the secret. The Asmuth–Bloom scheme is perfect: α is independent of the secret S and

[math]\displaystyle{ \left.\begin{array}{r} \prod_{i=n-k+2}^n m_i\\ \alpha \end{array}\right\}\lt \frac{\prod_{i=1}^k m_i}{m_0} }[/math]

Therefore α can be any integer modulo

[math]\displaystyle{ \prod_{i=n-k+2}^n m_i. }[/math]

This product of k − 1 moduli is the largest of any of the n choose k − 1 possible products, therefore any subset of k − 1 equivalences can be any integer modulo its product, and no information from S is leaked.

Example

The following is an example on the Asmuth–Bloom scheme. For practical purposes we choose small values for all parameters. We choose k = 3 and n = 4. Our pairwise coprime integers being [math]\displaystyle{ m_0 =3, m_1 =11, m_2 =13, m_3 =17 }[/math] and [math]\displaystyle{ m_4 =19 }[/math]. They satisfy the Asmuth–Bloom required sequence because [math]\displaystyle{ 3\cdot17\cdot19 \lt 11\cdot13\cdot17 }[/math].

Say our secret S is 2. Pick [math]\displaystyle{ \alpha = 51 }[/math], satisfying the required condition for the Asmuth–Bloom scheme. Then [math]\displaystyle{ 2+51\cdot 3=155 }[/math] and we compute the shares for each of the integers 11, 13, 17 and 19. They are respectively 1, 12, 2 and 3. We consider one possible set of 3 shares: among the 4 possible sets of 3 shares we take the set {1, 12, 2} and show that it recovers the secret S = 2. Consider the following system of congruences:

[math]\displaystyle{ \begin{cases} x \equiv & 1 \ \bmod \ 11 \\ x \equiv & 12 \ \bmod \ 13 \\ x \equiv & 2 \ \bmod \ 17 \\ \end{cases} }[/math]

To solve the system, let [math]\displaystyle{ M = 11 \cdot 13 \cdot 17 }[/math]. From a constructive algorithm for solving such a system, we know that a solution to the system is [math]\displaystyle{ x_0 = 1 \cdot e_1 + 12\cdot e_2 + 2\cdot e_3 }[/math], where each ei is found as follows:

By Bézout's identity, since [math]\displaystyle{ (m_i,M/m_i) = 1 }[/math], there exist positive integers ri and si, that can be found using the Extended Euclidean algorithm, such that [math]\displaystyle{ r_i.m_i+s_i.M/m_i = 1 }[/math]. Set [math]\displaystyle{ e_i=s_i\cdot M/m_i }[/math].

From the identities [math]\displaystyle{ 1 = 1\cdot 221 - 20\cdot 11 = (-5)\cdot 187 + 72\cdot 13 = 5\cdot 143 + (-42)\cdot 17 }[/math], we get that [math]\displaystyle{ e_1 = 221, e_2=-935, e_3=715 }[/math], and the unique solution modulo [math]\displaystyle{ 11\cdot 13\cdot 17 }[/math] is 155. Finally, [math]\displaystyle{ S = 155 \equiv 2 \mod 3 }[/math].

See also

References

  • Oded Goldreich, Dana Ron and Madhu Sudan, Chinese Remaindering with Errors, IEEE Transactions on Information Theory, Vol. 46, No. 4, July 2000, pages 1330-1338.
  • Mignotte M. (1983) How to Share a Secret. In: Beth T. (eds) Cryptography. EUROCRYPT 1982. Lecture Notes in Computer Science, vol 149. Springer, Berlin, Heidelberg.
  • C.A. Asmuth and J. Bloom. A modular approach to key safeguarding. IEEE Transactions on Information Theory, IT-29(2):208-210, 1983.
  • Sorin Iftene. General Secret Sharing Based on the Chinese Remainder Theorem with Applications in E-Voting. Electronic Notes in Theoretical Computer Science (ENTCS). Volume 186, (July 2007). Pages 67–84. Year of Publication: 2007. ISSN 1571-0661.
  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN:0-262-03293-7. Section 31.5: The Chinese remainder theorem, pages 873-876.
  • Ronald Cramer. Basic Secret Sharing (Lectures 1-2), Class Notes. October 2008, version 1.1.

External links

ru:Схема Миньотта