###### Abstract
Apart from the Introduction section, the remainder of this study is organized as follows. The Second Law of Thermodynamics and configurational entropy are introduced first as the perspective for optimizing the DEM encryption in Section 2. Then, a novel encryption algorithm based on the leverage of configurational entropy is proposed and described in Section 3. Two DEMs are used in experiments followed by the results analysis in Section 4. Finally, a conclusion is made in Section 5. The Second Law of Thermodynamics as a New Perspective for Optimizing Encryption of Numerical Raster Data  
The Second Law of Thermodynamics is concerned with the direction of natural processes. This law states that an isolated and closed thermodynamic system can spontaneously evolve towards thermodynamic equilibrium, where its disorder degree (which can be measured by entropy) is at maximum [22; 23; 24]. Inspired by this law, we can assume  
Figure 1: Three digital elevation models (DEMs) with the same histogram and, thus, same Shannon entropy values. that a DEM could be considered an isolated and closed thermodynamic system where pixels are taken as gas molecules. Different temperatures (i.e., different encryption techniques or same techniques with different initial parameters) are imposed on the same thermodynamic system (an image), and then, the gas molecules (pixels) move in different directions and finally reach one type of status. Figure 2 shows different statuses of a closed thermodynamic system under different temperatures. The disorder of the thermodynamic system represents the complexity (randomness) of an image. The gas molecules move in different directions and then form different distributions. The disorder degree of gas molecules increases from (a) to (d). The disorder of an isolated and closed thermodynamic system can be quantified by the thermodynamic entropy proposed by [PERSON] [25,26]. The calculation formula for the thermodynamic entropy (configurational entropy and Boltzmann entropy) is as follows:  
\[S=K\log W \tag{1}\]  
where \(K\) is the Boltzmann constant (1 in the case of digital images, as suggested by [27]) and \(W\) is the number of microstates for a given macrostate. The configurational entropy of numerical raster data has been defined and computed in [28] with the assistance of the concept of multiscale representation, leading to two types of terms: relative and absolute. Concretely, the macrostate is defined as the upscaling results by an operation with a \(2\times 2\) sliding window; the microstates are all possible downscaling results, which can be seen in Figure 3. For an image, its relative configurational entropy (\(S_{R}\)) is the sum of configurational entropies of pixels in a sliding window of size \(2\times 2\) through the whole image. The absolute configurational entropy (\(S_{A}\)) is the sum of relative configurational entropies across all scales, capturing the multiscale information, which can help us enhance the analysis of the complexity of an encrypted DEM. Figure 2: Four closed and isolated thermodynamic systems with the same gas molecules but different distributions. The experiments conducted in [29] demonstrates that \(S_{R}\) can measure the scrambling degree of grayscale images at the confusion stage. Regarding the diffusion phase included by an encryption function, the range of pixel values is modified. A good encrypted image should have various value ranges and pixel structures different from the original one. At this point, we can take the absolute configurational entropy as a metric to help choose the best one among all encrypted images. Theoretically speaking, the higher the absolute configurational entropy, the higher the complexity (and the lower the compressibility concerning lossless compression). To improve the encryption security, we should select the one with the maximum \(S_{A}\) value among all cases. In this study, the base of the logarithmic function in Equation (1) is set to 2 to measure the configurational information in units of bits.