## 4 The SEME-TDHM Algorithm
### Encryption Process
\begin{table}
\begin{tabular}{l l c c c c c c c c} \hline \hline \multirow{2}{*}{**Schemes**} & \multirow{2}{*}{**Images**} & \multirow{2}{*}{ \begin{tabular}{c} **Plain** \\ **Image** \\ \end{tabular}  } & \multirow{2}{*}{**R**} & \multirow{2}{*}{**G**} & \multirow{2}{*}{**B**} & \multicolumn{2}{c}{**Encrypted**} & \multirow{2}{*}{**R**} & \multirow{2}{*}{**G**} & \multirow{2}{*}{**B**} \\  & & & & & & & & & & \\ \hline
**Proposed** & **Candy** & **6.8527** & **5.7920** & **6.2195** & **6.7986** & **7.9989** & **7.9971** & **7.9966** & **7.9976** \\  & **Baboon** & **7.7624** & **7.7067** & **7.4744** & **7.7522** & **7.99



Figure 13: Three-channel adjacent pixel correlation of images and cipher images: red represents the distribution charts in horizontal direction; green represents the distribution charts in diagonal direction; blue represents the distribution charts in vertical direction. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Images**} & \multirow{2}{*}{**Channels**} & \multicolumn{4}{c}{**Paintext Image**} & \multicolumn{2}{c}{**Cipher Image**} \\ \cline{3-8}  & & **Diagonal** & **Horizontal** & **Vertical** & **Diagonal** & **Horizontal** & **Vertical** \\ \hline \multirow{4}{*}{Candy} & R & 0.9511 & 0.9718 & 0.9758 & 0.0040 & \(-\)0.0007 & 0.0048 \\  & G & 0.9469 & 0.9704 & 0. ### Differential Attacks

Differential attack is a method of attacking image encryption algorithms based on small variations in pixels, by analyzing the differences between pixels in an encrypted image to break the encryption algorithm or restore the original image. Attackers use these differential characteristics to perform statistical analysis, which may lead to uncovering the encryption key or reconstructing the original image [32]. A strong encryption algorithm demonstrates extreme sensitivity to even the smallest changes in the image, meaning that altering a single pixel in the original image before encryption will result in a completely different encrypted image. In the context of this paper, the Uniform Average Change Intensity (UACI) and Number of Pixels Change Rate (NPCR) metrics are employed to test the differential attacks, with their calculations given by Equation (12) and Equation (13):

\[\left\{ \begin{array}{l}NPCR=\frac{\sum_{i}j\left(D(i,j)\right)}{M\times N} \times 100\%\\ UACI=\frac{1}{M\times N}\left[\sum_{i,j}\frac{\left|C_{1}(i,j)-C_{2}(i,j)\right| }{255}\right]\times 100\%\end{array} \right. \tag{12}\]

\[D(i,j)= \begin{cases}0,C_{1}(i,j)=C_{2}(i,j)\\ 1,C_{1}(i,j)\
eq C_{2}(i,j)\end{cases}  \tag{13}\]

Here, \(M\) and \(N\) represent the image's rows and columns, while \(C_{1}\) and \(C_{2}\) refer to the encrypted images before and after altering the pixel values in the original image, respectively. The optimal UACI and NPCR are 33.4635% and 99.6094%, respectively. In the tests, the value of individual pixels in the original image was modified to obtain the test results shown in Table 3. The performance of the SEME-TDHM algorithm was compared with other proposed algorithms. The results indicate that the UACI and NPCR values of the algorithm are very close to the ideal value and outperform those of the other algorithms. Therefore, the SEME-TDHM algorithm is highly resistant to different attacks. ### Noise and Data Loss Attacks

Images often experience interference and distortion during transmission, especially due to different types of noise [37]. In this study, experiments were carried out to examine the effects of gaussian noise and pepper and salt noise.