# An Untraceable Data Sharing Scheme in Wireless Sensor Networks
## 5 Secure Data Sharing between the Source Node and Sink Node
### Light-Weight Secret Sharing Scheme  
Having got the sub-messages, \(x_{1},x_{2},\cdots,x_{t}\), of \(X\) by an interleaving encoder, we construct the shares of \(X\) based on Equation (1) as follows:  
\[s_{i}=\left\{ \begin{array}{ll}s_{1}+\cdots+s_{i-1}+ix_{i}+x_{i+1}+\cdots+x_{t} \text{mod}p,&\text{if }1\leq i\leq t\\ s_{1}+2^{i-t-1}s_{2}+\cdots+t^{i-t-1}s_{t}\text{mod}p,&\text{if }t<i\leq n \end{array} \right.. \tag{1}\]  
In Equation (1), \(p\) is defined as the largest binary number with size \(|X|/t\), i.e., \(p=2^{|X|/t}\). Then, we can infer that the size of \(s_{i}\) is always not larger than \(|X|/t\) which is much smaller than that of \(|X|\). This greatly increases the energy efficiency of constructing the cloud around the source node and we will theoretically analyze it in Section 6.1. Now, we prove the correctness and security of our scheme in Theorems 1 and 2, respectively. **Theorem 1**. : _Any \(T(T\geq t)\) shares of \(X\) can recover message \(X\)._  
Proof. : We prove Theorem 1 by considering two cases. Case 1: We first prove that the first \(t\) shares, \(s_{1},s_{2},\cdots,s_{t}\), constructed by Equation (1) can recover message \(X\). In this case, the shares are calculated as follows:  
\[\left\{ \begin{array}{ll}s_{1}=x_{1}+x_{2}+\cdots+x_{t}\text{mod}p\\ s_{2}=s_{1}+2x_{2}+\cdots+x_{t}\text{mod}p\\ \vdots\\ s_{t}=s_{1}+s_{2}+\cdots+tx\text{mod}p\end{array} \right.. \tag{2}\]  
We can present Equation (2) in matrix manner as shown in Equation (3):  
\[\left( \begin{array}{c}s_{1}\\ \vdots\\ s_{i}\\ \vdots\\ s_{t}\end{array} \right)=\left( \begin{array}{cccc}a_{11}&\cdots&a_{1j}& \cdots&a_{1t}\\ \vdots&&\vdots&&\vdots\\ a_{11}&\cdots&a_{ij}&\cdots&a_{it}\\ \vdots&&\vdots&&\vdots\\ a_{t1}&\cdots&a_{tj}&\cdots&a_{tt}\end{array} \right)\left( \begin{array}{c}x _{1}\\ \vdots\\ x_{i}\\ \vdots\\ x_{t}\end{array} \right)=M\left( \begin{array}{c}x_{1}\\ \vdots\\ x_{i}\\ \vdots\\ x_{t}\end{array} \right). \tag{3}\]  
Based on Equation (2), we can calculate all the coefficients in matrix \(M\) as shown in the follows:  
\[a_{ij}=\left\{ \begin{array}{ll}2^{i-1}+2^{i-j-1}(j-2),&2\leq j<i\\ 2^{j-1}+j-1,&j=i\\ 2^{i-1},&i<j\leq t\\ 2^{i-2},&j=1,i>1\end{array} \right.. \tag{4}\]  
To prove that \(s_{1},s_{2},\cdots,s_{t}\) can recover \(X\), we need to prove that matrix \(M\) is invertible and it theoretically equals to the fact that the determinant of \(M\), i.e., \(|M|\), is a non-zero number. We execute the following Algorithm 1 on matrix \(M\) and we can always get a diagonal matrix. As a consequence, we can prove that the determinant of matrix \(M\) equals to \(t!\) (i.e., \(|M|=t!\)) which is not zero. In other words, we can uniquely get \(x_{1},x_{2},\cdots,x_{t}\) based on Equation (2) once we get \(s_{1},s_{2},\cdots,s_{t}\). Case 2: Then, we prove that any \(t\) shares can recover message \(X\). Without loss of generality, we denote the shares as \(s_{k_{1}},s_{k_{2}},\cdots,s_{k_{t}},s_{t+k_{i+1}},s_{t+k_{i+2}},\ \cdots,s_{t+k_{t}}\). The first \(i(1\leq i<t)\) shares are selected from \(s_{1},s_{2},\cdots,s_{t}\) and the other \(t-i\) shares are selected from \(s_{t+1},s_{t+2},\cdots,s_{n}\). Based on Equation (1), we can calculate \(s_{t+1},s_{t+2},\cdots,s_{n}\) as follows. \[\left\{ \begin{array}{c}s_{t+1}=s_{1}+s_{2}+\cdots+s_{t}\text{mod}p\\ s_{t+2}=s_{1}+2s_{2}+\cdots+ts_{t}\text{mod}p\\ \vdots\\ s_{n}=s_{1}+2^{n-t-1}s_{2}+\cdots+t^{n-t-1}s_{t}\text{mod}p\end{array} \right.. \tag{5}\]  
Under the above assumption, we can obtain the following equation. To prove that \(s_{k_{1}},s_{k_{2}},\cdots,s_{k_{t}},s_{t+k_{i+1}},s_{t+k_{i+2}},\ \cdots,s_{t+k_{t}}\) is equal to \(s_{1},s_{2},\cdots,s_{t}\), we need to prove that matrix \(D\) is an invertible matrix. \[\left( \begin{array}{c}s_{k_{1}}\\ \vdots\\ s_{k_{i}}\\ s_{t+k_{i+1}}\\ \vdots\\ s_{t+k_{t}}\end{array} \right)=\left(