# An Improved Product Code-Based Data Hiding Scheme
## 4 An Improved Product Code-Based Data Hiding Scheme
### Embedding  
_Step 1_: Calculate the syndromes of the last four rows in the cover array \(\mathbf{X}\), i.e., \(\mathbf{s}_{i}=[x_{i+3,1}\ x_{i+3,2}\ \ldots\ x_{i+3,7}]\times\mathbf{H}^{ \mathsf{T}}\), \(i=1\)- 4, where (\(\mathbf{s}_{1}\), \(\mathbf{s}_{2}\), \(\mathbf{s}_{3}\), \(\mathbf{s}_{4}\)) is the first embedding channel with 12 bits in total. The toggle syndrome \(\mathbf{t}\mathbf{s}_{i}=\mathbf{s}_{i}\oplus\mathbf{m}_{i}\), \(i=1\)- 4. From Table 1, respectively, find the corresponding coset leaders \(\mathbf{e}_{i}\) (i.e., the toggle sequence \(\mathbf{t}_{i}\)), \(i=1\)- 4. The four toggle sequences constitute a \(4\times 7\) array with each column denoted as \(f_{i}\), \(i=1\)- 7. Denote \([\mathbf{f_{4}f_{5}f_{6}f_{7}}]\) as \(\mathbf{F}\). Figure 5: 16 chosen code arrays of the (49, 16) product code. _Step 2_: Calculate the syndromes of the last four columns in \(\mathbf{\chi}\), i.e., \(\mathbf{s}_{i}=[x_{1,i-1}\ x_{2,i-1}\ \ldots\ x_{7,i-1}]\times\mathbf{H}^{\mathsf{T}}\), \(i=5\)- \(8\). \((\mathbf{s}_{5}^{\mathsf{T}},\mathbf{s}_{6}^{\mathsf{T}},\mathbf{s}_{7}^{ \mathsf{T}},\mathbf{s}_{8}^{\mathsf{T}})\) is the second embedding channel with 12 bits in total. The toggle syndrome \(\mathbf{t}_{i}=\mathbf{s}_{i}\)\(\oplus\)\(\mathbf{m}_{i}\), \(i=5\)-\(8\). _Step 3_: Make the syndromes of the last four rows and the last four columns of the resultant stego array after embedding respectively equal \(\mathbf{m}_{1}\), \(\mathbf{m}_{2}\), \(\mathbf{m}_{3}\), \(\mathbf{m}_{4}\), and \(\mathbf{m}_{5}\), \(\mathbf{m}_{6}\), \(\mathbf{m}_{7}\), \(\mathbf{m}_{8}\). This can be done through Table 2 (instead of finding the coset leader) to find the toggle sequence \(\mathbf{t}_{i}\) (under the constraint the last four bits of \(\mathbf{t}_{i}\) and the four bits of \(\mathbf{t}_{i-1}\) are equal) with its toggle syndrome equal to \(\mathbf{t}_{i}\), \(i=5\)-\(8\). _Step 4_: First, calculate the CCH part of the parity \(\mathrm{P}(\mathbf{X}_{\mathrm{IB}}\oplus\mathbf{F})\) denoted as \(\mathrm{P}(\mathbf{X}_{\mathrm{IB}}\oplus\mathbf{F})_{\mathrm{CCH}}\), then we obtain the syndrome of size 3 \(\times\) 3 which equals to \(\mathrm{P}(\mathbf{X}_{\mathrm{IB}}\oplus\mathbf{F})_{\mathrm{CCH}}\oplus \mathbf{X}_{\mathrm{CCH}}\). Let the three columns of the syndrome be denoted, respectively, as \(\mathbf{s}_{i}^{\mathsf{T}}\), \(9\leq i\leq 11\), where \((\mathbf{s}_{9}^{\mathsf{T}},\mathbf{s}_{10}^{\mathsf{T}},\mathbf{s}_{11}^{ \mathsf{T}})\) is the third embedding channel with nine bits in total. Second, calculate the toggle syndrome \(\mathbf{t}_{i}^{\mathsf{T}}\), which equals to \(\mathbf{s}_{i}^{\mathsf{T}}\oplus\mathbf{m}_{i}^{\mathsf{T}}\), \(9\leq i\leq 11\). Third, those column matrices \(\mathbf{f}_{i}\), \(i=1\)-\(3\)\(\mathbf{s}_{i}^{\mathsf{T}}\), \(5\leq i\leq 8\), and \(\mathbf{t}_{8}^{\mathsf{T}}\), \(i=9\)-\(11\), constitute the toggle array \(\mathbf{T}\), as shown in Figure 6.  
_Step 5_: To reduce the number of 1s in \(\mathbf{T}\), first check the last four columns of \(\mathbf{T}\) and whether there is more than one column with a Hamming weight in each column of greater than 2. If it does not exist, just skip this step. Otherwise, take the element-wise OR operation among those columns to obtain a new vector \(\mathbf{u}\). Then, using the lookup of Table 1, find a codeword \(\mathbf{c}\), which is closest to \(\mathbf{u}\) in terms of minimal Hamming distance. Add (XOR operation) the codeword \(\mathbf{c}\) to each of those columns. Then, it is very likely some of the rows of \(\mathbf{T}\) have been changed. Let \(\mathbf{w}\) be the induced non-zero vector with the non-zero component denoting the changed position of any changed row. From Table 1, find the coset leader \(\mathbf{e}\) of the coset to which the vector \(\mathbf{w}\) belongs. Hence, to keep the syndrome of the toggle array unchanged, we need to add \(\mathbf{e}\) respectively to those changed rows.