## 2 XOR-Based VCS
### The Ou et al.'s XOR-Based VCS  
The schematic of [PERSON] et al.'s XOR-based VCS [16] is shown in Figure 2. The principle described in [16] is to use Algorithm 1 to create two different arrays: \(M_{n\text{-}odd}\) and \(M_{n\text{-}even}\), which are used in Algorithm 2. In the Algorithm 3, first, the user sets a parameter \(\beta\)  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Notations** & **Description** \\ \hline \(\oplus\) & Boolean XOR operation \\ \(S\) & Secret image \\ \(C_{1},\ldots,C_{n}\) & Cover images \\ \(R_{1},\ldots,R_{n}\) & Shares generated by VCS \\ \((i,j)\) & The position of \(i\) column and \(j\) row \\ \(S(i,j),C_{x}(i,j),R_{x}(i,j)\) & The value of \(S(i,j),C_{x}(i,j)\) and \(R_{x}(i,j)\) for any \(x\in\{1,2,\ldots,n\}\) (for \\  & black-and-white image, or grayscale image) \\ \(\mathrm{S}^{\mathrm{R}/\mathrm{G}/\mathrm{B}}(i,j),\mathrm{C}^{\mathrm{R}/ \mathrm{G}}(i,j)\), & The value of red/green/blue channel of \(S(i,j),C_{x}(i,j)\) and \(R_{x}(i,j)\) for any \(x\in\{1,2,\ldots,n\}\) (for color image) \\ \(\mathrm{R}^{\mathrm{R}}_{(i,j)},\ldots,n\) & XOR-ed result by shares \(R_{1},\ldots,R_{n}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Notations used in this work.  
(\(0\leq\beta\leq 1\)). When processing each pixel, the algorithm generates a random number \(d\) (\(0\leq d\leq 1\)). If \(d\leq\beta\), it uses Algorithm 2 to encrypt this pixel. If \(d>\beta\), it camouflages the pixels. Finally, XOR operation is used to stack all encrypted images, and the original secret image is completely restored.  
```
Input: A parameter \(n\). Output: A \(2^{n}\times n\) matrix \(M_{n}\).
1. for\(i=1\); \(i<=2^{n}\) ; \(i=i+1\)do \(M_{n}(i,1:n)=\text{de2 bi}(i-1,n)\). endfor
2. Output the matrix \(M_{n}\).
```  
**Algorithm 1** Generate a \(2^{n}\times n\) matrix for (\(n,n\)) XOR-based VCS [16]  
```
Input: A binary secret image \(S\) with \(H\times W\) pixels, and a \(2^{n}\times n\) matrix \(M_{n}\). Output: \(n\) shares \(R_{1},\ldots,R_{n}\), each of which is \(H\times W\) in size.
1. Divide the matrix \(M_{n}\) into two \(2^{n}-1\times n\) sub-matrices \(M_{n\text{-}old}\) and \(M_{n\text{-}even}\), where \(M_{n\text{-}old}\) includes the row vectors whose hamming weight is an odd number, while \(M_{n\text{-}even}\) includes the row vectors whose hamming weight is an even number.
2. if(\(S(i,j)=0\))  Randomly select an integer value \(r\) with equal probability on [1, \(2^{n-1}\)]. \(R_{1}(i,j)=M_{n\text{-}even}(r,1)\), \(R_{2}(i,j)=M_{n\text{-}even}(r,2)\), \(\ldots,R_{n}(i,j)=M_{n\text{-}even}(r,n)\). else Randomly select an integer value \(r\) with equal probability on [1, \(2^{n-1}\)]. \(R_{1}(i,j)=M_{n\text{-}old}(r,1)\), \(R_{2}(i,j)=M_{n\text{-}old}(r,2)\), \(\ldots,R_{n}(i,j)=M_{n\text{-}old}(r,n)\).
3. Repeat Step 2 until all secret pixels have been processed, and output \(n\) shares \(R_{1},\ldots,R_{n}\), each of which has the same image size as the secret image.

**Algorithm 2** The basic algorithm for XOR-based VCS with meaningful shares [16]
``` Input: A binary secret image \(S\) and a cover image \(C\), both with \(H\times W\) pixels, and a parameter \(\beta\). Output: \(n\) meaningful shares \(R_{1},\ldots,R_{n}\), each of which is \(H\times W\) in size.
1. Generate a random floating point \(d\) (\(0\leq d\leq 1\)).
2. if(\(d<\beta\))  Generate \(n\) pixels \(t_{1},\ldots,t_{n}\) by Algorithm 2 for secret pixel \(S(i,j)\). \(R_{1}(i,j)\)= \(t_{1}\), \(R_{2}(i,j)\)= \(t_{2}\), \(\ldots,R_{n}(i,j)\)= \(t_{n}\).
3. else if(\(n\times C(i,j)\) is an even number) \(R_{1}(i,j)=C(i,j)\), \(R_{2}(i,j)=C(i,j)\), \(\ldots,R_{n}(i,j)=C(i,j)\). else Randomly select a number \(f\) from {1, \(\ldots,n\)}. \(R_{1}(i,j)=C(i,j)\), \(\ldots,R_{n}(i,j)=C(i,j)\).
4. Repeat Steps 1-3 until all secret pixels have been processed, and output \(n\) shares \(R_{1},\ldots,R_{n}\), each of which has the same image size as the secret image.