# Reversible Data Hiding in Encrypted Color Halftone Images with High Capacity
## 3 Proposed Scheme
### Extraction and Recovery  
In this section, we discuss the two situations on the receiver's side. Depending on the different types of key, the receiver can extract the watermark (having \(K_{d}\)) or recover the image after extraction (having both \(K_{e}\) and \(K_{d}\)). Because we combine the images into one stego image, if we only decrypt stego image \(\mathbf{C}\), the content of the original image cannot be directly presented. The proposed procedure of extraction and recovery is summarized in Algorithm 2.  
```
0: Stego image \(\mathbf{C}\), secret key \(K_{e}\) and \(K_{d}\)
0: Original halftone image \(\mathbf{O}\) and watermark \(b_{ii}\)
1: Split stego image \(\mathbf{O}\) into channel images \(\mathbf{C}_{R}\), \(\mathbf{C}_{G}\), and \(\mathbf{C}_{B}\)
2:functionDataExtraction(\(\mathbf{C},K_{d}\))
3: Separate \(\mathbf{C}\) to four images \(\mathbf{T}_{C^{\prime}}\), \(\mathbf{T}_{C^{\prime\prime}}\), \(\mathbf{S}_{C^{\prime\prime}}\), and \(\mathbf{T}_{C^{\prime\prime}}\)
4: Divide \(\mathbf{T}_{C^{\prime}}\) into blocks \(\mathbf{W}_{1j}\)
5: Divide \(\mathbf{T}_{C^{\prime\prime}}\) into blocks \(\mathbf{W}_{2j}\)
6:
7:for\(j=1\) to \(w\)do
8:\(\mathbf{y}^{\prime}_{3j}\leftarrow\mathbf{W}_{1j}\)
9: Generated \(\mathbf{D}_{3j}\) using \(K_{d}\)
10:\(\mathbf{\theta}_{3j}=\mathbf{D}_{3j}\times\mathbf{y}^{\prime}_{3j}\)
11: Assign \(\mathbf{z}_{3j}\) to the first four bits of \(\mathbf{W}_{2j}\)
12:\(\mathbf{z}^{\prime}_{3j}=\mathbf{z}_{3j}\oplus\mathbf{\theta}_{3j}\)
13:endfor
14: Stego image \(\mathbf{S}_{C^{\prime}}\leftarrow\mathbf{z}^{\prime}_{3j}\)
15: Divide \(\mathbf{S}_{C^{\prime}}\) into blocks \(\mathbf{E}_{1j}\)
16: Divide \(\mathbf{S}_{C^{\prime\prime}}\) into blocks \(\mathbf{E}_{2j}\)
17:
18:for\(j=1\) to \(w\)do
19:\(\mathbf{y}^{\prime}_{2j}\leftarrow\mathbf{E}_{1j}\)
20: Generated \(\mathbf{D}_{2j}\) using \(K_{d}\)
21:\(\mathbf{\theta}_{2j}=\mathbf{D}_{2j}\times\mathbf{y}^{\prime}_{2j}\)
22: Assign \(\mathbf{z}_{2j}\) to the first four bits of \(\mathbf{E}_{2j}\)
23:\(\mathbf{z}^{\prime}_{2j}=\mathbf{z}_{2j}\oplus\mathbf{\theta}_{2j}\)
24:endfor
25: Stego image \(\mathbf{F}_{C^{\prime}}\leftarrow\mathbf{z}^{\prime}_{2j}\)
26: Divide \(\mathbf{F}_{C^{\prime}}\) into blocks \(\mathbf{P}_{1j}\)
27: Divide \(\mathbf{F}_{C^{\prime\prime}}\) into blocks \(\mathbf{P}_{2j}\)
28:
29:for\(j=1\) to \(w\)do
30:\(\mathbf{y}^{\prime}_{1j}\leftarrow\mathbf{P}_{1j}\)
31: Generated \(\mathbf{D}_{1j}\) using \(K_{d}\)
32:\(\mathbf{\theta}_{1j}=\mathbf{D}_{1j}\times\mathbf{y}^{\prime}_{1j}\)
33: Assign \(\mathbf{z}_{1j}\) to the first four bits of \(\mathbf{P}_{2j}\)
34:\(\mathbf{z}^{\prime}_{1j}=\mathbf{z}_{1j}\oplus\mathbf{\theta}_{1j}\)
35:endfor
36: Cover image \(\leftarrow\mathbf{z}^{\prime}_{1j}\)
37:endfunction
38:\((\mathbf{R},\mathbf{\theta}_{1j},\mathbf{\theta}_{2}\mathbf{\theta}_{3j})=\texttt{DataExtraction}(\mathbf{C}_{R},K_{d})\)
39:\((\mathbf{G},\mathbf{\theta}_{4j},\mathbf{\theta}_{5j},\mathbf{\theta}_{6j})=\texttt{DataExtraction}(\mathbf{C}_{G},K_{d})\)
40:\((\mathbf{B},\mathbf{\theta}_{7j},\mathbf{\theta}_{8j},\mathbf{\theta}_{9j})=\texttt{DataExtraction}(\mathbf{C}_{B},K_{d})\)
41:\(b_{ii}=\theta_{ii}\oplus\mathbf{p}^{\prime}_{ii}\)
42: Merge images \(\mathbf{R}\), \(\mathbf{G}\) and \(\mathbf{B}\) to cover image \(\mathbf{I}\)
43: Decrypt \(\mathbf{I}\) using Equation(16)
44:return Watermark \(b_{ii}\) and original image \(\mathbf{O}\)
```  
**Algorithm 2** Extraction and recovery.