# An Innovative Information Hiding Scheme Based on Block-Wise Pixel Reordering
## 3 Proposed Scheme
### Data Hiding  
When the data hider receives the encrypted image \(I_{e}\) with embedded block numbers, a data hiding key \(k_{d}\), and a secret message \(SM=\{sm_{0},sm_{1},\ \cdots,\ sm_{k}\},\ sm_{k}=\{0,\ 1\}\), an n-dimensional line \(L\) is generated according to the data hiding key \(k_{d}\). The pixels in each pixel-block form a codeword and obtain a projected value by projecting the codeword to the line \(L\). A codeword table \(T\) is created for each block-group by using these codewords and is sorted by their projected values. The sorted codeword table \(T\) is then used to embed the secret bits by applying the codeword index reordering technique described in Section 2.2. Algorithm 1 details the steps of how to embed the secret message \(SM\):  
```
Input  The encrypted image \(I_{e}\), the pixel-block size \(n\), the block-group size \(m\), the data hiding key \(k_{d}\), and the secret message \(SM\). Output  A marked image \(I_{m}\). 1: Obtain an n-dimensional line \(L\) for pixel-blocks in a block-group to project to by using the data hiding key \(k_{d}\). 2: Initialize a marked image \(I_{m}=\{\}\). 3: Form pixel-blocks and block-groups based on sizes \(n\) and \(m\). 4: FOR each block-group \(g_{c}\) in the encrypted image \(I_{e}\)
5: Generate a codeword table \(T=\{cw_{0},\ cw_{1},\ \cdots,cw_{m-1}\}\) using \(g_{c}\)
6: Initialize projected values \(\text{PV}=|\)  FOR each pixel-block \(b_{c}\) in \(g_{c}\)  Obtain projected value \(\lambda_{c}=b_{c}\cdot L\)  Append \(\lambda_{c}\) to PV. END  Sort codeword table T according to PV to obtain the sorted codeword table \(T\prime=\{cw^{\prime}_{0},\ cw^{\prime}_{1},\ \cdots,\ cw^{\prime}_{m-1}\}\). 9: Initialize a stego codeword table \(\text{ST}=|\). WHILE SM is not empty and \(T\prime\) is not empty  Calculate the number of secret bits that can be embedded by using \(nsm=\lfloor\log_{2}(length(T\prime))\rfloor\),  Convert secret bits to a decimal index \((sm_{0}\



image with high visual quality can be obtained. If a receiver has both keys, the secret message can be extracted and the recovered image can be obtained. #### 3.5.1 Data Extraction

If a receiver has a data hiding key \(k_{d}\), the secret data can be extracted. The marked image \(I_{m}\) is converted into a pixel stream first. Depending on the size of a pixel-block \(n\) and the number of blocks \(m\) in a block-group received, it is divided into pixel-blocks and block-groups first. A n-dimensional line \(L\) is generated by using the data hiding key \(k_{d}\). The pixels in each pixel-block form a codeword and obtain a projected value by projecting the codeword to the line \(L\). A codeword table \(T\) is created for each block-group of the marked image by using these codewords and is sorted by their projected values. Both the sorted codeword table \(T\prime\) and the codeword table \(T\) created from the marked image are used to extract the secret data. The detailed steps are provided in Algorithm 2. ```
Input & The marked image \(I_{m}\), the size of pixel-block \(n\), the size of block-group \(m\), and the data hiding key \(k_{d}\). Output & A recovered secret message \(RSM\). 1: & Obtain the n-dimensional line \(L\) for pixel-blocks in a block-group to project to by using data hiding key \(k_{d}\). 2: & Initialize the recovered secret message \(RSM=\{\}\). 3: & Form pixel-blocks and block-groups based on sizes \(n\) and \(m\). 4: & FOR each block-group \(g_{c}\) in the marked image \(I_{m}\)
5: & Generate a codeword table \(T=\{cw_{0},\ cw_{1},\ \cdots,cw_{m-1}\}\) using \(g_{c}\). 6: & Initialize projected values PV = \(\{\}\). & FOR each pixel-block \(b_{c}\) in \(g_{c}\)
7: & Obtain projected value \(\lambda_{c}=b_{c}\cdot L\) & Append \(\lambda_{c}\) to PV. & END
8: & Sort codeword table T according to PV to obtain the sorted codeword table \(T\prime=\{cw^{\prime}_{0},\ cw^{\prime}_{1},\ \cdots,\ cw^{\prime}_{m-1}\}\). & FOR each codeword \(cw_{c}\) in the codeword table \(T\) & Find the index \(indx\) of \(cw_{c}\) in \(T\prime\) and remove \(cw_{c}\) from \(T\prime\).