An Image Secret Sharing Method Based on Matrix Theory

Most of today’s secret image sharing technologies are based on the polynomial-based secret sharing scheme proposed by shamir. At present, researchers mostly focus on the development of properties such as small shadow size and lossless recovery, instead of the principle of Shamir’s polynomial-based SS scheme. In this paper, matrix theory is used to analyze Shamir’s polynomial-based scheme, and a general (k, n) threshold secret image sharing scheme based on matrix theory is proposed. The effectiveness of the proposed scheme is proved by theoretical and experimental results. Moreover, it has been proved that the Shamir’s polynomial-based SS scheme is a special case of our proposed scheme.


Introduction
Since more and more data are being transmitted via the Internet, how to protect the privacy and security of the data such as military images becomes a focus.Although secret data can be protected by traditional encryption, it cannot be revealed exactly if the stego-media is lossy.With a property of loss-tolerance, secret sharing(SS) techniques have been proposed.SS, also called secret division, was invented independently by Adi Shamir [1] and George Blakley [2] in 1979.A (k, n) threshold SS scheme is a method of encrypting a secret into n shares such that any subset consisting of k shares can reveal the secret, while less than k shares cannot reconstruct the secret.
Based on the SS scheme, a secret image sharing (SIS) scheme was proposed.In the scheme, several shadow images (or shares) are generated by the secret image, and there will be no secret information leakage.In the recovery phase, a secret image can be recovered through partial shadow images, even if some of the shadow images are lost or damaged.Therefore, compared with other cryptographic techniques, the SIS scheme has the characteristic of loss tolerance.Because of its characteristic, there are lots of application scenarios for SIS, such as electronic voting, communications in unreliable public channels, distributed storage system and access control, etc.
At present, there are many kinds of SIS, and the two most important ones are polynomial-based SIS (PSIS) and visual cryptography scheme (VCS) [3][4][5].
In 2002, Shamir's polynomial-based scheme was adopted into SIS by Thien and Lin [6].The scheme encrypts the secret into the coefficients of a random (k − 1)-degree polynomial in a finite field.In the recovery phase, the secret can be reconstructed by Lagrange interpolation.VCS has a unique property that the secret information can be obtained by stacking the shadow images, and humans can easily recognize the secret information by eyes.However, since it is implemented based on OR operation, it has some disadvantages such as low visual quality of recovered images and lossy recovery, etc.In comparison with VCS, PSIS is more suitable for digital images, which can achieve secret image recovery with high visual quality.
Since PSIS can recover the secret image with a high quality, more properties of Shamir's polynomial-based scheme were studied.Yang et al. in [7,8] made use of a polynomial-based scheme to achieve lossless recovery and obtained a two-in-one SIS scheme.In addition, Li et al. in [9] gained the lossless secret image and enhanced the contrast of the image meantime.When considering the case that some shadows with higher importance are essential, Ref. [10] proposed a new (t, s, k, n)-ESIS scheme based on Shamir's scheme, where essential shadows are more important than non-essential shadows.In addition, shadow images with diferent priorities [11][12][13][14][15].Thus, Shamir's polynomial-based scheme has been widely used in SIS [16][17][18].
As a classic SS scheme, the polynomial interpolation is used to recover secret information in Shamir's polynomial-based scheme.The secrets are encrypted into the constant coefficient of a random (k − 1)-degree polynomial.In the recovery phase, the constant coefficient can be solved by Lagrange interpolation, and the coefficient is the value of the secret pixel.
In Shamir's polynomial-based method, to divide the secret number s, a random k − 1 degree polynomial f (x) = a 0 + a 1 x + ... + a k−1 x k−1 is constructed, in which a 0 = s and others are generated randomly in a finite field Fp.Then, it evaluates: f (1), ..., f (i), ..., f (n), which are deserved as shares and distributed to associated participants.
Actually, the substance is to construct the polynomial for (k, n) threshold, in which any k out of n equations can solve the system and get the coefficients of the polynomial.Thus, we introduce matrix theory to review this problem in a wider perspective.Furthermore, based on matrix theory, we propose a general (k, n) threshold SIS construction method [19].Thus, there are two contributions in this paper: (1) Based on the analysis of the polynomial-based method proposed by Shamir, we summarize the necessary and sufficient conditions of constructing the polynomial, which are the basis of (k, n) threshold SIS.(2) Based on matrix theory, we propose a general (k, n) threshold SIS construction.The effectiveness of the proposed construction is indicated by experimental results and analyses.
The following main content of the paper is as follows: Section 2 introduces some preliminary techniques as the basis of the proposed construction.In Section 3, the proposed (k, n) threshold SIS construction method is presented in detail.Section 4 gives experimental results and analyses.Finally, Section 5 concludes this paper.

Preliminaries
Some preliminaries are given here as the basis of our work.The goal of (k, n) threshold SIS is to share the secret image S into n shadow images SC 1 , SC 2 , ..., SC n in such a way that: (1) knowledge of any k or more shadow images makes S easily computable; (2) knowledge of any k − 1 or fewer shadow images leaves S completely undetermined.
First of all, Shamir's polynomial-based scheme is given in Section 2.1.Furthermore, we will introduce analysis of Shamir's polynomial-based scheme based on matrix theory.At the end of this section, we propose the necessary and sufficient condition for (k, n) threshold SIS construction.

Shamir's Polynomial-Based Scheme
Shamir's scheme is based on polynomial interpolation.The scheme encrypts the secret into the constant coefficient of a random (k − 1)-degree polynomial in a finite field.In the recovery phase, the secret can be reconstructed by Lagrange interpolation.For example, we take a pixel value s as the gray value of the first secret pixel, and then to split s into n pixels corresponding to n shadows.The specific scheme is listed as follows: (1) In the sharing phase, given a pixel value s, we select a prime number p, and p > max(n, s).
In order to divide s into pieces sc i , we generate a k − 1 degree polynomial in which a 0 = s and a i (i = 1, • • • , k − 1) are randomly selected in the finite field D = Zp[0, p − 1], and then compute and take (i, sc i ) as a secret pair, where i serves as an identifying index or a order lable and sc i serves as a shared pixel value.
The process repeats until all pixels of the secret image are processed.In the end, n shadow images are generated.(2) In the recovery phase, given any k pairs {(i j , we can reconstruct f (x) by the Largrange's interpolation, and then evaluate s = f (0).Knowledge of just k − 1 of these values does not suffice in order to calculate s.

Analysis of Shamir's Polynomial Based on Matrix Theory
In Shamir's sharing polynomial shown in Equation (1), equations in Equation ( 2) are calculated in the sharing phase.In the recovery phase, when any k participants with k pairs get together, the polynomial f (x) can be reconstructed by solving the k equations.Without loss of generality, we can assume that their pairs are (1, f (1)), (2, f (2)), • • • , (k, f (k)).Thus, we can get k equations as follows: Here, the parameter k is fixed, and a 0 , a 1 , ..., a k−1 are unknown.Thus, Equation ( 3) is a linear system with k equations and k unknowns.In another point of view, Equation (3) is equivalent to the following vector where a deserves as a variable: According to Equation (4), we can rewrite Equation (3) as Equation ( 5): Actually, linear equations in Equation (3) and vector equation in Equation ( 4) is equivalent.In addition, solution and solution vector are indiscriminate.
Using the rank of the coefficient matrix K and the augmented matrix (K, f), we can easily discuss whether the linear system in Equation (3) has a unique solution according to the following theorem.
Theorem 1. Assume that there is a k-variables linear equations Ka = f.The necessary and sufficient condition for a unique solution is: rank According to this theorem, to solve the Equation (3) and then get the coefficients of f (x), we must ensure that the rank of the coefficient matrix K is k.
In Shamir's polynomial-based SS scheme, the coefficient matrix K of the equations is: The coefficient matrix is a Vandermonde matrix.Because the Vandermonde matrix has a property that the rank of any k order submatrix is k, the equation system in Shamir's scheme is solvable with a unique solution [20].
One of the efficient methods to get the sharing polynomial is to use the Langrange interpolation.More generally, considering that the recovery phase is equivalent to equation solving, we can use matrix theory to solve equations and obtain the coefficients.According to Equation ( 5) and Theorem 1, we can solve a through the inverse matrix of k order submatrix.

The Design Rule of Generating the Coefficient Matrix of Sharing Polynomial
The analysis in Section 2.2 proves that the principle of Shamir's scheme is to select a Vandermonde matrix as the coefficient matrix to construct a polynomial and reconstruct the polynomial by Langrange interpolation.
In fact, Shamir's sharing polynomial constructed by the Vandermonde matrix is only a special case of constructing a sharing polynomial satisfying a (k, n) threshold.We can use a more general coefficient matrix to construct sharing polynomial equations, to encrypt the secret into n shares and to decrypt the secret by any k shares if and only if the coefficient matrix satisfies the following theorem: Theorem 2 (Objective Theorem).Given an n × k matrix K and a vector a = (a 0 , a 1 , • • • , a k ) T in which a 0 = s and others are generated randomly, we can construct a linear system of equations Ka = f to encrypt s into n shares.In the recovery phase, in order to reconstruct vector a by any k × k submatrix of K and corresponding shares, K must satisfy the following condition: Any k row vectors of the coefficient matrix K are linearly independent.
The correctness of this theorem is obvious.Once the coefficient K meets Theorem 2, the rank of any k order submatrix of K is k.According to Theorem 1, k-variables' linear equations Ka = f in Equation (3) has a unique solution.Hence, a coefficient matrix satisfying Theorem 2 can be applied to construct the sharing polynomial.In addition, in the recovery phase, we can decrypt the shares to secret by solving the inverse matrix instead of using Langrange interpolation.Thus, a (k, n) threshold SIS scheme could be constructed.
The question now is how to construct the coefficient matrix satisfying the requirement in Theorem 2. In the following section, we will first introduce a coefficient matrix generation approach and further propose a general (k, n) threshold SIS construction based on matrix theory.

The Basic Idea
In order to construct the SIS, we first need to construct a matrix K with size of n × k, which satisfies Theorem 2. Let the constructed matrix serve as the coefficient matrix shown in Equation ( 4) and compute f = Ka to get shared pixel values of shadow images.The shadows are distributed to participants, and every row vector of K is distributed to corresponding participants as well.
In the recovery phase, suppose that k participants get together to reconstruct the sharing polynomial.After the polynomial is reconstructed, the secret is obtained by a 0 .Next, we will introduce our method and proof in Section 3.2, and we will also do a feasibility study showed in Section 3.3.Section 3.4 gives a detailed construction method of the proposed general (k, n) threshold SIS scheme.

Construction Method of the Coefficient Matrix K
This part will show how to construct the matrix K satisfying Theorem 2. Based on the analysis, we summarize a construction method as Theorem 3.According to Theorem 3, the n × k coefficient matrix K is constructed by a special matrix G, in which the determinant of all submatrices is non-zero.

Given matrix G and α
, and the k-dimensional row vectors (α 1 , α 2 , • • • , α k ) are linearly independent.For example, α can be a Vandermonde matrix.We note that G and α are generated by random assignment and validation.In addition, the feasibility analysis is given in Section 3.3.Then, we compute β = Gα.Thus, we can get another matrix , in which the k-dimensional row vectors are linearly independent.Then, we create a new matrix K by concatenating the two matrices α and β: and the size of matrix K is 2k × k.
That is to say, any vector ) can be expressed linearly by row vectors in α.Gathering these linear expressed into a matrix form, we have in which G serves as a temporary coefficient matrix.By computing β = Gα and concatenating α and β, we will get a matrix K which satisfies Theorem 2. We note that the row vector group of α and β are all linearly independent.However, any k vectors selected between α and β are not apparently linearly independent, which is the reason why we give Theorem 3 and the corresponding proof.
Theorem 3 (Conditional Theorem).Given a set of linearly independent k-dimensional row vectors . Let matrix G satisfy that all the minors of matrix . Thus, we can conclude that any k vectors of the coefficient matrix K are linearly independent.
Proof.Select any k vectors to form (1) For the case of C = α, since the vectors of α are linearly independent, the vectors of C are linearly independent.
(2) For the case of C = β, since β = Gα and G is invertible, the vectors of C are linearly independent.
(3) For the case of Consider the equation according to Equations ( 8) and ( 9), we have linearly independent, according to matrix theory, we get which can be written as Then, the size of G is t × t, and t range from 1 to k.Now, look at the coefficient matrix in Equation ( 13) whose rank is s + rank(G ).Since all the minors of matrix G are full rank, the rank of G is t, that is, rank(G ) = t.Thus, the determinant of the coefficient matrix in Equation ( 13) is nonzero.Hence, from Equation ( 13), we get: Thus, according to Equation (10), Thanks to the matrix G has the special property, the matrix K has such a property: any k vectors of the coefficient matrix K are linearly independent.Because of that, we can construct a (k, n x ) threshold SS (n x ranges from k to 2k).For the purpose of simplicity, we assume a (k, n x ) as (k, n) threshold in the rest of this paper, which is enough for real applications.
Based on the constructed coefficient matrix K, we will introduce a method of constructing (k, n) threshold SIS schemes.

Feasibility Analysis
Generating linearly independent vectors is a difficult problem in mathematics.However, the random search method can be a solution.Estimates of the density of matrix show that one could easily find the initial matrix α and the temporary matrix G satisfying Theorem 3.
Randomly select n vectors in a set {α 1 , α 2 , • • • , α n } ∈ Z n p ; the probability of these vectors being linearly independent is P r : For example, when p = 23, P r ≥ 0.95; p = 131, P r ≥ 0.992; p = 251, P r ≥ 0.996.Thus, when p is a big prime number, the probability of any n vectors being linearly independent is very high.That is to say, the initial matrix α of which the vectors are linearly independent is easily to be generated.Furthermore, when taking into consideration that all the minors of an n × n G are nonzero, we can analyze the probability by way of the method mentioned above.Let P i be the probability of that all the i × i minors of G (i range from 1 to n)are nonzero.Hence, we get: . .
Thus, we can get the value of P r , the probability of that any minors of matrix G is nonzero, as follows: When p = 251, n = 3, Thus, we can get randomly generate a qualified G matrix by average 40.58 times.This implies that the construction is feasible.

The Algorithms of Secret Image Sharing
At the beginning of this section, we first connect the theorems to each other.Theorem 1 is the necessary and sufficient condition that the linear equations Ka = f have a unique solution.The objective theorem Theorem 2 is the principle that Ka must satisfy according to Theorem 1.The conditional theorem, Theorem 3, is the method of constructing coefficient matrix Ka to satisfy our objective theorem.Hence, we could get a general (k, n) threshold SIS construction.
In this section, we use the constructed coefficient matrix K to achieve polynomial-based SIS.In what follows, the original grayscale secret image is represented by S, and the size is M × N. Without loss of generality, we split the first secret pixel s into n pixels corresponding to n shadows' images.

The Sharing Phase
In the sharing phase, to divide the secret s into pieces sc i , we generate a matrix K constructed by the way mentioned in Section 3.2.We select a prime number p.We generate a vector a = (a 0 , a 1 , • • • , a k−1 ) where a 0 = s and the others are k − 1 random integer numbers generated in the finite field Zp = [0, p − 1].Then, compute Ka = f as follows: sc i is distributed to the ith participant, as well as the corresponding ith row vector k i of the matrix K.We take (k i , sc i ) as a share, where k i serves as an identifying index or a key and sc i serves as a pixel value.The steps are described in Algorithm 1.
Step 3: Compute f = Ka(mod p), where sc The pseudo code of Algorithm 1 is presented as follows: Algorithm 1 Matrix (k, n, K, S, M, N, P) for j = 1 to N do 3: for k = 1 to n do 7: end for 9: end for 10: end for Finally, according to Algorithm 1, the n shadow images are generated succesfully by the proposed SIS scheme based on matrix theory.It should be noted that we utilize the largest prime number less than 255; however, the grayscale pixel value of an image ranges from 0 to 256, so our construction is not totally lossless.However, it is still a high resolution SIS construction method.

The Recovery Phase
In the recovery phase, given any we can concatenate k vectors k i j to generate a submatrix K mini .Thus, we can finally obtain the vector a = (a 0 , a 1 , • • • , a k−1 ) by solving the following linear equation: the secret pixel s is the value of a 0 .Note that all the calculations are performed in a finite field.The value of a 0 will not be solved if the number of linearly independent vectors is less than k.The specific recovery steps are shown in Algorithm 2.
Algorithm 2. The proposed general (k, n) threshold SIS construction in matrix method in recovery phase Input: The k shadow images which are randomly selected from n secret shadow images SC 1 , SC 2 , • • • , SC n and corresponding k vectors k i j Output:The original secret image S Step 1: According to the k vectors k i , concatenate k vectors k i to a matrix K mini .
Step 4: Get the coefficient a 0 of f (x) by computing linear system according to Equation (19), and set the pixel S(i, j) = a 0 .
Step 5: Output the secret image S.
The pseudo code of Algorithm 2 is presented as follows.
Algorithm 2 recover (k, K, M, N, P) for l = 1 to N do 3: end for 10: end for

Complexity Evaluation
The algorithm complexity for decryption of Shamir's scheme is O k log 2 k , while k is the total number of shares participating in recovery.In addition, the algorithm complexity for equation system solution is O k 2 ∼ O k 3 .Since the coefficient matrix is not a sparse matrix, the algorithm complexity of the proposed method is O k 3 , which is a little higher than that of Shamir.

Image Illustration
In this section, this paper carries on the experiments and analyses of the proposed method.Experimental images demonstrate the effectiveness intuitively while corresponding histograms draw the probability distribution of pixel values to present features from the view of statistic analysis.
In the experiments, first, as shown in Figure 1, we adopt Shamir's polynomial-based (2, 4) threshold scheme.Second, as shown in Figure 2, we perform an experiment with our construction, where the threshold is (2,4).In addition, corresponding histograms will follow, as shown in Figure 3. Finally, simulation results of the proposed construction are presented in Figure 4, where threshold is (3,6).Figures 1a and 4a are used as the original gray secret images, with a size of 256 × 256.As a special case of our construction method, Figure 1 shows an experiment based on Shamir's polynomial-based scheme, where the coefficient matrix is a 4 × 2 Vandermonde matrix: In this case, α =   This coefficient matrix used to construct the polynomial is a Vandermonde matrix, which is the basis of Shamir's polynomial-based scheme.Hence, it is proved that Shamir's polynomial-based scheme is a special case in our construction method.
Next, in a more general case, using the coefficient matrix construction method, we generate a random 4 × (However, of course, we can use any two row vectors to generate a (2, 2) threshold scheme; we can surely use any three row vectors to get a (2, 3) threshold scheme.Here, we take the (2, 4) threshold as an example.)Then, as shown in Figure 2b-e, we generate four noise-like shadows' images SC 1 , SC 2 , SC 3 and SC 4 using Algorithm 1.In the recovery phase, Figure 2f-k is secret images revealed by any two shadow images.
The experimental results in Figure 2 imply that the coefficient matrix K which satisfies Theorem 3 could construct the polynomial for a (2, 4) threshold SIS scheme.
Furthermore, corresponding histograms draw the probability distribution of pixel values to verify the security of the construction method from the view of statistic analysis, as shown in Figure 3. From the Figure 3b-e, we can see that the probability distribution of pixel values in shadow images is equally distributed, which proves that the construction method is secure.
In addition, we generate a random 6 × 3 matrix K as follows.Let α =    Using this matrix to construct a general SIS scheme, we can get experimental results of (3, 6) threshold, as shown in Figure 4. Figure 4a presents the grayscale secret image.Six shadow images SC 1 , SC 2 , ..., SC 6 are generated, three of which are shown in Figure 4b-d.The image recovered by the first two shadow images is shown in Figure 4e.From Figure 4e, we can see that the recovered image with less than three shadow images gives no clue about the secret image.Figure 4f shows the image recovered by SC 1 , SC 2 and SC 3 ; Figure 4g shows the image recovered by SC 4 , SC 5 and SC 6 .The experimental results in Figure 4 imply that the coefficient matrix K who satisfies Theorem 3 could construct the polynomial for a (3, 6) threshold SIS scheme.As a result, it is demonstrated that the proposed objective theorem and conditional theorem are correct.
The proposed method is a construction for more SIS schemes since every different coefficient matrix K can be used to construct a SIS scheme.Hence, there is no comparison between the proposed method and other SIS schemes.

Brief Summary
Based on experimental results shown in Figures 1-3, we can conclude that: (1) The proposed objective theorem and conditional theorem are effective.(2) The shares are noise-like, hence either every single share gives no clue about the secret.
(3) The proposed construction achieves (k, n) threshold SIS.With k or more shares, the secret image could be recovered precisely, while the images recovered with less than k shares give no clue about the secret image.(4) Our general (k, n) threshold secret image sharing construction based on matrix theory is effective.Furthermore, Shamir's polynomial-based scheme is a special case of our construction method.

Conclusions
Based on the analysis of the principle of Shamir's polynomial-based scheme, we proposed the objective theorem and conditional theorem, by which we can generate the coefficient matrix of (k, n) threshold sharing polynomials.Furthermore, based on matrix theory, we proposed a general (k, n) threshold SIS construction method.Theoretic proofs and experimental results demonstrate that our construction is effective, and Shamir's polynomial-based scheme is a special case of our construction method.Exploring the situation of n > 2k and achieving a lossless recovery will be the future work.

Algorithm 1 . 1 :
The proposed general (k, n) threshold SIS construction by matrix theory for sharing phase Input: The threshold parameters (k, n), a matrix K constructed by Theorem 3, a secret image S with size of M × N and a prime number p Output:n shadow images SC 1 , SC 2 , • • • SC nStep For every secret pixel s in each position

Figure 1 .
Figure 1.Simulation results of Shamir's polynomial-based scheme, where k = 2, n = 4. (a) the secret image; (b-e) four original shadow images SC 1 , SC 2 , SC 3 and SC 4 ; (f) revealing results by SC 1 and SC 2 ; (g) revealing result by SC 1 and SC 3 ; (h) revealing results by SC 1 and SC 4 ; (i) revealing results by SC 2 and SC 3 ; (j) revealing results by SC 2 and SC 4 ; (k) revealing results by SC 3 and SC 4 .

3 .
Hence, it is obvious that the matrix in Equation(20) satisfies the objective theorem that any k row vectors are linearly independent.Figure1b-e are four noise-like shadow images SC 1 , SC 2 , SC 3 and SC 4 , which are generated from (2, 4) threshold construction.The result revealed by any two shadow images are shown in Figure1f-k.

Figure 2 .
Figure 2. Simulation results of the proposed method with the coefficient matrix as Equation (21), where k = 2, n = 4. (a) the secret image; (b-e) four original shadow images SC 1 , SC 2 , SC 3 and SC 4 ; (f) revealing results by SC 1 and SC 2 ; (g) revealing results by SC 1 and SC 3 ; (h) revealing results by SC 1 and SC 4 ; (i) revealing results by SC 2 and SC 3 ; (j) revealing results by SC 2 and SC 4 ; (k) revealing results by SC 3 and SC 4 , using our general (k, n) threshold SIS construction based on matrix theory.
Thus, a 6 × 3 coefficient matrix K for a(3,6) threshold SIS is obtained by concatenating α and β as follows:

Figure 4 .
Figure 4. Simulation results of the proposed method with the coefficient matrix as Equation (22), where k = 3, n = 6.(a) the secret image S; (b-d) three shadow images SC 1 , SC 2 , SC 3 of the six shadow images; (e) revealing result by SC 1 and SC 2 ; (f) revealing result by SC 1 , SC 2 and SC 3 ; (g) revealing result by SC 4 , SC 5 and SC 6 .