# Cryptanalysis of a New Color Image Encryption Using Combination of the 1D Chaotic Map
## 3 Chosen-Plaintext Attack
### The First Phase of Attack  
The two special properties of the Xor operator are utilized and the properties are given as below. _Property \(\alpha=0\)_  
_Property \(\alpha\beta=\lambda\), \(\alpha=\lambda\oplus\beta\)_  
2 _where \(\alpha,\beta,\gamma\) are positive integers._  
The process for find out \(lp\) and \(D\) is conducted as the following steps. Step 1: Choose a plaintext color image \(Z\) of size \(M\times N\), the elements of which are all zero-pixel values. \(Z\) can be expressed as below. \[Z=\left[ \begin{array}{cccc}(0)(0)(0)&(0)(0)(0)&\cdots&(0)(0)(0)\\ (0)(0)(0)&(0)(0)&\cdots&(0)(0)(0)\\ \cdots&\cdots&\cdots&\cdots\\ (0)(0)(0)&(0)(0)(0)&\cdots&(0)(0)(0)\\ \end{array} \right]_{\text{M\times N}} \tag{4}\]  
The encrypted image \(C_{Z}\) is obtained from the encryption method above. Divide \(Z\) into three images according to RGB theory. The sequence of \(C\)' corresponding to \(C_{Z}\) is acquired by linking the three grayscale images and the length of that is \(M\times 3N\). Denote the obtained sequence \(C\) after the diffusion. The diffusion equation corresponding to \(Z\) can be expressed according to Property 1, as below:  
\[C(i)=D(i)\oplus C(i-1) \tag{5}\]  
Obtain the pixel sequence \(C\) according to Equation (5) as below:  
\[ \begin{array}{ll}C=&\{D(1)\oplus C(0),D(2)\oplus C(1),D(3)\oplus C(2),..., \ D(M\ast 3N-1)\oplus C(M\ast 3N-2),\\ &D(M\ast 3N)\oplus C(M\ast 3N-1)\}\end{array}  \tag{6}\]  
where \(D\) remains unchanged in the encryption process. \(C\)' is obtained by rotating \(C\) by the quantity of \(lp\) to the left as the follow sequence:  
\[ \begin{array}{ll}C=\{D(lp+1)\oplus C(lp),\ D(lp+2)\oplus C(lp+1),\...,\ D(M\ast 3N-1)\oplus C(M\ast 3 N-2),\\ D(M\ast 3N)\oplus C(M\ast 3N-1),\ D1\oplus C0,\ D2\oplus C1,\ \ldots,\ D(lp)\oplus C(lp-1)\}\end{array}  \tag{7}\]  
\(C\)\" is obtained by rotating \(C\)' once to the left as the following sequence:  
\[ \begin{array}{ll}C\prime\prime=\{D(lp+2)\oplus C(lp+1),\ D(lp+3)\oplus C( lp+2),\...,\ D(M\ast 3N)\oplus C(M\ast 3N-1),\\ D1\oplus C0,\ D2\oplus C1,\ D3\oplus C2,\ldots,\ D(lp+1)\oplus C(lp)\}\end{array}  \tag{8}\]\(G\) is acquired according to Property 2 by the equation \(G(i)=C\prime(i)\oplus C\prime\prime(i)\) and given as below:  
\[ \begin{array}{l}G=\{D(l(p+2),\;D(lp+3),\;\ldots,\;D(M*3N),\;D(1)\oplus C(0) \oplus D(M*3N)\oplus C(M*3N-1),\\ D(2),\;D(3),\;\ldots,\;D(lp+1)\}\end{array}  \tag{9}\]  
\(D(i)\) is acquired where \(i\in[2,M*3N]\) but \(D(1)\) remains unknown. Step 2: Choose a plaintext color image \(Q\) with all \(k\) pixel values and the size of which is \(M\times N\). \(Q\) can be expressed as below. \[Q=\left[ \begin{array}{cccc}(k)(k)(k)&(k)(k)(k)&\cdots&(k)(k)(k)\\ (k)(k)(k)&(k)(k)(k)&\cdots&(k)(k)(k)\\ \cdots&\cdots&\cdots&\cdots\\ (k)(k)(k)(k)&(k)(k)&\cdots&(k)(k)(k)\\ \end{array} \right]_{M\times N} \tag{10}\]  
The encrypted image \(C_{Q}\) is obtained from the encryption system above. Divide \(Q\) into three images according to RGB theory. The sequence of \(C_{q}\)' corresponding to \(C_{Q}\) is acquired by linking the three gray scale images and the length of that is \(M\times 3N\). Then we denote the obtained sequence \(C_{q}\) after the diffusion. The diffusion equation corresponding to \(Q\) can be expressed as follows:  
\[C_{q}(i)=\text{mod}(k+D(i),256)\oplus C_{q}(i-1) \tag{11}\]  
Following this, we can obtain the pixel sequence of \(C_{q}\) according to Equation (5), as below:  
\[ \begin{array}{l}C_{q}=\left\{\text{mod}(k+D(1),256)\oplus C_{q}(0),\text{ mod}(k+D(2),256)\oplus C_{q}(1),...,\right.\\ \left.\text{mod}(k+D(M*3N),256)\oplus C_{q}(M*3N-1)\right\}\end{array}  \tag{12}\]  
where \(D\) remains unchanged in the encryption process.