# A Novel Adaptive Image Data Hiding and Encryption Scheme Using Constructive Image Abstraction
## 2 Our Proposed Methods
### Image Decryption  
We need to decrypt the image before revealing the hidden messages. This involves taking the encrypted image, \(I_{E}\), as input and producing the deciphered stego image, \(I_{S}\), as output. The decryption process is detailed as follows:  
1. Regenerating the pseudo-random sequences using the 2D logistic tent modular map. We retrieve the values of \((h,q,x_{K},y_{K})\) from the secret key and follow Step 2 of the image encryption to regenerate the same pseudo-random sequences \(\mathbf{R_{1}}\) and \(\mathbf{R_{2}}\).
2. Byte-level inverse diffusion. Applying \(\mathbf{R_{2}}\) with the initial values, \(\left(P_{0,R^{\prime}},P_{0,G^{\prime}},P_{0,B^{\prime}},P_{0,E^{\prime}},C_{0, E^{\prime}}\right)\) for RGBE and \(\left(P_{0,R^{\prime}},P_{0,G^{\prime}},P_{0,B^{\prime}},C_{0,B^{\prime}}\right)\) for LDR images, we can utilize Equation (7) to decipher stego encrypted values in all channels: \[\left\{\begin{array}{l}P_{i+1,R^{\prime}}=R_{2,4i}\oplus C_{i+1,R^{\prime}} \oplus P_{i,R^{\prime}}\oplus C_{i,E^{\prime}}\\ P_{i+1,G^{\prime}}=R_{2,4i+1}\oplus C_{i+1,G^{\prime}}\oplus P_{i,G^{\prime}} \oplus C_{i+1,R^{\prime}}\\ P_{i+1,B^{\prime}}=R_{2,4i+2}\oplus C_{i+1,B^{\prime}}\oplus P_{i,B^{\prime}} \oplus C_{i+1,G^{\prime}}\\ P_{i+1,E^{\prime}}=R_{2,4i+3}\oplus C_{i+1,E^{\prime}}\oplus P_{i,E^{\prime}} \oplus C_{i+1,B^{\prime}}\\ P_{i+1,R^{\prime}}=R_{2,3i}\oplus C_{i+1,R^{\prime}}\oplus P_{i,R^{\prime}} \oplus C_{i+1,R^{\prime}}\\ P_{i+1,B^{\prime}}=R_{2,3i+2}\oplus C_{i+1,B^{\prime}}\oplus P_{i,B^{\prime}} \oplus C_{i+1,G^{\prime}}\\ \end{array}\right.,\text{ for LDR images}\] (7)  
As a continuation of our previous example, assume that we have generated a pseudo-random sequence \(\mathbf{R_{2}}=\left\{10,153,117,\ldots\right\}\), and the four initial values \(\left(P_{0,R^{\prime}},P_{0,G^{\prime}},P_{0,B^{\prime}},C_{0,E^{\prime}} \right)=(79,51,114,99)\). Suppose that the first encrypted stego pixel is \(\mathbf{C}_{1}^{\prime}=(176,88,72)\). To decrypt this pixel, we use Equation (7) and derive \(P_{1,R^{\prime}}=10\oplus 176\oplus 79\oplus 99=150\) for the red component. By applying the same approach, we can decrypt the other two components and obtain the deciphered stego pixel \(\mathbf{P}_{1}^{\prime}=(150,66,23)\).
3. Bit-level inverse permutation. This step applies the sequence \(\mathbf{R_{1}}\) generated in Step 1 and the random permutation scheme to inversely restore bits in an image. After this step, the bit order will return to the original one. Following up on the previous 8-bit image example, we can obtain the indices of permutated bits \(\left\{\mathsf{X}^{\prime}\right\}=\left\{8,1,6,7,2,4,3,5\right\}\), representing the permuted bits \(\left\{\mathsf{B}^{\prime}\right\}=\left\{0,1,1,0,0,0,1,0\right\}\). Table 2 illustrates the operation in this step. The first bit in \(\left\{\mathsf{B}^{\prime}\right\}\) is 0, and its corresponding index is 8. Thus, we place this bit in the 8 th position of the output buffer. Similarly, the second bit, 1, is placed in the 1 st position of the output buffer, etc. Finally, we produce the inversely permutated bits \(\left\{\mathsf{B}\right\}=\left\{1,0,1,0,0,1,0,0\right\}\), which has the same order before the permutation process.