# Fault-Tolerant Visual Secret Sharing Schemes without Pixel Expansion
## 2 Experimental Section
### Random Grid Encryption Algorithm  
For understanding the following sections, we have to understand some important notations about the random grid listed in this section in advance. In general, we define \(S\) as a secret image with a size of \(w\times h\) pixels, where \(w\) and \(h\) are positive integers.  
Definition 1. Let \(S(i,j)\) denote a pixel value of the secret image \(S\) at position \((i,j)\), defined as:  
\[S(i,j)=\left\{\begin{array}{rl}0,&\text{if }S(i,j)\text{ is white;}\\ 1,&\text{if }S(i,j)\text{ is black.}\end{array}\right.\]  
Actually, 1 is opaque and 0 is transparent when \(S\) is printed on a transparency. The opposite value of \(S(i,j)\) is denoted as follows.  
\[\overline{S(i,j)}=\left\{\begin{array}{rl}0,&\text{if }S(i,j)=1;\\ 1,&\text{if }S(i,j)=0.\end{array}\right.=1-S(i,j).\]  
Definition 2. Transmittance (\(T\)) is defined as the proportion of white pixels to total pixels.  
A secret image \(S\) is encrypted into two shares \(G_{1}\) and \(G_{2}\). Let \(r_{i}\) be a pixel in \(G_{i}\) for \(i=1\), \(2\). The resulting value of the overlapped pixels \(r_{1}\) and \(r_{2}\) will be \(r_{1}\oplus r_{2}\), where \(\oplus\) stands for the Boolean \"or\" operation. All results when stacking any two pixels together are shown in Table 1.  
[PERSON] and [PERSON] [2] proposed three different encryption algorithms (Algorithm KK1, KK2 and KK3) for halftone images, in which the value of each pixel in a random grid is determined by flipping a coin, _i.e._, the probability of getting a black or white pixel is the same. Therefore, the transmittance of the random image is \(1/2\). These algorithms encrypt a secret image \(S\) of size \(w\times h\) into two shares \(G_{1}\) and \(G_{2}\) with the same size. We list these algorithms as follows, where \(Rand(0/1)\) is a function with output zero or one randomly and with equal probability.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \(r_{1}\) & \(r_{2}\) & \(r_{1}\oplus r_{2}\) \\ \hline
1 & 0 & 1 \\
1 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Results for stacking two different pixels together.  
```
Algorithm KK1: Generate a \(w\times h\) random grid \(G_{1}\) For (\(i=0\); \(i<w\); \(i++\)) For (\(j=0\); \(j<h\); \(j++\)) If (\(S[i][j]==0\)) \(G_{2}[i][j]=G_{1}[i][j]\); else \(G_{2}[i][j]=1-G_{1}[i][j]\overline{G_{1}}\left[i\right][j]\); Output (\(G_{1}\), \(G_{2}\))
```  
**Algorithm KK2:**  
```
Generate a \(w\times h\) random grid \(G_{1}\) For (\(i=0\); \(i<w\); \(i++\))  For (\(i=0\); \(i<w\); \(i++\))  For (\(i=0\); \(i<w\); \(i++\))  For (\(j=0\); \(j<h\); \(j++\))  If (\(S[i][j]==0\)) \(G_{2}[i][j]=Rand(0/1)\); \(G_{2}\)  else \(G_{2}[i][j]=1-G_{1}[i][j]\overline{G_{1}}\left[i\right][j]\); Output (\(G_{1}\), \(G_{2}\))
```  
**Algorithm KK3:**  
We shall focus on the idea of the Algorithm KK1 in this paper. The analysis of the transmittance of the Algorithm KK1 is show in Table 2. We denote a white pixel by \(\square\) and a black pixel by \(\blacksquare\) in this paper. Note that using the idea of the Algorithm KK2 or KK3 to construct the following schemes will yield similar results.