# Dual Partial Reversible Data Hiding Using Enhanced Hamming Code
## 3 Proposed Scheme
```
0: Two score images \(\mathbf{I}_{1}\), \(\mathbf{I}_{2}\); secret bits \(M=(m_{1},m_{2},\ldots,m_{n})\)
0: Two stego images \(\Delta\mathbf{I}_{1}\), \(\Delta\mathbf{I}_{2}\)
1:\(\Delta\mathbf{I}_{1}\leftarrow\mathbf{I}_{1}\); \(\Delta\mathbf{I}_{2}\leftarrow\mathbf{I}_{2}\)\(\triangleright\) Secret bit index
2:\(k\gets 1\)
3:for\(j=1\) to \(size(\mathbf{I}_{1})\)do
4: Access pixel \(x_{j}\) from \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\)
5: Construct virtual pixel \(y\) according to Equation (4)
6:\(\tilde{k}\gets b2d(a_{4}\ a_{3}\ a_{2}\ a_{1})\)
7:\(\tilde{\beta}\gets b2d(b_{3}\ b_{2}\ b_{1})\)
8: Extract secret bits \(m_{k}^{k+2}\) (3 bits)
9:if coset(\(y\)) \(\
eq\) target coset leader derived from \(m_{k}^{k+2}\)then
10: Initialize \(e_{min}\leftarrow\infty\), \(h_{opt}\leftarrow\emptyset\)
11:for each codeword \(h\) in LUT do
12:\(\alpha\gets b2d(h_{7}\ h_{6}\ h_{4})\)
13:\(\beta\gets b2d(h_{7}\ h_{2}\ h_{1})\)
14:\(\varepsilon\leftarrow(\alpha-\tilde{\alpha})^{2}+(\beta-\tilde{\beta})^{2}\)
15:if\(\varepsilon<e_{min}\)then
16:\(\varepsilon_{min}\leftarrow\varepsilon\)
17:\(h_{opt}\gets h\)
18:endif
19:endfor
20: Update \(x_{j}^{1}\) and \(x_{j}^{2}\) according to Equation (6)
21:endif
22: Save updated \(x_{j}^{1}\) to \(\Delta\mathbf{I}_{1}(j)\); \(x_{j}^{2}\) to \(\Delta\mathbf{I}_{2}(j)\)
23:\(k\gets k+3\)\(\triangleright\) Move to next 3 secret bits
24:endfor
```  
**Algorithm 2** Embedding Procedure  
```
0: Two stego images \(\Delta\mathbf{I}_{1}\), \(\Delta\mathbf{I}_{2}\)
0: Recovered cover images \(\mathbf{I}_{1}\), \(\mathbf{I}_{2}\), and extracted secret bits \(m\)
1: Initialize: \(k\gets 1\)
2:for\(j=1\) to \(size(\Delta\mathbf{I}_{1})\)do
3: Access pixel data from \(\Delta\mathbf{I}_{1}\) and \(\Delta\mathbf{I}_{2}\)
4: Reconstruct virtual pixel \(y\) using selected bits
5: Calculate syndrome \(S\gets yH^{T}\)\(\triangleright\) Extract hidden bits
6: Store \(S\) into \(m(k:k+2)\); \(k\gets k+3\)
7:\(\tilde{\alpha}\gets b2d(a_{4}\ a_{3}\ a_{2}\ a_{1})\); \(\tilde{\beta}\gets b2d(b_{3}\ b_{2}\ b_{1})\)
8: Initialize \(\varepsilon_{min}\leftarrow\infty\), \(h_{opt}\leftarrow\emptyset\)
9:for each codeword \(h\) in LUT do
10:\(\alpha\gets b2d(h_{7}\ h_{6}\ h_{8}\ h_{4})\); \(\beta\gets b2d(h_{3}\ h_{2}\ h_{1})\)
11:\(\varepsilon\leftarrow(\alpha-\tilde{\alpha})^{2}+(\beta-\tilde{\beta})^{2}\)
12:if\(\varepsilon<\varepsilon_{min}\)then
13:\(\varepsilon_{min}\leftarrow\varepsilon\); \(h_{opt}\gets h\)
14:endif
15:endfor
16: Update \(x_{j}^{1}\) and \(x_{j}^{2}\) based on \(h_{opt}\)\(\triangleright\) Recover cover pixels
17: Save \(x_{j}^{1}\) into \(\mathbf{I}_{1}(j)\); \(x_{j}^{2}\) into \(\mathbf{I}_{2}(j)\)
18:endfor
```  
**Algorithm 3** Extraction and Recovery Procedure  
The process begins with the **Cover Image Generator**, which takes the original image \(O\) and produces two structurally optimized cover images \(\mathbf{I}_{1}\) and \(\mathbf{I}_{2}\) using HC(7\(A\))-based syndrome modulation. These images are generated to support reliable and low-distortion embedding. Next, the **Data Embedder** receives the cover images and a payload bitstream, then embeds the payload through a syndrome-modulated mapping strategy using a preconstructed lookup table. This process results in two stego images \(\textbf{I}^{\prime}_{1}\) and \(\textbf{I}^{\prime}_{2}\) containing the hidden information while preserving high image fidelity. Finally, the **Data Extractor** takes the stego images as input, reconstructs the original message by performing parity-check-based extraction, and reverses the embedding steps to accurately restore the original image. This module ensures lossless recovery of both the hidden data and the original content.