## 4 Experiments and Results
### Evaluation Metrics
#### 4.3.3 Sensitivity to Differential Attack  
Differential cryptanalysis aims to locate the \"differences\" in the cryptograms of two closely related plain-texts in order to find similarities that could lead to the break of the cryptosystem. To prevent that, a cryptosystem should show high plain-text sensitivity. In our cryptosystem, six plain images were used to assess the plain image sensitivity; the images were slightly altered (only some LSBs were shifted) and encrypted to compare the their corresponding ciphers. In this context, two metrics must be used: _NPCR_ and _UACI_.  
Figure 12: Tonal distribution: histograms of encrypted standard images that are encrypted using the proposed approach: (**a**) aerial; (**b**) lena; (**c**) cameraman; (**d**) jet; (**e**) lake; (**f**) tank.  
_NPCR_ and _UACI_ are two metrics used to assess the similarities between two images in pixel-level comparison and in terms of average intensity change [45]. The _NPCR_ is used to calculate the number of pixels that differ between the two images, which is specified by Equation (8).  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Image**} & \multicolumn{2}{c}{**Horizontal**} & \multicolumn{2}{c}{**Vertical**} & \multicolumn{2}{c}{**Diagonal**} \\ \cline{2-7}  & **Plain** & **Encrypted** & **Plain** & **Encrypted** & **Plain** & **Encrypted** \\ \hline Aerial & \(0.6652\) & \(-0.0018\) & \(0.7425\) & \(-0.0066\) & \(0.6922\) & \(0.0084\) \\ \hline Lena & \(0.9679\) & \(-0.0062\) & \(0.9342\) & \(-0.0048\) & \(0.8961\) & \(0.0077\) \\ \hline cameraman & \(0.9565\) & \(-0.0093\) & \(0.9333\) & \(-0.0038\) & \(0.9045\) & \(0.0069\) \\ \hline Jet & \(0.9109\) & \(0.0022\) & \(0.9023\) & \(-0.0085\) & \(0.8862\) & \(0.0044\) \\ \hline Lake & \(0.9366\) & \(0.0081\) & \(0.9340\) & \(0.0028\) & \(0.9145\) & \(0.0061\) \\ \hline Tank & \(0.8761\) & \(-0.0034\) & \(0.9195\) & \(0.0080\) & \(0.8542\) & \(0.0075\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Correlation of adjacent pixels in plain and encrypted images.  
Figure 13: Correlation of neighboring pixels in plain and encrypted images: (**a**) aerial; (**b**) horizontal; (**c**) vertical; (**d**) diagonal; (**e**) encrypted aerial; (**f**) horizontal; (**g**) vertical; (**h**) diagonal; (**i**) lena; (**j**) horizontal; (**k**) vertical; (**l**) diagonal; (**m**) encrypted lena; (**n**) horizontal; (**o**) vertical; (**p**) diagonal.  
\[NPCR=\frac{\sum_{i,j}R(i,j)}{M}\times 100\% \tag{8}\]  
where \(M\) represents the total number of pixels and \(R(i,j)\) is defined by:  
\[D(i,j)=\begin{cases}0&if\quad I(i,j)=I^{\prime}(i,j)\\ 1&if\quad I(i,j)\
eq I^{\prime}(i,j)\end{cases}\]  
where \(I\) and \(I^{\prime}\) are the two images in comparison and \(i,j\) are the pixel coordinates. \(NPCR\) measured between two random images should be around 99.609375%.  
The average intensity difference between the two images \(I\) and \(I^{\prime}\) is measured using _UACI_. _UACI_ is defined by Equation (9).  
\[UACI=\frac{1}{M}\sum\frac{|I(i,j)-I^{\prime}(i,j)|}{2^{C}-1} \tag{9}\]  
where \(C\) is the number of bits used to encode the pixels. Between two random images, the expected value of _UACI_ should be around 33.46354%.  
Table 4 shows the \(NPCR\) and _UACI_ values between two cryptograms of slightly different images. One of the experiments is shown in Figure 14. The findings show that the cryptosystem is resistant to differential attacks.