## 3 Proposed Method
### Image Encryption
For each \(2\times 2\) sized pixel block, pixel bit reconstruction is performed in the following three steps in the given processing order:

1. Determine whether it is the first \(2\times 2\) pixel block to be processed; if so, perform step a; otherwise, perform step b. 1. Eight bits of the upper-left pixel \(P\), three bits of \(Dim\) (for the case where there are unusable blocks, it is encoded as \(D(0)\)). 2. Eight bits of the upper-left pixel \(P\). Figure 8: Pixel bit reconstruction of a \(4\times 4\) block. Determine whether the current block is a usable block; if yes then perform step c; otherwise, perform step d. 3. Arrange a tagging bit '1' to represent a usable block, three bits of _MD_. Next are the prediction errors \(e_{i}\) (\(i=1,2,3\)), where \(e_{i}\) is the remainder of \(C_{i}\) after removing the shared LSBs. 4. Arrange a tagging bit '0' to represent an unusable block. Next are the original values of the remaining three pixels. 3. The remaining bits are the space available for data-hiding, represented by \(n_{c}\). Case 2: As shown in Figure 11, all four \(2\times 2\) pixel blocks are usable for processing. For each pixel block with a size of \(2\times 2\), pixel bit reconstruction is performed in the same processing order as in Case 1 through the following three steps:

1. Determine whether it is the first \(2\times 2\) pixel block to be processed; if so, perform step a; otherwise, perform step b. 1. Eight bits of the upper-left pixel \(P\), three bits of _Dim_ (for this case, it is encoded as _D(1)_), and three bits of _MD_. 2. Eight bits of the upper-left pixel \(P\) and three bits of _MD_. 2. Arrange the prediction errors \(e_{i}\) (\(i=1,2,3\)), respectively, where \(e_{i}\) is the remainder of \(C_{i}\) after removing the shared LSBs. Figure 10: Pixel bit reconstruction in the presence of unusable blocks. Figure 9: Surroundings of \(2\times 2\) size block. The remaining bits are the space available for data-hiding, represented by \(n_{c}\). ### Data Extraction and Image Recovery

The receiver can reconstruct the encrypted image and the encrypted embedded data after receiving the marked image. Each pixel within the image is firstly decomposed into eight bits binary, obtains the binary sequence of the image, represented by \(Q\), and then a retrieval operation is performed, moving the retrieval pointer backward by \(n\)\(-\)1 bits after each \(n\) bits retrieval, and stopping the operation when the end tagging is retrieved. The specific retrieval operation is as follows:

1. Retrieve eight bits to obtain \(P\) and three bits to obtain \(Dim\), according to the mapping relationship between \(Dim\) and \(dim\) in (5), which can be derived from the current retrieval of the pixel block size; if \(dim\)\(>\) 2 then perform the second step; otherwise, perform the third step. 2. Then, retrieve three bits to obtain \(MD\), which gives \(md\); then, retrieve \((dim^{2}-1)\) number of 8-\(md\) bits to obtain \(e_{i}\) (\(i=1,...,\)\(dim^{2}-1\)), and recover the pixel value \(C_{i}\) according to (6). 3. When \(dim\) = 2, four pixel blocks of 2 \(\times\) 2 size are taken as processing units and for each pixel block of 2 \(\times\) 2 size, if \(Dim\) = \(D\)(0) execute step a; otherwise, execute step b. 1. Next, one bit is retrieved. If it is '1', it means that the current 2 \(\times\) 2 pixel block is usable, and if it is '0', it is unusable. Then, retrieve three bits to obtain \(MD\), which gives \(md\); next, retrieve three 8-\(md\) bits to obtain \(e_{i}\) (\(i=1,2,3\)), and restore the pixel value \(C_{i}\) according to (7). 2. Next, retrieve three bits to obtain \(MD\), which gives \(md\), then retrieve three 8-\(md\) bits to obtain \(e_{i}\) (\(i=1,2,3\)), and restore the pixel value \(C_{i}\) according to (7).