# Cryptanalysis of Permutation-Diffusion-Based Lightweight Chaotic Image Encryption Scheme Using CPA
## 3 Cryptanalysis of the Original Scheme
### Summary of the Attack Strategy  
In this section, the total attack process, including revealing the diffusion key \(R\) and the permutation rule \(I_{p}\), is briefly summarized as follows.  
Step 1: According to Algorithm 1, obtain the secret key or equivalent key \(R\) via a known full zero image (Attack 1) as stated in Section 3.1.  
Step 2: Obtain permutation rule \(I_{p}\) using the following substeps.  
* Determine the number \(n\) of chosen images \(\mathbf{I}_{1},\ \mathbf{I}_{2},\ \cdots,\ \mathbf{I}_{n}\) (Attack 2) according to (9).
* According to Algorithm 2, obtain the permutation-only images \(\mathbf{P}_{1},\ \mathbf{P}_{2},\ \cdots,\ \mathbf{P}_{n}\) of chosen images with the diffusion key \(R\).
* According to Algorithm 3, obtain the permutation rule \(I_{p}\) with the permutation-only images.  
Step 3: Invoke Algorithm 3 to obtain the permutation-only image of the final ciphertext image.  
Step 4: Invoke Algorithm 4 to obtain the deciphering image of the final ciphertext image.  
In addition, the effectiveness of the proposed attack strategy is verified by a series of simulation experiments. All of the experiments were executed on a personal computer equipped with an Intel(R)  
Figure 6: Chosen-plaintext attack for obtaining the permutation rule: images from the first column to the last are plain, cipher, and permutated images, respectively; images from the first row to the last are color, selected images, respectively.  
Core(TM) i7-7500U 2.90 GHz CPU and 8 GB memory capacity. MATLAB R2016b was used for the simulations. The most typical representatives with the size of \(256\times 256\), including 'Lena', 'Peppers', 'Chemical plant', complete black, and complete white image, were tested for verification. The original test images in Figure 7(a1-e1) were firstly encrypted by the original cryptosystem, and the final encrypted resultants are shown in Figure 7(a2,b2,c2,d2,e2), respectively. Based on this, we can attack the final encrypted resultants step by step by using the obtained diffusion key \(R\) and the permutation rule \(I_{p}\). Specifically, by utilizing CPA, i.e., the Algorithm 1 mentioned above, the final the final encrypted resultants can be restored into the permutation-only images, as shown in Figure 7(a3-e3). With the help of the obtained permutation rule \(I_{p}\), i.e., the Algorithm 2 mentioned before, these permutation-only images can be further restored the original plaintext images, as shown in Figure 7(a4-c4), which are completely identical the original plaintext images by observing the XOR operation resultants between the original images and the restored ones, as shown in Figure 7(a5-d5). Therefore, the proposed attack strategy is effective.  
For the solid gray image that has the same pixel value such as complete black image shown in Figure 7(d1) and complete white image shown in Figure 7(e1), their ciphertext images shown in  
Figure 7: The effectiveness of the proposed cryptanalysis: images from column 1 to column 5 show plain images, cipher images, retrieved permutation-only images, final recovered images, and XOR results for column 1 and column 4, respectively.  
Figure 7(d2,e2) show a hierarchy of symmetry from the diagonal. Additionally, their permutation-only images shown in Figure 7(d3,e3) are the same as the final recovered images shown in Figure 7(d4,e4). Therefore, it is proved that the original encryption scheme does not applicable to this kind of solid gray images. Because scrambling does not work on images with the same pixel values, it is easy to obtain the secret key. Nevertheless, our proposed strategy is still effective for this kind of solid gray images.