## 3 Proposed Method
### Image Encryption
Next, we swap the high bits and low bits and, finally, based on the permutable key \(\mathrm{K_{p}}\), n rounds of Arnold permutation are applied to the pixel blocks of the same \(dim\) type, to generate the final encrypted image. When performing the Arnold permutation, the transformation of the positions is calculated by (4):

\[ \begin{bmatrix}x^{\prime}\\ y^{\prime}\end{bmatrix} = \begin{bmatrix}1&b\\ a&ab+1\end{bmatrix}\begin{bmatrix}x\\ y\end{bmatrix} (modN) \tag{4}\]

where \(a\) and \(b\) are two scrambling parameters, \(n\) is the image sizes, and \(mod\) denotes the modulo operation. ### Data-Hiding

After receiving the encrypted image, the data hider performs AQP according to the pre-set \(T\). Due to the reversible nature of the operations in pixel modulation and the block-level encryption, the results \(S\) obtained from the partitioning process are identical to those derived in the encryption stage. Considering that the high and low bits of pixels are swapped during encryption, firstly, adaptive LSB prediction should be performed, the minimum number of shared LSB bits, thus \(md\), should be obtained, and then the pixel bits, to vacate space for data-hiding and sending it to the receiver, should be reconstructed. Subsequently, pixel bit reconstruction is performed for different \(dim\) types, defining a set \(D=\{000,\,001,\,010,\,011,\,100,\,101,\,110,\,111\}\) based on seven pixel block sizes \(dim\ \times\ dim\):

Figure 7: Example of Pixel bit modulation. \(128\times 128\), \(64\times 64\), \(32\times 32\), \(16\times 16\), \(8\times 8\), \(4\times 4\), and \(2\times 2\). A class of partitioning sizes is mapped into three-bits binary representation by (5):

\[Dim=D(i),\;2^{i}=dim(i=0\ldots 7) \tag{5}\]

In the process of pixel bit reconstruction, for cases of \(md=0\) or \(1\) use \(MD=0=(000)_{2}\) to represent it. It is necessary to consider two distinct situations: \(dim>2\) and \(dim=2\). When dim > 2, the pixel bit reconstruction is performed in the following three steps:

1. Eight bits of the upper-left pixel \(P\), three bits of \(Dim\) (according to the value of \(dim\) obtained through (5)), and three bits of \(MD\). 2. Arrange the prediction errors \(e_{i}\) (\(i=1,...\), \(dim^{2}-1\)), respectively, where \(e_{i}\) is the remainder of \(C_{i}\) after removing the shared LSBs. 3. The remaining \([md\;\times\;(dim^{2}-1)-6]\) bits are the space available for data-hiding, represented by \(n_{c}\). As shown in Figure 8, when \(dim=4\), the reconstruction of its pixel bits is as follows: \(P=35=(00100011)_{2}\), \(Dim=D(2)=(010)_{2}\), \(md=5\), \(MD=(100)_{2}\), \(e_{1}=(001)_{2}\), \(e_{2}=(100)_{2}\), \(e_{3}=(010)_{2}\), \(e_{4}=(010)_{2}\), \(e_{5}=(010)_{2}\), \(e_{6}=(001)_{2}\), \(e_{7}=(001)_{2}\), \(e_{8}=(000)_{2}\), \(e_{9}=(000)_{2}\), \(e_{10}=(001)_{2}\), \(e_{11}=(011)_{2}\), \(e_{12}=(000)_{2}\), \(e_{13}=(000)_{2}\), \(e_{14}=(010)_{2}\), \(e_{15}=(001)_{2}\), and the remaining bits are the space available for data-hiding represented by \(n_{c}\). When \(dim=2\), there will be usable blocks and unusable blocks. Specifically, when \(md=0\) or \(1\), the current \(2\times 2\) pixel block is deemed unusable. In practice, for images possessing more complex textures, the resulting partitioning \(S\) comprises a considerable number of \(2\times 2\) size pixel blocks. It should be noted that the occurrence of \(2\times 2\) size pixel blocks is not isolated; their surrounding must also consist of \(2\times 2\) size pixel blocks, as shown in Figure 9. Therefore, the four \(2\times 2\) size pixel blocks will serve as the processing units. To take full advantage of the redundancy that exists between pixels, the operation of pixel bit reconstruction will be divided into the following two cases:

Case 1: As shown in Figure 10, there are unusable blocks within the four \(2\times 2\) pixel blocks. These blocks are processed hierarchically, processed in an order from left to right and top to bottom.