## 3 Encryption Based on the Integration of Chaos System and Linear Prediction  
Inspired by the Second Law of Thermodynamics, this section proposes an encryption algorithm consisting of two parts: (i) the encryption function and (ii) determination of the best-encrypted image with configurational entropy, which are shown in Figures 4 and 5. Figure 4: The proposed encryption algorithm. Figure 3: An example of computing the configurational entropy. The confusion phase included under the proposed encryption function is implemented by the chaos system generated by two logistic maps with different initial parameter values. Mathematically, the logistic map [30] is written as follows  
\[x_{n+1}=rx_{n}(1-x_{n}) \tag{2}\]  
where \(x_{n}\) is located in the interval [0,1] and \(0\leq r\leq 4\). When \(r\in(3.5699456,4)\), the sequence generated by the logistic map can show chaotic status, though there are many periodic windows in this interval. We can assume that a DEM is read as a numerical matrix of size M \(\times\) N. The confusion phase scrambles the whole image, indicating that both row and column scrambling are needed. To begin this process, first, we set the initial parameter \(r_{0}\) and \(x_{0}\) values to iterate the chaotic system (i.e., Equation (2)) for M times and then a chaotic sequence of length M, \(\{\)\(x_{1}\), \(x_{2}\), \(x_{3}\), \(x_{4}\), \(x_{5}\), \(x_{m}\)\(\}\), is generated and referred to as \(S_{M}\). Then, sorting this chaotic sequence in ascending or descending order, we get \(\{\)\(\overline{x}_{1}\), \(\overline{x}_{2}\), \(\overline{x}_{3}\), \(\overline{x}_{4}\), \(\overline{x}_{5}\), \(\overline{x}_{m}\)\(\}\) named \(\overline{S}_{m}\). Next, we need to find the position values of \(S_{M}\) in \(\overline{S}_{m}\) and to record the transformation positions TP = \(\{\)\(tp_{1}\), \(tp_{2}\), \(tp_{3}\), \(tp_{4}\), \(tp_{5}\), \(tp_{m}\)\(\}\). When we use TP for row scrambling, we only need to move the \(tp_{1}\) row to the first row and the \(tp_{2}\) row to the second row until all rows are scrambled. Similarly, regarding column scrambling, new parameter \(r_{0}\) and \(y_{0}\) values are needed to iterate the logistic map for \(N\) times and then to conduct the same operation as the row scrambling. Concerning the diffusion phase, the three-point prediction is employed. A 2 \(\times\) 2 sliding window is moved pixel by pixel, which generates the predicted pixels. Regarding the edge pixels, the missing ones among pixels \(a\), \(b\), and \(c\) are automatically set to 0. Thereafter, the difference between the confused image and the predicted one is computed and then taken as the final encrypted DEM in one round. The advantages of three-point prediction are (i) reducing the correlation between pixels (increasing the complexity of an image) and (ii) changing the range of pixel values. Figure 5: The schematic process of the proposed encryption function. (**a**) Encryption of a DEM (an image) for \(m\) rounds. (**b**) Determination of the best encrypted one with configurational entropy; \(m\) (\(\geq\)1) represents the \(m\) total encryption rounds; \(n\) (\(\geq\)1) represents the number of scrambled images with respect to \(2n\) key pairs for generating logistic maps. After introducing the encryption function, we describe how the whole encryption algorithm is optimized with the assistance of configurational entropy. As shown in Figure 4(a), users can determine the total encryption rounds, \(m\), and the number of different confusion phases, \(n\), as illustrated in Figure 4(b). The encrypted image (DEM) in the last round is taken as the input of the encryption function for the next round in the whole encryption process. Figure 4(b) shows how to select the best-encrypted image. An image can be scrambled by \(2n\) logistic maps with \(2n\) different key pairs (\(r_{0}\), \(x_{0}\)) at the confusion phase; thus, \(n\) confused DEMs with the same histogram but different structures.