3.1 Image encryption algorithm
In order to reflect whether the histogram of the encrypted image is more scientifically and objectively uniformly distributed, we use formula (1) to give the entropy of the encrypted image information:
$$\text{H}\left(\text{p}\right)=\sum _{\text{i}=0}^{\text{L}-1}\text{p}\left(\text{p}\text{i}\right){\text{l}\text{o}\text{g}}_{2}\frac{1}{\text{p}\left(\text{p}\text{i}\right)}$$
1
In this paper, the image variable function is introduced to measure the difference between the encrypted image and the actual image, that is, its chaotic quantity. The entropy of source information (i.e., plain text image) is H (p), and the entropy of destination information (i.e., encrypted image) is H (C), and their conditional entropy H (c/p) is generated. When obtaining ciphertext in Figure C, it can be assumed that the average amount of mutual information about plain text P will be obtained. If I (P; C) = 0, in this case, information about plain text images cannot be obtained from ciphertext images.
$$\text{H}(\text{c}/\text{p})=-\sum _{\text{j}=1}^{\text{n}}\sum _{\text{e}=1}^{\text{n}}\text{p}\left({\text{p}}_{\text{j}}{\text{c}}_{\text{e}}\right){\text{l}\text{o}\text{g}}_{2}\text{p}({\text{c}}_{\text{e}}/{\text{p}}_{\text{j}})$$
2
As an example of testing the performance of its algorithm specifically for the above indicators, we will use the logic diagram encryption algorithm in the chaotic image encryption algorithm. The Henon map is a classic two-dimensional map, and its mathematical expression is shown in (3):
$$\left\{\begin{array}{c}{\text{x}}_{\text{i}+1}=1-a{\text{x}}_{\text{i}}^{2}+{\text{y}}_{\text{i}}\\ {\text{y}}_{\text{i}+1}=a{\text{x}}_{\text{i}}\end{array}\right.$$
3
Although there is some chaos under the parameters suitable for the above mapping, the encryption effect is not appropriate due to its small chaotic interval and simple chaotic behavior. Therefore, a dynamic 2DHCLM chaotic map is designed. By introducing the cosine mapping formula and extending the chaotic interval to about 0 and embedding the dynamically adjusted parameter W, the chaotic behavior becomes more complex:
$$\left\{\begin{array}{c}{\text{x}}_{\text{i}+1}=(1-a{\text{x}}_{\text{i}}^{2}+{\text{y}}_{\text{i}})cos\left(w\pi {\text{x}}_{\text{i}}\right)\\ {\text{y}}_{\text{i}+1}=b{\text{x}}_{\text{i}}cos\left(w\pi {\text{y}}_{\text{i}}\right)\\ w=abs\left(u{\text{x}}_{\text{i}}\right(1-{\text{x}}_{\text{i}}\left)\right)\times 10\end{array}\right.$$
4
In order to check the average correlation information value of the chaotic image encryption algorithm, scan the plain text image and the corresponding ciphertext image to obtain the probability distribution of pixels, and then calculate the average correlation information I (p; c) according to the following formula (5):
$$\text{I}(\text{p};\text{c})=\text{H}\left(\text{c}\right)-\text{H}(\text{c}/\text{p})=0.003916$$
5
According to the above equation, input the randomly selected initial value x ∈ [0,1] and parameter u = 3.99, and change it to formula iteration (v + M × N) Times, discard the first v = 1000 digits, and then use the above formula to process the chaotic sequence to obtain the pseudo-random sequence X:
$$\text{X}=\text{m}\text{o}\text{d}\left(\text{x}\text{m}\right(\text{v}+1:\text{v}+\text{M}\times \text{N})\times {10}^{4},6)$$
6
A0, B0, A0, B0, B0 and B0 are used for row scrambling and column scrambling of digital image matrix respectively.
$$\left\{\begin{array}{c}X0=x(v+1:v+N\times 3)\\ Y0=y(v+1:v+M)\end{array}\right.$$
7
Interpria information is an indicator of image information analysis, because information is a high-quality image with high pixel quality and good image coding. This algorithm completely hides the original image content through two rounds of scrambling and two rounds of diffusion, thus increasing the information entropy of the ciphertext image. The calculation method of information entropy is as follows:
$$\text{H}\left(\text{a}\right)=-\sum _{\text{i}=0}^{\text{N}}\text{P}\left(\text{a}\text{i}\right){\text{l}\text{o}\text{g}}_{2}\text{P}\left(\text{a}\text{i}\right)$$
8
The specific operation is shown in Fig. 1. According to the corresponding numbers in matrix L, matrices Ir, Ig and Ib are scrambled across the plane, and the three levels are combined into matrix P (M × N × 3), as shown in Fig. 1.
3.2 Key generation
The chaotic image in the encryption process can be expressed by formula (9):
$$\text{H}={\text{B}}^{\text{i}}\left({\text{F}}^{\text{j}}\right(\text{Q},{\text{K}}_{\text{F}}),{\text{K}}_{\text{B}})$$
9
The realization accuracy of the chaotic system is limited. The period of the chaotic sequence obtained by measuring the number of chaotic maps of various chaotic parameters, that is, the period of the chaotic parameter and the period of state a (i), are equivalent to the period of the chaotic sequence generated by the chaotic system.
Here, the logistics chaotic map and the coase map of PLCM are combined to form a variable parameter multistage chaotic system. The chaotic map parameters can be randomly arranged, and the system can be used to create a modifiable sequence. Among them, chaotic map is a common chaotic map, which is expressed as (10) in chaotic system:
$${\text{a}}_{\text{m}+1}=\text{E}({\text{a}}_{\text{m}},{\eta })={\eta }{\text{a}}_{\text{m}}-{{\eta }\text{a}}_{\text{m}}^{2}$$
10
When the number of repetition is greater than T1, the chaotic parameter q can be expressed as follows:
$$\text{q}=\frac{{\text{E}}_{3{\eta }}\left(\text{a}\right(\text{t}-1),{\eta })}{3}$$
11
Use any complex chaotic sequence created by the variable parameter multistage chaotic system in the previous section to construct the invertible integer matrix. The value of the chaotic sequence an (t) i is not less than 0. By using o (an (t) i) ij to construct a matrix of order n as an element, it can be expressed as follows (12):
$$\text{O}\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)=\left[\begin{array}{cc}\text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{11}& \begin{array}{ccc}\text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{12}& \cdots & \text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{1\text{n}}\end{array}\\ \begin{array}{c}\text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{21}\\ \cdots \\ \text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{\text{m}1}\end{array}& \begin{array}{ccc}\begin{array}{c}\text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{22}\\ \cdots \\ \text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{\text{m}2}\end{array}& \begin{array}{c}\cdots \\ \cdots \\ \cdots \end{array}& \begin{array}{c}\text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{2\text{n}}\\ \cdots \\ \text{o}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{\text{m}\text{n}}\end{array}\end{array}\end{array}\right]$$
12
The expression of w (an (t) i) ij element of matrix is shown in (13):
$$\text{w}{\left({\text{a}}_{\text{n}}{\left(\text{t}\right)}_{\text{i}}\right)}_{\text{i}\text{j}}={(-1)}^{\text{i}+\text{j}}$$
13
In the process of modeling, according to the image before and after modeling, H and G images are used respectively. It is necessary to extend any pixel information of the plaintext to the whole image of the ciphertext. The forward algorithm is shown in the following formula (14):
$${\text{G}}_{\text{i}}=({\text{G}}_{\text{i}-1}+{\text{s}}_{\text{i}}+{\text{H}}_{\text{i}})\text{m}\text{o}\text{d}256$$
14
In this paper, two-dimensional generalized Arnold map is used, and the formula is as follows (15):
$$\left(\begin{array}{c}{\text{x}}^{{\prime }}\\ {\text{y}}^{{\prime }}\end{array}\right)={\left(\begin{array}{cc}1& \text{a}\\ \text{b}& \text{a}\text{b}+1\end{array}\right)}^{\text{n}}\left(\begin{array}{c}\text{x}\\ \text{y}\end{array}\right)\text{m}\text{o}\text{d}\text{N}$$
15
CNN is a neural network system constructed by interconnection of local cells. The dynamic equation of 3DCNN system is as follows:
$$\frac{{\text{d}\text{x}}_{\text{j}}}{\text{d}\text{t}}=-{\text{x}}_{\text{j}}+{\text{a}}_{\text{j}}\text{f}\left({\text{x}}_{\text{j}}\right)+\sum _{\text{k}=1}^{3}{\text{A}}_{\text{j}\text{k}}\text{f}\left({\text{x}}_{\text{k}}\right)+\sum _{\text{k}=1}^{3}{\text{S}}_{\text{j}\text{k}}{\text{x}}_{\text{k}}+{\text{I}}_{\text{j}}$$
16
The plain text image is developed as A one-dimensional vector using PM×N rows or columns and recorded as A. Step 1 is used to create 3d chaos series and establish the initial CNN chaos system length. x3(i), this function includes a top-down function, because a series of chaotic states have broad value, not suitable for data collection work, so the following preprocessing needs to be optimized:
$${\text{x}}_{1}\left(\text{i}\right)={10}^{14}{\text{x}}_{1}\left(\text{i}\right)-\text{f}\text{l}\text{o}\text{o}\text{r}\left({10}^{14}{\text{x}}_{1}\right(\text{i}\left)\right)$$
17
As shown in Table 1, the average NPCR and UGI calculated in the algorithm in this document are very close to the ideal value. Compared with other algorithms, the algorithm proposed in this paper is more sensitive to small changes in plain text, so the algorithm is more effective against differential attacks.
Table 1
Algorithm
|
Text
|
Existing algorithms
|
Algorithm in this paper
|
Average value
|
NPCR
|
0.9846
|
0.9965
|
0.9965
|
UACI
|
0.3254
|
0.3346
|
0.3365
|
Ideal value
|
NPCR
|
0.9874
|
0.9874
|
0.9874
|
UACI
|
0.3387
|
0.3387
|
0.3387
|
The correlation coefficient of adjacent pixels is calculated as shown in formula (18).
$$\text{E}\left(\text{x}\right)=\frac{1}{\text{N}}\sum _{\text{i}=1}^{\text{N}}{\text{x}}_{\text{i}}$$
18
The parameters of CNN are as follows, but the chaos generated by CNN system is shown in formula (19) (20).
$$\text{A}=\left(\begin{array}{cc}3.88& \begin{array}{cc}0& 0\end{array}\\ \begin{array}{c}0\\ 0\end{array}& \begin{array}{cc}\begin{array}{c}0\\ 0\end{array}& \begin{array}{c}0\\ 0\end{array}\end{array}\end{array}\right)$$
19
As shown in Table 2, the calculated NPCR and UQI values can be seen to be close to the ideal values. Therefore, the main sensitivity of this algorithm is strong.
Table 2
Key sensitivity test results
Index
|
NPCR
|
UACI
|
NPCR
|
UACI
|
NPCR
|
UACI
|
Encryption
|
Experimental value
|
99.68
|
33.48
|
99.84
|
33.65
|
99.85
|
33.55
|
Ideal value
|
99.85
|
33.48
|
99.84
|
33.64
|
99.86
|
33.24
|