1. Introduction
The popularity of the network and the wide application of information technology have made us more aware of the importance of safe data transmission. As an important carrier of information transmission, digital images can be classified into two ways to ensure their information security: information hiding [
1,
2,
3,
4,
5,
6] and encryption. Image encryption originated from the early classical encryption theory [
7,
8,
9,
10], but because digital images and texts have different storage methods and their inherent characteristics, such as high correlation, high redundancy and a large amount of data between adjacent pixels [
11], classic encryption methods such as DES and RSA are no longer applicable [
12,
13]. Therefore, many scholars have proposed many encryption schemes [
14,
15,
16,
17]. These technologies mainly rely on DNA computing [
18,
19,
20] cellular automata [
21,
22,
23], chaotic systems [
24,
25,
26], wavelet compression [
27,
28], and other methods.
Chaos research has made great progress in many aspects [
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43]. Due to the characteristics of chaos, such as high sensitivity to initial conditions and control parameters, and inherent randomness, chaos meets the requirements of image encryption. Generally, this kind of encryption scheme includes two important steps: scrambling and diffusion. Since Matthews et al. [
44] proposed that one-dimensional chaotic maps can be used as a time pad for encrypting messages, they proposed various image encryption algorithms based on chaotic systems. For example, Fuh GwoJeng et al. [
45] and others proposed an image encryption scheme based on a hype-chaos, aiming at the security loopholes in the scheme proposed by Gao He Chen [
46] and Rhouma and Belghith [
47]. Liu et al. [
48] showed image encryption based on one-time key and two powerful chaotic maps. Wang et al. [
49] proposed a high-dimensional chaotic image encryption system with a perceptron model. Complex chaotic systems such as high-dimensional chaotic systems or hyper-chaotic systems can generate chaotic sequences with better randomness, which increases the security of encryption schemes.
In recent years, due to its outstanding performance in parallelism, robustness, evolution, and other aspects, the bionic swarm intelligence optimization algorithm has in-depth research in human intelligence such as perception, recognition, and associative memory [
50,
51,
52]. It has also attracted the attention of many scholars in the field of image encryption. For example, Wang et al. [
53] proposed an optimization algorithm for an image encryption scheme combined with DNA coding. They selected the key sequence through PSO and used DNA mask and plaintext DNA coding of quick shuffle to operate, and formed an encryption system. Enayatifar R et al. [
54] proposed an image encryption algorithm based on a DNA chaos map and genetic algorithm (GA). By improving the quality of the DNA mask, the best mask compatible with pure images was obtained. Wang, J, et al. [
55] proposed a new framework using the population-based particle swarm optimization algorithm to improve the speed of encryption. However, because the correlation between the scrambling phase key and the plaintext image is not close, the encryption scheme can’t resist the differential attack well, the scheme can’t well resist the differential attack. In the above algorithms, a common problem is that the encryption scheme does not have enough key space, and the generated data has low pseudo-randomness and ergodicity, leading to insufficient security performance of the scheme. In addition, the traditional swarm intelligence algorithm is trapped in local optimization due to premature convergence and parameter selection.
For the purpose of overcoming the above problems, we propose a digital chaotic image encryption scheme based on an optimized artificial fish swarm algorithm and DNA coding. First, the image is scrambled by the artificial fish school algorithm, and then Chen’s hyper-chaos system is used to obtain the initial key sequence through iteration, which is diffused by DNA XOR operation, and finally, the image encryption is completed Therefore, the proposed scheme can not only change the histogram of the image, but also break the high correlation between adjacent pixels. At the same time, associating the initial parameters of Chen chaotic system with plaintext images helps to obtain the unique key stream of each image, which ensures that the encryption scheme proposed in this paper is sufficiently sensitive to plaintext, and have the advantages of effectively resisting plaintext attacks and selecting plaintext attacks. The extensive experimental results of a histogram, adjacent pixel correlation, entropy, sensitivity, key space, robustness, randomness, known and selected plaintext attacks, etc. show that the scheme meets the security requirements of the encryption algorithm, and the encryption effect is satisfactory.
The rest of the study is arranged as follows. In the
Section 2, we introduce the Chen hyper-chaos system, and evaluate its dynamic behavior through the Lyapunov exponent, artificial fish swarm algorithm, and relevant knowledge of DNA coding technology. The
Section 3 introduces the recommended encryption scheme.
Section 4 introduces the simulation results and security analysis of the image.
Section 5 discusses the defects of the algorithm. Finally, in the
Section 6, the research content is summarized.
3. Encryption and Decryption Process
We assume the size of the plain image A is
, and divide it into
blocks by
.
Figure 3 gives the flow chart of our proposed encryption scheme.
3.1. The Generation of Initial Values of the Hyper-Chaotic System
No matter what the size of the input ordinary image is, a 128-bit summary will be obtained after the MD5 hash. Even if there is only a one-bit difference, the generated summary will be completely different. Therefore, this step is to associate the key of the algorithm with the plaintext image, which can increase the security of the algorithm. Divide the 128-bit summary into 8 blocks by Equation (8).
According to the following calculation method, four initial values of Chen’s hyper-chaotic system are obtained. Among them,
are the given initial value,
is for operation.
3.2. Artificial Fish Swarm Algorithm
The artificial fish swarm algorithm has good robustness and insensitivity to initial parameters.
Figure 4 shows the flow of the artificial fish swarm algorithm.
Step 1: Initialization settings, including the number of artificial fish, initial position, artificial fish field of vision, step size, crowding factor, bulletin board, and iteration times, where the initial position is generated by Chen chaotic system iteration.
Step 2: Evaluate each individual and choose the behaviors they want to perform, including foraging Prey, gathering Swarm, tailgating Follow, and evaluation behavior bullet; Refer to
Section 2.2 for specific selection rules.
Step 3: Execute the behavior of artificial fish, update yourself, and generate a new school of fish.
Step 4: Evaluate all individuals. If an individual is superior to the bulletin board, the bulletin board will be updated to the individual.
Step 5: Determine whether the termination conditions are met. If it is satisfied, the algorithm is over; otherwise, go to step 2.
3.3. Substitution
Considering that in the digital image, the closer the pixel is, the greater the influence is, and the image block processing can better process each pixel and obtain more details. In this paper, the image is block processed. If the size of the plaintext image is , it will be divided into sub blocks. In principle, M should be an integral multiple of should be an integer multiple of . Otherwise, the missing part will be automatically filled in black, so the encryption algorithm proposed in this paper will not have the limitation of picture size.
3.3.1. Intra Block Permutation
Based on the filling position of each sub block image pixel obtained in
Section 3.2, the specific operation of block built-in transformation is described in Algorithm 4.
Algorithm 4 Pseudo code of built-in commutation in sub image block. |
Input: TB matrix A, sub block image B |
Output: displacement sub block B’ |
1. convert A and B into one-dimensional sequences |
2. for i = 1: |
3. for j = 1:m × n |
4. |
5. end |
6. end |
3.3.2. Inter Block Permutation
After the block in the conversion of each sub block, the pixels of each image block are replaced with the pixels of other image blocks. The specific operation of inter block replacement is shown in Algorithm 5.
Algorithm 5 Pseudocode for permutation between sub image blocks. |
Input: permutation image block B’, chaotic sequence w |
Output: displacement image D |
1. |
2. = 1: |
3. 1: |
4. |
5. exchange |
6. end |
7. end |
8. Reconstruct the sub block int an D |
3.4. Spread
The diffusion process can greatly enhance the ability of encryption schemes to resist statistical attacks and differential attacks. In order to obtain a better diffusion effect, we choose DNA coding technology with strong parallel computing ability, low energy consumption, and high information density for diffusion operation. The specific operations are as follows:
Step 1: Chen hyper-chaotic system iterates times to obtain sequences and then discards the first value to eliminate the transient effect of the chaotic system.
Step 2: Calculate each element of
and
according to Equations (10)–(13) to obtain four vectors
and
.
where
and
represent the ith element of
and
,
,
floor(a) is the rounding down of a. The result of mod (a, b) is the remainder of a divided by b.
Step 3: Expand the scrambled matrix
into a vector
,
. Define variables temp and i, where the initial value of temp is shown in Equation (14), and the initial value of i is 1.
Step 4: According to the DNA coding rules corresponding to , conduct DNA coding on to obtain , at the same time, according to the DNA coding rules corresponding to , DNA code to obtain , Then calculate the XOR of and to get .
Step 5: Decode to get according to the DNA coding rules corresponding to Calculation the XOR of and temp to obtain . At the same time, change the value of the variable temp to and the value of variable is .
Step 6: Repeat steps 4 and 5. When , convert the resulting vector into a matrix of , that is, encrypt the resulting image.
3.5. Decryption Process
The decryption process is the reverse of the encryption process. In the process of encryption, we first scramble the image and then spread it. Therefore, in the decryption stage, it is necessary to perform diffusion decryption first, and then scrambling decryption. It is worth noting that before decryption, we need to obtain the parameter value and initial value of the hyper-chaotic system to generate a sequence before decryption.
6. Conclusions
In this study, the foraging behavior of the artificial fish school algorithm is improved, and a chaotic image encryption scheme based on the artificial fish school and DNA coding is proposed. By hashing the original image, the correlation between the key and the plaintext is closer. Secondly, the foraging behavior of the artificial fish is improved to obtain the optimal solution of the block image, and the image is scrambled to improve the complexity and security of encryption. However, due to the need to carry out this artificial fish swarm algorithm for each word block image, its time cost is high. In the diffusion stage, the DNA method is used to obtain a better diffusion effect. The encryption method in this paper can be applied to different image types, such as gray images and color images. It also applies to images of any size. The experimental results show that the encryption scheme has the advantages of large key space, high sensitivity to key and pure image, security, and reliability. The proposed encryption scheme is easy to operate. All these satisfactory characteristics make the proposed scheme a potential candidate for multimedia data encryption (such as images, audio, and even video).