Let M \mathcal{M} M be some data domain, indexed from 0 0 0 to ∣ M ∣ − 1 |\mathcal{M}| - 1 ∣ M ∣ − 1 , and assume n , t ∈ N + n, t \in \mathbb{N}^+ n , t ∈ N + such that t ≤ n t \le n t ≤ n .
Problem.
Distribute a secret m ∈ M m \in \mathcal{M} m ∈ M among n n n parties P 1 , … , P n P_1, \ldots, P_n P 1 , … , P n such that any subset of at least t t t parties, termed an authorized subset, can reconstruct m m m , whereas any subset with fewer than t t t parties cannot.
Shamir's Idea: Use polynomials!
Encoding
Encoding Algorithm (Share m m m ):
Choose a prime number p p p , s.t., p ≥ max { n , ∣ M ∣ } p \ge \max \{n, |\mathcal{M}| \} p ≥ max { n , ∣ M ∣ } .
Generate independent uniform random integers a 1 , … , a t − 1 ∈ F p a_1, \ldots, a_{t - 1} \in \mathbb{F}_p a 1 , … , a t − 1 ∈ F p , and let a 0 = m a_0 = m a 0 = m .
Construct Polynomial f ( x ) = a t − 1 x t − 1 + a t − 2 x t − 2 + ⋯ + m f(x) = a_{t - 1} x^{t - 1} + a_{t - 2} x^{t - 2} + \cdots + m f ( x ) = a t − 1 x t − 1 + a t − 2 x t − 2 + ⋯ + m , s.t.,f ( 0 ) = a 0 = m .
f(0) = a_0 = m.
f ( 0 ) = a 0 = m .
Compute s i = f ( i ) , ∀ i ∈ [ n ] s_i = f(i), \forall i \in [n] s i = f ( i ) , ∀ i ∈ [ n ] . Output ( s 1 , … , s n ) (s_1, \ldots, s_n) ( s 1 , … , s n ) , i.e., distribute s i s_i s i to party P i P_i P i .
Security
It is easy to see that any subset of size < t < t < t can not reconstruct a 0 = m a_0 = m a 0 = m .
Theorem.
Given m , c 1 , … , c t − 1 ∈ F p m, c_1, \ldots, c_{t - 1} \in \mathbb{F}_p m , c 1 , … , c t − 1 ∈ F p , it holds that
Pr [ s 1 = c 1 , s t − 1 = c t − 1 ] = 1 p t − 1 .
\Pr \left[
s_1 = c_1, s_{t - 1} = c_{t - 1}
\right]
= \frac{1}{p^{t - 1}}.
Pr [ s 1 = c 1 , s t − 1 = c t − 1 ] = p t − 1 1 .
By symmetry, it is easy to see this theorem applies to arbitrary size-( t − 1 ) (t - 1) ( t − 1 ) subset of ( s 1 , … , s n ) (s_1, \ldots, s_n) ( s 1 , … , s n ) .
Proof.
The unknown vector ( a t − 1 , … , a 1 ) (a_{t - 1}, \ldots, a_1) ( a t − 1 , … , a 1 ) satisfies the following linear system:
[ 1 1 ⋯ , 1 2 t − 1 2 t − 2 ⋯ , 1 ⋮ ( t − 1 ) t − 1 ( t − 1 ) t − 2 ⋯ , 1 ] [ a t − 1 a t − 2 ⋮ a 0 ] = [ s 1 s 2 ⋮ s t − 1 ] ,
\begin{bmatrix}
1& 1& \cdots, 1 \\
2^{t - 1}& 2^{t - 2}& \cdots, 1 \\
& \vdots \\
(t - 1)^{t - 1}& (t - 1)^{t - 2}& \cdots, 1
\end{bmatrix}
\begin{bmatrix}
a_{t - 1} \\
a_{t - 2} \\
\vdots \\
a_0
\end{bmatrix}
=
\begin{bmatrix}
s_1 \\
s_2 \\
\vdots \\
s_{t - 1}
\end{bmatrix},
1 2 t − 1 ( t − 1 ) t − 1 1 2 t − 2 ⋮ ( t − 1 ) t − 2 ⋯ , 1 ⋯ , 1 ⋯ , 1 a t − 1 a t − 2 ⋮ a 0 = s 1 s 2 ⋮ s t − 1 , i.e.,
[ 1 1 ⋯ , 1 2 t − 1 2 t − 2 ⋯ , 2 ⋮ ( t − 1 ) t − 1 ( t − 1 ) t − 2 ⋯ , ( t − 1 ) ] [ a t − 1 a t − 2 ⋮ a 1 ] = [ s 1 − a 0 s 2 − a 0 ⋮ s t − 1 − a 0 ] .
\begin{bmatrix}
1& 1& \cdots, 1 \\
2^{t - 1}& 2^{t - 2}& \cdots, 2 \\
& \vdots \\
(t - 1)^{t - 1}& (t - 1)^{t - 2}& \cdots, (t - 1)
\end{bmatrix}
\begin{bmatrix}
a_{t - 1} \\
a_{t - 2} \\
\vdots \\
a_1
\end{bmatrix}
=
\begin{bmatrix}
s_1 - a_0\\
s_2 - a_0\\
\vdots \\
s_{t - 1} - a_0
\end{bmatrix}.
1 2 t − 1 ( t − 1 ) t − 1 1 2 t − 2 ⋮ ( t − 1 ) t − 2 ⋯ , 1 ⋯ , 2 ⋯ , ( t − 1 ) a t − 1 a t − 2 ⋮ a 1 = s 1 − a 0 s 2 − a 0 ⋮ s t − 1 − a 0 . which can be solved efficiently as the first matrix is a Vandermonde one.
□ \square □
Decoding
As for reconstruction, assume without loss of generality, the input is s 1 , … , s t s_1, \ldots, s_t s 1 , … , s t .
Reconstruct ( s 1 , … , s t s_1, \ldots, s_t s 1 , … , s t ):
The unknown vector ( a t − 1 , … , a 0 ) (a_{t - 1}, \ldots, a_0) ( a t − 1 , … , a 0 ) can be reconstructed from the following linear system:
[ 1 1 ⋯ , 1 2 t − 1 2 t − 2 ⋯ , 1 ⋮ t t − 1 t t − 2 ⋯ , 1 ] [ a t − 1 a t − 2 ⋮ a 0 ] = [ s 1 s 2 ⋮ s t ] .
\begin{bmatrix}
1& 1& \cdots, 1 \\
2^{t - 1}& 2^{t - 2}& \cdots, 1 \\
& \vdots \\
t^{t - 1}& t^{t - 2}& \cdots, 1
\end{bmatrix}
\begin{bmatrix}
a_{t - 1} \\
a_{t - 2} \\
\vdots \\
a_0
\end{bmatrix}
=
\begin{bmatrix}
s_1 \\
s_2 \\
\vdots \\
s_t
\end{bmatrix}.
1 2 t − 1 t t − 1 1 2 t − 2 ⋮ t t − 2 ⋯ , 1 ⋯ , 1 ⋯ , 1 a t − 1 a t − 2 ⋮ a 0 = s 1 s 2 ⋮ s t .
Note. Fast reconstruction is possible, as the first matrix is a Vandermonde matrix.
After knowing a t − 1 , … , a 0 a_{t - 1}, \ldots, a_0 a t − 1 , … , a 0 , we can recover all s 1 , … , s n s_1, \ldots, s_n s 1 , … , s n .
Remark. The encoding and decoding scheme is akin to Reed-Solomon Codes.
Remark. It is possible to corrupt fewer than p − t + 1 2 \frac{p - t + 1}{2} 2 p − t + 1 of ( s 1 , … , s n ) (s_1, \ldots, s_n) ( s 1 , … , s n ) and still be able to decode.
Reference
[1] Note by Yael Kalai “Secret Sharing Schemes” .
← Back to all notes Back to top ↑