# An Improved Product Code-Based Data Hiding Scheme
## Appendix A.1.2 Extracting
### Embedding  
_Step 1_: From (\(\mathbf{s}_{1}\), \(\mathbf{s}_{2}\), \(\mathbf{s}_{3}\), \(\mathbf{s}_{4}\), \(\mathbf{s}_{5}\), \(\mathbf{s}_{6}\), \(\mathbf{s}_{7}\)) = (100, 100, 011, 010, 011, 010, 000) and (\(\mathbf{m}_{1}\), \(\mathbf{m}_{2}\), \(\mathbf{m}_{3}\), \(\mathbf{m}_{4}\), \(\mathbf{m}_{5}\), \(\mathbf{m}_{6}\), \(\mathbf{m}_{7}\)) = (011, 111, 101, 011, 100, 010, 110), we obtain (\(\mathbf{ts}_{1}\), \(\mathbf{ts}_{2}\), \(\mathbf{ts}_{3}\), \(\mathbf{ts}_{4}\), \(\mathbf{ts}_{5}\), \(\mathbf{ts}_{6}\), \(\mathbf{ts}_{7}\)) = (111, 011, 110, 001, 111, 000, 111).  
_Step 2_: From (\(\mathbf{s}_{8}\), \(\mathbf{s}_{9}\), \(\mathbf{s}_{10}\), \(\mathbf{s}_{11}\)) = (010, 000, 111, 001) and (\(\mathbf{m}_{8}\), \(\mathbf{m}_{9}\), \(\mathbf{m}_{10}\), \(\mathbf{m}_{11}\)) = (101, 100, 011, 000), we have (\(\mathbf{ts}_{8}\), \(\mathbf{ts}_{9}\), \(\mathbf{ts}_{10}\), \(\mathbf{ts}_{11}\)) = (111, 100, 100, 001). Hence, (\(\mathbf{ts}_{8}\), \(\mathbf{ts}_{9}\), \(\mathbf{t}_{10}\), \(\mathbf{t}_{11}\)) = (\(\mathbf{e}_{8}\), \(\mathbf{e}_{9}\), \(\mathbf{e}_{10}\), \(\mathbf{e}_{11}\)) = (0000010, 100000, 100000). Then,  
\[\left[\mathbf{f}_{1}^{\intercal}\mathbf{f}_{2}^{\intercal}\mathbf{f}_{3}^{ \intercal}\mathbf{f}_{4}^{\intercal}\mathbf{f}_{5}^{\intercal}\mathbf{f}_{6 }^{\intercal}\mathbf{f}_{7}^{\intercal}\right]=\left[\begin{array}{cccccc}0&0&0&0 &0&1&0\\ 1&0&0&0&0&0&0\\ 1&0&0&0&0&0&0\\ 0&0&1&0&0&0&0\end{array}\right]\]  
_Step 3_: For each \(i\) = 1\(\sim\) 7, given \(\mathbf{ts}_{i}\) and \(\mathbf{f}_{i}\), \(\mathbf{t}_{i}\) can be obtained respectively through the lookup in Table 1 as follows: \(\mathbf{t}_{1}\) = [0110110], \(\mathbf{t}_{2}\) = [0000100], \(\mathbf{t}_{3}\) = [0001000], \(\mathbf{t}_{4}\) = [0000111], \(\mathbf{t}_{5}\) = [0000010], \(\mathbf{t}_{6}\) = [1000110], \(\mathbf{t}_{7}\) = [0000101]. Now,  
\[\mathbf{T}=\left[\begin{array}{cccccc}0&1&1&0&1&1&0\\ 0&0&0&0&1&0&0\\ 0&0&0&1&0&0&0\\ 0&0&0&0&1&1&1\\ 0&0&0&0&0&1&0\\ 1&0&0&0&1&1&0\\ 0&0&0&0&1&0&1\end{array}\right].\]  
_Step 4_: For the seven rows of \(\mathbf{T}\), the first, forth, and sixth rows, each of which has a Hamming weight greater than 2. Suppose we choose the first and forth rows, take the element-wise OR operation between both rows, we obtain \(\mathbf{u}\) = (0110111). \(\mathbf{c}\) = (0010111) is the closest codeword to \(\mathbf{u}\). Then, \(\mathbf{c}\) is added sequentially to the first and forth rows. This is equivalent to vector \(\mathbf{w}\) = (1001000) being added implicitly into the 3 rd, 5 th, 6 th, and 7 th columns. The coset leader \(\mathbf{e}\) = (0100000) of the coset to which \(\mathbf{w}\) belongs is determined and the bit 1 is located in the second component. Therefore, the codeword **c** is also added to the 2 nd row of **T**. Now, the toggle array T is updated as T\({}^{\prime}\) with smaller Hamming weight.  
\[\textbf{T}^{\prime}=\left[\begin{array}{cccccccc}0&1&0&0&0&0&1\\ 0&0&1&0&0&1&1\\ 0&0&0&1&0&0&0\\ 0&0&1&0&0&0&0\\ 0&0&0&0&0&1&0\\ 1&0&0&0&1&1&0\\ 0&0&0&0&1&0&1\end{array}\right]\]  
_Step 5_: Finally, the stego array **Y** is obtained by adding \(\textbf{T}^{\prime}\) to **X**.  
\[\text{Y}=\left[\begin{array}{cccccccc}0&0&0&0&1&0&0\\ 1&1&1&1&0&1\\ 0&0&1&0&1&1&0\\ 1&0&0&0&0&1&0\\ 1&1&0&0&0&1&1