Next Article in Journal
Relationship of Time-Dependent Parameters from Destructive and Non-Destructive Tests of Structural Concrete
Next Article in Special Issue
Image Encryption Schemes Based on a Class of Uniformly Distributed Chaotic Systems
Previous Article in Journal
The Sehgal’s Fixed Point Result in the Framework of ρ-Space
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Chaos-Based Image Encryption Using Magic Square Scrambling and Octree Diffusing

School of Software, Nanchang University, Nanchang 330031, China
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(3), 457; https://doi.org/10.3390/math10030457
Submission received: 13 December 2021 / Revised: 17 January 2022 / Accepted: 28 January 2022 / Published: 30 January 2022
(This article belongs to the Special Issue Chaos-Based Secure Communication and Cryptography)

Abstract

:
Digital chaotic maps have been widely used in the fields of cryptography owing to their dynamic characteristics, however, some unfavorable security properties arise when they operate on devices with limited precision. Thus, enhancing the properties of chaotic maps are beneficial to the improvement of chaos-based encryption algorithms. In this paper, a scheme to integrate a one-dimensional Logistic map by perturbation parameters with a delayed coupling method and feedback control is proposed and further deepens the randomness by selectively shifting the position of the chaotic sequence. Then, through a number of simulation experiments, the results demonstrate that the two-dimensional chaotic map treated by this mode exhibits better chaotic characteristics, including a larger chaos range and higher complexity. In addition, a new image encryption algorithm is designed based on these modified chaotic sequences, in which magic square theorem is incorporated to exchange pixel positions, and the octree principle is invoked to achieve pixel bit shifting. Several simulation experiments present findings that the image encryption algorithm contains a high level of security, and can compete with other encryption algorithms.

1. Introduction

1.1. Background

With the development of scientific innovations and modern technologies such as the Internet, various forms of multimedia carriers have gradually emerged, among which digital images have seen wide usage in politics, economy, national defense, education, and other fields attributing to their advantages of visual visibility. Thus, methods to secretly and securely transmit and store digital images, particularly those containing private information, has become a central issue among current research fields. Image encryption presents an effective pattern for people to send or receive information securely over a network safely. Specifically, images filled with plain-text information are reconstructed as noise-like data, making it difficult for attackers to recover the original data. In the past decades, in order to meet security demands, researchers have proposed various technologies for image encryption [1,2,3,4]. Zhang, S. and Gao, T. [1] transformed images into a DNA sequence format and hyper-image format for shuffling and replacement, and designed a chaotic pseudo-random number generator to participate in the above operations, subsequently achieving secure encryption. Devi, R. S. et al. [2] utilized security force algorithm, multiple cyclic shift and chaotic displacement techniques to encrypt segmented images, which can effectively resist statistical attacks. Yong, W. et al. [3] proposed a cellular automata-based image encryption model that supports parallel computation, and the encryption algorithm based on this model is considered to be stochastic and sensitive. Xiang, H. and Liu, L. [4] generated improved chaotic sequences by suppressing the dynamic degradation of the chaotic map, and the image encryption was carried out by using a chaotic sequence, rendering the algorithm more secure. Among the existing methods, chaos-based schemes are considered to have great potential over other encryption schemes for image encryption due to their pseudo-randomness, ergodicity and extreme sensitivity to initial values, overcoming the weaknesses of large data volumes and highly correlated image data.
Thus far, many solutions to enlarge chaotic properties have been proposed and their practicability has gradually been verified [5,6,7,8,9,10,11]. Tang, J. et al. [5] introduces delay-coupled state perturbation control parameters and state variables to enhance the dynamics of chaotic systems. Liu, L. et al. [6] presented a new double-perturbed mode to ameliorate the dynamics of baker map, including perturbation of state variables and system parameters. Liu, B. et al. [7] used state variables to interfere with the control parameters of another map to couple two chaotic maps. Hoang, T. M. [8] proposed a regressive chaotic mapping model (PCM-VNI) with a different number of iterations, where perturbations are applied to the state variables and control parameters at the bit level. Researchers of [5,6,7,8] all adopt the method of perturbing the control parameters and state variables to improve the chaotic characteristics, but the state spaces of their fixed structures are not destroyed, thus there remains room for improving the dynamical characteristics. Khlebodarova, T. M. et al. [9] proposed the use of feedback control functions to improve the dynamics of chaotic and hyper-chaotic systems. Xiang, H. et al. [10] simultaneously perturbed the state variables and control parameters of the chaotic map by itself, and the feedback control function was used to improve the chaos degradation. Roberta, Hansen. et al. [11] proposed a new alternative to the ordinary feedback function control to stabilize the unstable periodic orbits of chaotic and hyper-chaotic dynamical systems via modulation of appropriate control parameters. The feedback function describes use of the state function to control the state variables of the digital chaotic map, thus destroying the original state space. However, using this method alone does not significantly improve the performance of the chaotic map, rather it works better when combined with other methods.
According to the above description, to overcome the weaknesses in the improvement process of chaotic systems, this paper proposes a coupled two-dimensional map of the double disturbance control parameters. Firstly, we use the previous variable of the current state variable and the current variable of another subsystem to interfere with the control function to extend the range of chaos parameters. Secondly, a sinusoidal function is introduced to play the role of feedback control so that the input of the current graph affects its output, which increases the complexity of the system. After modification, the chaotic systems proposed in this paper not only complement the shortcomings of one-dimensional maps but additionally enhance the dynamics of two-dimensional chaotic systems. Moreover, to further improve the unpredictability of chaotic sequences used for image encryption, a bit-level exchange operation is introduced to enhance the chaotic features. The chaotic sequences generated by a modified chaotic system are subject to a selective swap operation, which causes a change in the chaotic sequence value subsequently affecting the next sequence value in the same manner as the system input. To the best of our knowledge, fractional bit selection swap operations on chaotic sequences to enhance the unpredictability of the sequences have yet to be studied. By utilizing this improved scheme, the ability to resist violent attacks and statistical attacks is enhanced.
To verify the effectiveness of the modified chaotic system, a novel image encryption algorithm is provided. Although the advanced chaotic sequences render the chaos-based image encryption algorithms more secure, to make the image encryption algorithm unassailable, we add two mathematical concepts: magic square and octree, which correspond to two encryption programs proposed by Shannon: confusion and diffusion. In the confusion algorithm, the pixels are shuffled row by row and column by column according to the generated chaotic sequences and magic square matrix. In the diffusion algorithm, the bits in a pixel are rearranged by using chaotic sequences and octree layout, and bit XOR operation is used to vary the pixel values. Here, using magic square and octree to harden chaos-based encryption methods, even if the saboteurs decipher the sequences, render the solving of the correct plain-text a difficult process.
The rest of this paper is organized as follows. An improved chaotic sequence and its chaotic characteristics analysis are provided in Section 2. Moreover, some numerical simulations of an example are provided in this section. In Section 3, a novel image encryption algorithm based on modified sequences is proposed. Several security experimental analyses are presented in Section 4. Lastly, Section 5 forms a conclusion for the whole paper.

1.2. Related Works

1.2.1. Improved One-Dimensional Chaotic Maps Applied to Image Encryption Algorithm

L, Shouliang. et al. [12] proposed a 1D logical mapping DLCL combined with a time-delay state and coupling method, and contributed a novel color image encryption algorithm based on this DLCL map. In this scheme, the unpredictability of chaotic sequences is improved by extending the bond space of the 1D Logistic map, and a new system with a wider chaotic range, better ergodicity, and larger maximum LE is obtained. Elmanfaloty, R . A. et al. [13] introduced a 1D differential chaotic map with five variables without initial conditions, analyzed its chaotic characteristics, and applied it to an image encryption algorithm. Its unique feature is that adding four parameters to withstand brute-force attacks, although this map remains simple. Wang, X. et al. [14] introduced a new chaotic map. The text image is randomly scrambled and encrypted by 1DSLE, which is a new map engendered by embedding the Sine map into the Logistic map. This scheme preserved the advantage of a 1D map, that is, its ease of implementation on hardware, and compensated for the defect of the small key space.
Generally speaking, most of the improved methods of a 1D chaotic map focus on increasing the number of parameters, such as control parameters or initial conditions, to increase the key space. However, the dynamics of a 1D chaotic map remain limited by its low complexity.

1.2.2. Improved High-Dimensional Chaotic Maps Applied to Image Encryption Algorithm

Haq, T. et al. [15] presented a 4D mixed chaotic system, which was used in the diffusion phase of the color image encryption algorithm. Among them, this four-dimensional chaotic map was a nonlinear combination of the Sine map and Tinkerbell map, showing rich chaotic behaviors. Tong, X. J. et al. [16] designed a perturbed high-dimensional chaotic system according to the definition of topological conjugation, which mainly uses perturbation to enlarge the cycle of the chaotic map, so as to receive four chaotic sequences with high complexity. Then, this perturbed chaotic system is used in the confusion-diffusion operation in the encryption algorithm. Kaur, M. et al. [17] presented a major technique that optimizes the initial parameters of the 5-D chaotic map by using the non-dominant sorting genetic algorithm of local chaotic search. Image encryption mainly uses this optimized five-dimensional system to diffuse the image sub-bands after dual-tree complex wavelet transform (DTCWT), and finally obtains the encrypted image by inverse DTCWT.
In general, the purpose of introducing an improved high-dimensional map into image encryption technology is to render encryption more reliable by using its more complex dynamic characteristics. Nevertheless, the high computational cost of a high-dimensional chaotic system remains inconducive to the speed of image encryption.

1.2.3. Improved Two-Dimensional Chaotic Maps Applied to Image Encryption Algorithm

At present, image encryption algorithms based on improved two-dimensional maps emerge endlessly. The fundamental basis explaining this phenomenon is that 2D chaotic maps contain not only more complex chaotic characteristics than one-dimensional chaotic maps, but also their computational cost is lower than that of high-dimensional maps.
Gao, X. [18] proposed two one-dimensional maps, sin (hπ/x) and rsin (πx), which are combined to transform it into a 2D hyper-chaotic system, and the chaotic performance of this map is proved by attractor locus, 0-1 test, bifurcation graph, and permutation entropy. Then, based on this system, chaotic sequences are used to disturb the image through row and column shifts to change the pixel value, and finally the ciphertext image is obtained. Kumar, V. et al. [19] proposed a color image encryption algorithm combining Lorentz map, Logistic map, and DNA cryptography. Among them, the Logistic map is used to generate a 2D chaotic map by modifying the initial sequence with hamming distance values of three channels, so as to strengthen the plain-text correlation of encryption technology. Monda, B. et al. [20] presented a novel 2D sine–cosine chaotic map and designed an image encryption scheme with a high confusion and blur ability. Zhu, H. et al. [21] used a Logistic map to modulate a Sine map, and combined the results of modulation and Sine map to obtain a 2D coupled map (LSMCL), which applied an image encryption algorithm with two round permutation and diffusion operation. Yang, chao. et al. [22] expressed a 2D multi-fold chaotic map (2D-MCCM), and on this basis, a chaotic S-box based on 2D-MCCM was constructed. Meanwhile, S-Box is used in image encryption technology to improve security and efficiency. Toktas, A. et al. [23] introduced a 2D chaotic map of multi-objective optimization strategy based on an artificial bee colony algorithm, which is used in image encryption programs.

1.3. Preliminaries

This section presents some related preliminaries which are used in this paper.

1.3.1. Logistic Map and Its Modification

The classic Logistic map is widely used in various scientific fields, including applications of image encryption. The 1D Logistic map with formula can be written as follows:
x i + 1 = f x i , a = a × x i 1 x i
where a is the control parameter, chaos states will occur when a is selected in an appropriate value. However, chaos states exist only within a small range of parameters, which makes the original Logistic map vulnerable to attacks by unauthorized access.
Delayed coupling method: the parameter perturbation function h is realized, which uses state variables xi and yi to disturb the control parameter a.
h 1 x i = a + 4 a × x i 1 × y i h 2 y i = a + 4 a × y i 1 × x i
where h1 and h2 are the control parameter functions of x and y dimensions in the new model, respectively. h1 is acted on by the previous state variable xi−1 and the current state variable yi. Meanwhile, h2 is disturbed by state variables yi−1 and xi. Naturally, two 1D Logistic maps are coupled through above-controlling parameter functions.
Feedback function control: we construct the feedback functions g1 and g2 of the perturbation state variables xi and yi.
g 1 x i = s i n π × x i g 2 x i = s i n π × x i
The feedback function aims to self-perturb the chaotic sequence by taking part of the output of chaotic mapping as input, which can be composed of linear or nonlinear functions. In this paper, a simple, low-power sinusoidal function is adopted to destroy the state space, thereby enhancing chaos properties.

1.3.2. Meaning of Magic Squares

An n-order magic square is a square of n × n filled with n2 numbers, where the sum of the elements in each column is equal to the sum of the elements in each row. The 16-order magic square used in this article is shown below (Table 1).

1.3.3. Meaning of Octrees

The definition of an octree details that if the tree is not empty, there will be exactly eight or zero children of any node in the tree. Putting the application scenario on the image pixel matrix, and removing the pixel values at the boundary positions, results in 8 neighboring pixel points at each pixel position. Figure 1 is an example of a pixel matrix with size 6 × 8, where we can see that the pixels not in the edge position all have 8 neighboring pixel values.

2. The Proposed Chaotic Map and Its Performance

2.1. Model of Improved Logistic Maps

In this paper, we propose the 2D chaotic map with the concepts of delay, coupling, and linear feedback, which is dependent on the original Logistic. The model can be expressed as follows:
x i + 1 = a + 4 a × x i 1 × y i × x i × 1 x i + s i n π × x i   m o d   1 y i + 1 = a + 4 a × y i 1 × x i × y i × 1 y i + s i n π × y i   m o d   1
Note that values of output states variables xi+1 and yi+1 need to be in the range of (0, 1), in this case, we employ the mod operation.
After that, two ideal chaotic sequences with certain complexity emerge from this map. Nevertheless, for the image encryption algorithm utilizing chaos sequence, the more unpredictable the sequence is, the better its anti-attack ability has. As mentioned in Wu, Y. et al. [24], it is considered that the extended control parameter is a profitable method to defend sequence attacks. On this basis, a new defense method is added in this paper, that is, disposal of the generated chaotic sequences by selective swapping, which makes it more effective in the field of image encryption. The steps are as follows:
Step 1: Assume that the resulting chaotic sequence generated by Equation (4) is {X} = {x1, x2, x3, …, xM×N}, each of the three adjacent values act as a group, that is mi = {xi, xi+1, xi+2}, where i = 1, 2, 3, …, M × N − 2, and operate each group one by one.
Step 2: Each value in mi is taken to 15 decimal places and separately stored in three arrays by doing the following, that is, from k = 1 to k = 15:
S 1 k = m o d f l o o r   x i × 10 k , 10 S 2 k = m o d f l o o r x i + 1 × 10 k , 10 S 3 k = m o d f l o o r x i + 2 × 10 k , 10
where floor() is a down rounding function. mod 10 means to divide the value by 10 to obtain the remainder, {S1} is an array from xi, {S2} is an array from xi+1, {S3} is an array from xi+2.
Step 3: Each group mi is operated in Step 2, then results in three arrays ni = {{S1}, {S2}, {S3}}, respectively. Where i = 1, 2, 3, …, M × N − 2.
Step 4: For ni, traverse the arrays {S2} and {S3} one by one from j = 1 to j = length (S2). When {S2}j is equal to 0 but {S3}j is not equal to 0, let the q be equal to{S3}j, and then exchanging {S1}j with {S1}q. Where length() is a function to obtain the length of the array.
Step 5: Repeat the above operation until {X} is completely covered, and the y-dimension is the same, no more tautology here.
Through the simple operations above, the chaotic sequences generated by Equation (4) will be renovated. In this way, even if the saboteur cracked the original sequences, any algorithms using the chaotic series as a pseudo-random numbers generator will remain secure. In fact, this method is valid for any chaotic sequence. Moreover, the mathematics model constructed above is universal for all digital maps and can be extended to coupled multiple chaotic systems. The n-dimensional chaotic map can be shown as:
x i + 1 ( 1 ) = f 1 ( x i , h 1 ( x i ( 2 ) , x i ( 3 ) , , x i ( N ) , x i 1 ( 1 ) ) , g 1 ( x i ) ) x i + 1 ( 2 ) = f 2 ( x i , h 2 ( x i ( 1 ) , x i ( 3 ) , , x i ( N ) , x i 1 ( 2 ) ) , g 2 ( x i ) ) x i + 1 ( N ) = f N ( x i , h N ( x i ( 1 ) , x i ( 2 ) , , x i ( N 1 ) , x i 1 ( N ) ) , g N ( x i ) )
In this model, f represents any arbitrary chaotic map, h denotes the parameter control function equivalent to the output of a in Equation (1), and g is the feedback function with xi as the input. Given that functions h and g are diverse, thus some inevitable conditions must be satisfied for the system to possess chaotic properties: the numerical range of hi should belong to the chaos control parameter domain, the input (xi, xi−1) and the output xi+1 need to be limited to the state space (0, 1).

2.2. Performance Analysis of the Improved Map

Next, we set a = 3.99, x1 = 0.65477880678 for Equations (1) and (4), and set x2 = 0.56784938, y1 = 0.3456789, y2 = 0.2346784 for Equation (4). All of them are used for the following simulation experiments in this article unless otherwise stated.

2.2.1. Trajectories and Phase Diagrams

This section describes the dynamic representation of the improved sequences, in terms of phase spaces and trajectories to demonstrate the effectiveness of our method. As is commonly known, a satisfactory chaotic system is considered to possess the aperiodic trajectory and the phase diagram without distinct structural features.
Here, the x-and y-dimensional trajectories generated by the novel scheme are depicted in Figure 2a,b, respectively. From Figure 2, after about 500 cycles of iterations, both trajectories remain random and neither of them has periodic cycles, which can represent good randomness. Figure 3a,b plot the x-and y-dimensional phase spaces of new chaotic sequences, respectively, Figure 3c portrays the phase diagram of Equation (1). As shown in Figure 3, the improved chaotic phase space breaks the inverted U-shaped structure of the classical Logistic map, and its distribution is full of the whole phase space. This result confirms that the proposed chaos system exhibits ideal dynamics characteristics.

2.2.2. Complexity Analysis

ApEn and PE Approximate entropy (ApEn) is one of the nonlinear kinetic parameters used to measure the complexity of time series, as mentioned in Pincus, S. M. [25]. For time series, the larger the ApEn value, the higher the orbital complexity generated by chaos. Meanwhile, permutation entropy (PE) is another valid factor, which acts similarly to ApEn, and calculates entropy by displacement. Compared with ApEn, PE is available for any form of sequences depending on its simple calculation and strong anti-noise robustness. In this experiment, ApEn and PE values of the modified and original chaotic scheme with different parameter settings are shown in Figure 4 and Figure 5, respectively.
From Figure 4, we can observe that the modified ApEn value hovers around 1.75, whereas that of the Logistic map is approximately 0.5. Larger ApEn values directly indicate that the improved sequences will barely display an observable regularity. As seen in Figure 5, the modified PE values are infinitely close to ideal value 1, far greater than that of Equation (1), which emphatically proves the superiority of our method in enhancing the complexity of the chaotic sequence.
Lyapunov exponent analysis As a widely recognized measuring method, the Lyapunov index is taken to describe the presence of chaotic behavior in a map. When LE > 0, the chaos trajectories under two different input conditions will diverge exponentially through iteration, thus showing that chaos is sensitive to initial values. That is to say, chaos must have a positive Lyapunov exponent and the larger an LE value is, the more prominent the chaotic features are. Figure 6 reveals the comparison of the Lyapunov exponents of the original sequence and modified sequence. In this test, we set a ∈ [2, 4], it can be observed that the sequence generated by our scheme possesses a positive LE value within the entire parameter range. Moreover, the LE value is larger than that of the original map.

2.2.3. Auto-Correlation Analysis

The auto-correlation function is accessed to characterize the degree of correlation between the states of a random process itself at any two different moments. For an ideal chaotic sequence, the auto-correlation should be fast attenuation along with the state interval, similar to the δ-function. The auto-correlation analysis of improved sequences is shown in Figure 7, where it can be observed that the self-relevance is the highest when the interval is 0, and in other cases, it rapidly drops to 0. The shape of its curve is the same as that of the δ-function, which proves there is almost no relation between any two variables in the output sequence, and can be considered as good statistical independence.

2.2.4. Sensitivity Analysis

This part aims to estimate whether the chaotic map has the property of being extremely sensitive to initial conditions. In this section, the control parameter a is varied by 2−14 to receive the trajectories of two chaotic sequences, as shown in Figure 8a. Similarly, by changing the initial values x1, x2, y1, and y2 by 2−14, the multiple trails will be engendered, see Figure 8b–e, respectively. We can observe that with a slight input deviation, the results are significantly different, marking that the modified chaotic series has unpredictable long-run evolutionary behavior and satisfactory sensitivity.

2.2.5. Bifurcation Analysis

The bifurcation diagram visually shows the change of system from a non-chaotic region to a chaotic state at a certain parameter value. According to Figure 9a, only within the range of [3.5699, 4] does the Logistic map exhibit chaotic behavior, and its periodic window appears at 3.78. However, it can be seen from Figure 9b that the modified system not only has a wider chaotic parameter domain (parameter range is [2.5, 4]) but also does not exist non-chaotic field, which implies our scheme is stable in expressing chaotic behavior.

3. A Novel Image Encryption Algorithm Based on Improved Map

In order to verify the practicability of improved sequences, a novel image encryption algorithm is proposed in this paper. Chaotic sequences are mainly applied in two aspects: (1) Combing with the magic square to realize shuffling; (2) Using with the octree for substitution.

3.1. Shuffling Algorithm

Assume that the size of image A is M × N, {xi} is a chaotic sequence with length M × N generated by Section 2.1, and {B} is the generated magic square of order √M, all of which are used to shuffle the pixels of the image. The shuffling algorithm can be described as follows.
Step 1: Converting the sequence {xi} into integer sequences by using the following equations.
I x i = 1 + f l o o r x i × 10 5 m o d   N
where floor(xi) denotes the largest integer which is less than xi.
Step 2: Transforming {I x i } after Step 1 into a sequence matrix of the same size as {A}, that is, { I x i } with length 1 × (M × N) is reshaped to {X}with length M × N.
I x i = x 1 , x 2 , x 3 , x 4 , , x M × N X i j = X 11 X 12 X 13 X 1 N X 21 X 22 X 23 X 2 N X 31 X 32 X 33 X 3 N X M 1 X M 2 X M 3 X M N X 11 = x 1 , X 12 = x 2 , X 13 = x 1 , , X M N = x M × N
Step 3: Reconstructing the magic square matrix {B} into an array {b} of 1 row and √M columns.
B i j = B 11 B 12 B 13 B 1 M B 21 B 22 B 23 B 2 M B 31 B 32 B 33 B 3 M B M 1 B M 2 B M 3 B M M b = b 1 , b 2 , b 3 , , b M   b 1 = B 11 , b 2 = B 12 , b 3 = B 13 , , b M = B M M
Step 4: Row shuffling: Transforming the positions of pixels in the ith row according to {b} and {X}ij by using the following equations.
t e m p = a i j
a i j = a i j
a i j = t e m p
j = X i k
j = b k
where i = 1, 2, …, M, k = 1, 2, 3, …, N, a is the original pixels. temp is used to temporarily store the pixels to be exchanged.
Step 5: Column shuffling: Similarly, transforming the positions of pixels in the jth column according to {b}j and {X}ij by using the following equations.
t e m p = a i j
a i j = a i j
a i j = t e m p
i = X k j
i = b k
where j = 1, 2, …, M, k = 1, 2, 3, …, N, a is the original pixels. temp is used to temporarily store the pixels to be exchanged.
The flowchart of the shuffling process can be briefly depicted in Figure 10. Factually, the order of row shuffling and column shuffling processes can be exchanged or staggered.

3.2. Substitution Algorithm

The substitution algorithm can be divided into two levels, one is bit transformation in a pixel value, and the other is bit XOR operation. The bit change operation is inspired by the octree, which means that all the internal pixels have 8 adjacent pixels, excluding the peripheral pixels of the image matrix. In this part, we use {yi} generated by Section 2.1 and pixel position represented by the octree to carry out the bit pixels substitution, reusing {xi} and {yi} in the XOR operation. The detailed steps of the substitution algorithm are summarized as follows.
Step 1: Similar to Step 2 in Section 3.1, transforming {yi} with length 1 × (M × N) into a matrix {Y}of size M × N.
Step 2: Taking the value of {Y}ij to 8 decimal places, that is {Y}ij,k, where k = 1, 2, …, 8, i = 2, 3, …, M − 1 and j = 2, 3, …, N − 1.
Step 3: Identifying the position of 8 pixels adjacent to the pixel aij, where aij comes from image A′. Note that since the definition of octree does not include peripheral pixels, so i, j ≠ 1, iM and jN. The details are as follows (Table 2).
Step 4: Converting the pixel aij into 8 bits representation aij,l, where l = 1, 2, …, 8 and aij,l = 0 or 1. The bit transformation process in pixel aij can be described as follows.
a i j , l = a i j , l
a i j , l = a i j , l
l = Y i j , k
l = 1 + a Y i j , k m o d   8
Here, k = 1, 2, …, 8, i = 2, 3, …, M − 1 and j = 2, 3, …, N − 1. aij denotes the pixel value of i row and j column after bit transformation. mod 8 means to convert a value to a number between [0, 7].
Step 5: Normalizing the chaotic matrix {Y} processed by Step 1 to (0.255), thus becoming matrix {Y1}.
Y 1 = 255 × Y
Step 6: The encrypted image A1 can be obtained by performing the bit XOR operation with {Y1}, where A2 comes from the image A′ that has undergone above diffusion operation.
A 1 = A 2 Y 1
Step 7: Transforming the chaotic sequence {xi} generated by Equation (4) to matrix {X1} of size M × N, and normalizing to (0.255) to {X2}.
X 2 = 255 × X 1
Step 8: The final encrypted image A″ can be obtained by performing the bit XOR operation with {X2}:
A = A 1 X 2
The flowchart of the substitution process can be depicted in Figure 11.

3.3. The Image Encryption Algorithm Based on Improved Chaotic Sequences

Combining the shuffling and substitution algorithms, the integrated encryption schemes can be summarized as follows.
Step 1: Read the plain text image A. Assume its size to be M × N.
Step 2: Calculate the fractional portion p of the pixel average.
p = i = 1 M j = N N a i j M × N f l o o r   i = 1 M j = N N a i j M × N
Step 3: Select randomly parameter a and initial values x1, x2, y1 and y2 in the chaotic region.
Step 4: Generate two chaotic sequences {xi}, {yi}, according to Section 2.1 by using the main control parameter a, and four initial conditions x1, x2, y1 and y2.
x 1 = x 1 × p × m o d   1 x 2 = x 2 × p × m o d   1 y 1 = y 1 × p × m o d   1 y 2 = y 2 × p × m o d   1
Step 5: Shuffle the image A according to the shuffling algorithm by using sequence {xi} to obtain A′. Here, shuffle the rows first, and then do the same for the columns.
Step 6: Substitute the shuffled image A′ according to the substitution algorithm by using sequences {xi} and {yi}.
Step 7: Save as the encrypted image A″.
The flowchart of the proposed image encryption algorithm can be depicted in Figure 12.

3.4. The Image Decryption Algorithm Based on Improved Chaotic Sequences

The decryption process, as opposed to the encryption process, is described in detail here.
  • Step 1: Read the encrypted image A″.
  • Step 2: Obtain the key sent by the encryption party, namely, parameter a, initial values x1, x2, y1 and y2 and plain-text average pixel value p.
  • Step 3: Generate two chaotic sequences {xi}, {yi}, according to Section 2.1 by using the main control parameter a, and four initial conditions x1, x2, y1 and y2.
    x 1 = x 1 × p × m o d   1 x 2 = x 2 × p × m o d   1 y 1 = y 1 × p × m o d   1 y 2 = y 2 × p × m o d   1
  • Step 4: A″ performs XOR with {X2} obtained in Step 7 of Section 3.2, and then XOR with {Y1} obtained in Step 5, then an encrypted image A2 with magic square scrambling and octree diffusion is obtained.
    A 1 = A 𠌣 X 2
    A 2 = A 1 Y 1
  • Step 5: Input the image A2 after step 4 as the undiffused image in the octree replacement operation in Section 3.2, substitute the shuffled image A2 according to the octree substitution algorithm by using sequences {xi} and {yi}. Finally, the obtained encrypted image A′ is the scrambled image A′ after reverse diffusion.
  • Step 6: Shuffle the image A′ according to the shuffling algorithm by using sequence {xi} to obtain A which is inversely scrambled. Here, encryption is scrambled in the order of rows first and then columns. Therefore, when decrypting, the reverse scrambling shall be carried out in the order of columns first and then rows.
  • Step 7: Save as the decrypted image A.

4. Experimental Tests and Security Analysis

In this section, the grayscale Baboon image, Horse image, Flower image and Cameraman image with size 256 × 256 are used as the plain-text images, and the conditions in these experimental tests are selected as a = 3.99, x1 = 0.65477880678, x2 = 0.56784938, y1 = 0.3456789 and y2 = 0.2346784.

4.1. Encryption and Decryption Experiments

This encryption and decryption were performed with four images as an example, and the results are shown in Figure 13. Figure 13e–h shows that the information of encrypted images is completely hidden, causing the images to be unrecognized. For these four different images, the features of the encrypted images are almost indistinguishable, a phenomenon that is further demonstrated by the ensuing security analysis. Therefore, this image encryption algorithm is effective and can be extended to all different classes of images. Figure 13i–l imply that the plain-text images can be decrypted accurately with the correct keys, which indicates that our decryption scheme also performs correctly.

4.2. Histogram Test

Histogram describes the distribution of the image pixels from the perspective of the internal gray level. In an ideal encrypted image, the histogram should be smooth and the pixel values evenly distributed, which can prevent the image information from being leaked. The histograms of the original images are plotted in Figure 14a–d, both showing a distinct inhomogeneous structure. While after encryption, the histogram of the encrypted image is well-distributed and relatively smooth, as shown in Figure 14e–h.
Next, we used the variance to test the homogeneity of the histogram of the encrypted images. Ideally, the histogram variance of the encrypted image is much smaller than that of the original image, and the smaller the value is, the higher the uniformity of the gray value is, which means that the proposed scheme is better. The formula for variance is expressed as:
V a r i a n c e H = 1 n 2 i = 1 n j = 1 n h i h j 2 2
where H = {h1, h2, h3, …, hn} is the array of the histogram values, and hi and hj are the numbers of pixels whose grey values are equal to i and j, respectively. Table 3 shows the histogram variance results for the five test images that have gone through our scheme and gives the results in comparison with some other schemes. From Table 3, we can observe that histogram variances of the “Cameraman” image, and the ”Baboon” image encrypted by our scheme are close to the schemes of Patro, K. A. K. et al. [26], Patro, K. A. K. et al. [27], Tsafack, N. et al. [28], Patro, K .A. K and Acharya, B. [29], Patro, K. A. K and Acharya, B. [30]. From the above test results, we can prove that our method is available in resisting statistical attacks.

4.3. Chi-Square Test Analysis

The Chi-square test can further verify the homogeneity of the image grayscale values. In general, the smaller the obtained Chi-square value is, the higher the gray uniformity is. The equation of the Chi-square test can be expressed as follows:
χ t e s t 2 = i = 0 256 f i n p i 2 n p i
where fi and npi are the expected and observed frequencies, respectively. The expression for npi is,
n p i = M × N 256
where M × N is the image size. The values of the Chi-square test results for the histograms of the images processed by our encryption scheme are shown in Table 4. From Table 4, it can be concluded that the hypothesis is tested, both at 5% and 1% level of significance. In addition, the Chi-square value of the “Baboon” image differs very little from those of the Patro, K. and Acharva, B. [31] and Yang, F. et al. [32], which indicates that our scheme is quite competitive in terms of uniform grayscale values.

4.4. Correlation Analysis

For a satisfactory encryption scheme, there should be no correlation between the adjacent pixels of the encryption result. However, correlation generally exists in the unprocessed image, thus eliminating the correlated relation of neighboring pixels is one of the basic requirements of image encryption. The adjacent pixels of four plain-text images and encrypted images in horizontal, vertical, and diagonal directions are displayed in Figure 15, Figure 16, Figure 17 and Figure 18, which are the Baboon image, the Horse image, the Flower image, and the Cameraman image, respectively. It can be seen that (a–c) of Figure 15, Figure 16, Figure 17 and Figure 18 all indicate that pixel pairs with strong correlation exist in the plain-text image and are concentrated in the vicinity of the diagonal. While (d–f) of Figure 15, Figure 16, Figure 17 and Figure 18 show that the distribution states of adjacent pixels in the encrypted image are random in space. The above results demonstrate that the encryption scheme has achieved the effect of disturbing the relevance of neighboring pixels. Furthermore, in order to further quantify the correlation test result, the correlation coefficient Cor can be calculated by this formula:
C o r = Q i = 1 Q x i × y i i = 1 Q x i × i = 1 Q y i Q i = 1 Q x i 2 i = 1 Q x i 2 × Q i = 1 Q y i 2 i = 1 Q y i 2
where xi and yi are two pixel sequences with length Q. The value of Cor will be in the interval [0, 1]. A value of Cor close to 0 indicates that the pixel pairs in the image are not correlated. Conversely, a value of Cor close to 1 indicates that there is a strong correlation between adjacent pixels. Table 5 compares the Cor of various schemes, and it can be seen that the Cor of the encrypted image processed by our encryption scheme is closer to 0 in all directions, which interprets this encryption algorithm as competitive in this sense.

4.5. Key Space Analysis

Preventing attackers from using brute force attacks to decipher requires the certain space of the key, which is at least greater than 2128. In this encryption scheme, 5 tunable parameters, including the parameters a, and initial keys x1, x2, y1, y2, are selected as the secret keys. Thus, we can approximately estimate the key space as 10r × 10r × 10r × 10r × 10r = (10r)5, and set the largest accuracy r = 14 to compare the results with other encryption algorithms. Then, the key space is approximately equal to (1014)5 ≈ 2233, which is much larger than 2128, as shown in Table 6. According to the key spaces in other articles in Table 6, it can be proved that our algorithm has a larger key space. Such a result means that our scheme has a high ability to resist brute-force attacks. In addition, the nonlinear chaotic system is used to generate the input sequence of the encryption system in this algorithm. Due to the inherent nonlinearity, unpredictability and pseudo-randomness of the chaotic system, it is sufficient to resist linear attacks.

4.6. Key Sensitivity Analysis

The key sensitivity is reflected in the fact that a small change in the key, whether in encryption or decryption, will result in a considerable deviation from the correct result. Figure 19 shows the decrypted images of the above four encrypted images with only 10−10 differences in the secret keys a, x1, x2, y1, and y2, respectively. The results exhibit that all decrypted images are noisy and unrecognizable, indicating that the decryption process of the scheme is sensitive to the keys. Such appearances can also be described by the numerical experiment of calculating the mean square error (MSE):
M S E = 1 Q i = 1 Q u i z i 2
where Q is the size of the image, ui and zi are the two images for comparison. The MSE diagrams of control parameter and initial values during encryption and decryption are shown in Figure 20 and Figure 21, respectively. As can be seen from Figure 20 and Figure 21, if the key is slightly different, the image after encryption or decryption will have a wide variation. Both results will conclude that in either case, our algorithm has excellent key sensitivity.

4.7. Information Entropy Analysis

Information entropy is instrumental in pointing out the quantity of information carried by the encrypted image, and explaining whether the image is random-like. Its formula P(X) can be described as follows:
P X = i = 1 Q h x i l o g 2 h x i
where Q is the cardinal number of symbols of information source X, h(xi) denotes the probability of symbol xi in the information source X. If P(X) of the encrypted image is infinitely close to 8, it means that it carries less privacy information, which can be considered as a random and ideal image. Table 7 enumerates the values of P(X) under diverse algorithms, including our proposed and existing schemes. From Table 7, we observe that the information entropy of all four encrypted images manufactured by our proposed encryption algorithm is close to the ideal value 8, proving that our encryption algorithm has strong competitiveness in this sense.

4.8. Local Shannon Entropy Analysis

The local Shannon entropy reflects the distribution of randomness within each local region of the image, and its central technology is to divide the image into non-overlapping image blocks and find the mean value of their information entropy. The local entropy calculation in this test is according to the steps in Wu, Y. et al. [41], and the results are listed in Table 8. From Table 8, it can be seen that the entropy values are close to those calculated in Kaur, G. et al. [40] and El-Latif, A. A. A. et al. [42], which indicates that the present scheme is acceptable in local entropy testing.

4.9. Resistance to Differential Attack Analysis

Differential attack is a general way to attack the algorithms with the correlation between encrypted images. By constantly changing the plain-text images, the attacker has a high probability of cracking the scheme. Thus, as a secure encryption algorithm, it should have the ability to be highly sensitive to plain-text. The sensitivity can be visually shown by calculating the number of pixels change rate (NPCR) and unified average changing intensity (UACI):
N P C R = i , j Q i , j M × N × 100 %
U A C I = 1 M × N i , j D i , j D i , j 255 × 100 %
where D and D′ are two images with size M × N, and the ideal values of NPCR and UACI are 0.9961 and 0.3346, respectively.
In this test, we randomly change the pixels by only 1 bit and then analyze the two encrypted images by using NPCR and UACI, whose results are shown in Table 9. According to Table 9, both values of these four images are close to the ideal values, which indicates that the encryption technique is highly sensitive to plain-text images. Meanwhile, it can be seen that the UACI and NPCR values of Baboon image obtained by the method proposed in this paper are approximately similar to the values of [23,27,39,43,44]. These results manifest that the encryption algorithm is comparable to other algorithms in terms of sensitivity to plain-text images.

4.10. Computational Complexity and Speed Analysis

4.10.1. Computational Complexity Analysis

The algorithm performs three main operations on grayscale images. These operations are (i) chaotic sequence generation operation, (ii) phantom square dislocation operation, and (iii) octree diffusion operation. The computational complexity of performing these operations is as follows.
(i)
In the chaotic sequence generation operation, as shown in Section 2.1, the two Logistic chaotic maps are reshaped into a new two-dimensional chaotic system by coupling, delay, and feedback control operations, while the chaotic sequences are processed by selective swapping. Therefore, the computational complexity of the proposed method for generating a new chaotic sequence is O(M × N × B), where M × N is the size of the image, and B is the number of decimal places of the retained sequence values.
(ii)
In the magic square permutation operation, a 16-order magic square is generated and the values of this matrix are used to permute each row step by step. Subsequently, the permutation operation is performed for each column, so the computational complexity is O(M × N) + O(M × N) = 2 × O(M × N), M is the number of pixels swapped in each row and N is the number of pixels swapped in each column.
(iii)
In the octree diffusion operation, the pixel points at the boundary are removed and the other pixel values are swapped on bit bits according to the diffusion rules in Section 3.2. The computational complexity is O(8 × (M − 2) × (N − 2)), where M − 2 is the number of pixels swapped per row and N − 2 is the number of pixels swapped per column.
In conclusion, the overall computational complexity of the proposed method in this paper is O(M × N), and is similar to that of other image encryption algorithms [31,45].

4.10.2. Speed Analysis

Speed is also an important measure to evaluate the practicability of an encryption algorithm. In this test, the encryption and decryption algorithms are processed by MATLAB 2019 on a computer with 2.80 GHz CPU and 8 GB memory. The encryption speed of different algorithms is shown in Table 10. These results show that our algorithm is more efficient and acceptable for practical applications.

4.11. Robustness Analysis

The encryption algorithm with better robustness will maintain the ability to recover the image if the cipher image is ruined by noise or data loss. In this test, using Salt and Pepper noise and slicing attack with different intensities to interfere with encrypted images, and then acquire decrypted images, see Figure 22. From Figure 22, we can know that regardless of what damage the encrypted images suffer, such as data loss of 5% and 10% or noise attack of 1% and 3%, the decrypted images can basically restore the “Baboon” image. These prove that the image encryption algorithm proposed in this paper possesses the property of robustness to defend against noise attack and data loss.

5. Conclusions

To enhance the security of chaos-based image encryption algorithms, this paper proposes a method realized on parameter disturbance and nonlinear feedback to improve the original Logistic map. The delay and the coupling states are combined to perturb the parameters, while the nonlinear feedback adopts the sine function. Then, using selective switching to manage the chaotic sequences generated by the improved map, which renders the chaotic sequence not only subject to the chaotic system but also controlled by the selective exchange operation. In this paper, we take 1D Logistic as an example to carry out simulation experiments, and the results show that the chaotic sequence generated by this method shows significant improvement in terms of dynamic characteristics. Furthermore, a novel image encryption algorithm is realized, which combines chaotic sequence with magic square and octree to achieve secure encryption results. Following this, several experiments, including histogram analysis, correlation analysis, key sensitivity analysis, key space analysis, robustness analysis, resistance to differential attack, and information entropy analysis, are employed to prove that the encryption algorithm has a high-level of security, and is quite competitive to other chaos-based encryption algorithms.
The key contribution of this paper is to provide a coupling two-dimensional map of the double disturbance control parameters with improved dynamics, which uses a new selective exchange approach to enhance the complexity of the sequences. Meanwhile, a novel encryption scheme with high security is proposed. Curiously, this paper extends the concept of octree to the pixel-bit level of an image, presenting a new idea for diffusion operations. Considering the practicality of chaotic systems, the proposed chaotic system is only computer-simulated in this paper, and can be easily realized with real circuits since the chaotic model consisted of some simple operations. In our future work, the chaotic system will be realized with real circuits. Furthermore, we will further improve the security level of the chaos-based image encryption algorithms.

Author Contributions

Conceptualization, L.L.; methodology, J.W.; software, J.W.; formal analysis, J.W.; data curation, J.W.; writing—original draft preparation, J.W.; writing—review and editing, J.W. and L.L.; funding acquisition, L.L and J.W. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported by the National Natural Science Foundation of China (61862042); Innovation Special Fund Designated for Graduate Students of Jiangxi Province (YC2021-S166).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare that they have no conflict of interest.

References

  1. Zhang, S.; Gao, T. An image encryption scheme based on DNA coding and permutation of hyper-image. Multimed. Tools Appl. 2016, 75, 17157–17170. [Google Scholar] [CrossRef]
  2. Devi, R.S.; Thenmozhi, K.; Amirtharajan, R.; Padmapriya, P. A Novel Multiple Segmented Image Encryption. In Proceedings of the 2019 International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, India, 23–25 January 2019; 1, pp. 1–5. [Google Scholar]
  3. Wang, Y.; Zhao, Y.; Zhou, Q.; Lin, Z. Image encryption using partitioned cellular automata. Neurocomputing 2018, 275, 1318–1332. [Google Scholar] [CrossRef]
  4. Xiang, H.; Liu, L. A novel image encryption algorithm based on improved key selection and digital chaotic map. Multimed. Tools Appl. 2021, 80, 1–28. [Google Scholar] [CrossRef]
  5. Tang, J.; Yu, Z.; Liu, L. A delay coupling method to reduce the dynamical degradation of digital chaotic maps and its application for image encryption. Multimed. Tools Appl. 2019, 78, 24765–24788. [Google Scholar] [CrossRef]
  6. Liu, L.; Lin, J.; Miao, S.; Liu, B. A Double Perturbation Method for Reducing Dynamical Degradation of the Digital Baker Map. Int. J. Bifurc. Chaos 2017, 27, 1750103. [Google Scholar] [CrossRef]
  7. Liu, B.; Xiang, H.; Liu, L. Reducing the Dynamical Degradation of Digital Chaotic Maps with Time-Delay Linear Feedback and Parameter Perturbation. Math. Probl. Eng. 2020, 2020, 1–12. [Google Scholar] [CrossRef] [Green Version]
  8. Hoang, T.M. Perturbed Chaotic Map with Varying Number of Iterations and Application in Image Encryption. In Proceedings of the 2020 IEEE Eighth International Conference on Communications and Electronics, Phu Quoc Island, Vietnam, 13–15 January 2021; pp. 413–418. [Google Scholar] [CrossRef]
  9. Khlebodarova, T.M.; Kogai, V.V.; Fadeev, S.I.; Likhoshvai, V.A. Chaos and hyperchaos in simple gene network with negative feedback and time delays. J. Bioinform. Comput. Biol. 2017, 15, 1650042. [Google Scholar] [CrossRef] [PubMed]
  10. Xiang, H.; Liu, L. A new perturbation-feedback hybrid control method for reducing the dynamic degradation of digital chaotic systems and its application in image encryption. Multimed. Tools Appl. 2021, 80, 19237–19261. [Google Scholar] [CrossRef]
  11. Hansen, R.; González, G.A. Feedback control modulation for controlling chaotic maps. Nonlinear Anal. Model. Control 2021, 26, 419–439. [Google Scholar] [CrossRef]
  12. Li, S.; Ding, W.; Yin, B.; Zhang, T.; Ma, Y. A Novel Delay Linear Coupling Logistics Map Model for Color Image Encryption. Entropy 2018, 20, 463. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  13. Elmanfaloty, R.A.; Abou-Bakr, E. An Image Encryption Scheme Using a 1D Chaotic Double Section Skew Tent Map. Complexity 2020, 2020, 7647421. [Google Scholar] [CrossRef]
  14. Wang, X.; Guan, N.; Yang, J. Image encryption algorithm with random scrambling based on one-dimensional logistic self-embedding chaotic map. Chaos Solitons Fractals 2021, 150, 111117. [Google Scholar] [CrossRef]
  15. Haq, T.; Shah, T. 4D mixed chaotic system and its application to RGB image encryption using substitution-diffusion. J. Inf. Secur. Appl. 2021, 61, 102931. [Google Scholar] [CrossRef]
  16. Tong, X.J.; Wang, Z.; Zhang, M.; Liu, Y.; Xu, H.; Ma, J. An image encryption algorithm based on the perturbed high-dimensional chaotic map. Nonlinear Dyn. 2015, 80, 1493–1508. [Google Scholar] [CrossRef]
  17. Kaur, M.; Singh, D.; Sun, K.; Rawat, U. Color image encryption using non-dominated sorting genetic algorithm with local chaotic search based 5D chaotic map. Future Gener. Comput. Syst. 2020, 107, 333–350. [Google Scholar] [CrossRef]
  18. Gao, X. Image encryption algorithm based on 2D hyper-chaotic map. Opt. Laser Technol. 2021, 142, 107252. [Google Scholar] [CrossRef]
  19. Kumar, V.; Girdhar, A. A 2D logistic map and Lorenz-Rossler chaotic system based RGB image encryption approach. Multimed. Tools Appl. 2021, 80, 3749–3773. [Google Scholar] [CrossRef]
  20. Mondal, B.; Behera, P.K.; Gangopadhyay, S. A secure image encryption scheme based on a novel 2D sine–cosine cross-chaotic (SC3) map. J. Real Time Image Process. 2021, 18, 1–18. [Google Scholar] [CrossRef]
  21. Zhu, H.; Zhao, Y.; Song, Y. 2D Logistic-Modulated-Sine-Coupling-Logistic Chaotic Map for Image Encryption. IEEE Access 2019, 7, 14081–14098. [Google Scholar] [CrossRef]
  22. Yang, C.; Wei, X.; Wang, C. S-Box Design Based on 2D Multiple Collapse Chaotic Map and Their Application in Image Encryption. Entropy 2021, 23, 1312. [Google Scholar] [CrossRef] [PubMed]
  23. Toktas, A.; Erkan, U. 2D fully chaotic map for image encryption constructed through a quadruple-objective optimization via artificial bee colony algorithm. Neural Comput. Appl. 2021, 1–25. [Google Scholar] [CrossRef]
  24. Wu, Y.; Liu, L. An Iteration-Time Combination Method to Reduce the Dynamic Degradation of Digital Chaotic Maps. Complexity 2020, 2020, 1–11. [Google Scholar] [CrossRef]
  25. Pincus, S.M. Approximate entropy as a measure of system complexity. Proc. Natl. Acad. Sci. USA 1991, 88, 2297–2301. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  26. Patro, K.A.K.; Acharya, B.; Nath, V. Secure multilevel permutation-diffusion based image encryption using chaotic and hyper-chaotic maps. Microsyst. Technol. 2019, 25, 4593–4607. [Google Scholar] [CrossRef]
  27. Patro, K.A.K.; Acharya, B.; Nath, V. Secure, Lossless, and Noise-resistive Image Encryption using Chaos, Hyper-chaos, and DNA Sequence Operation. IETE Tech. Rev. 2020, 37, 223–245. [Google Scholar] [CrossRef]
  28. Tsafack, N.; Iliyasu, A.M.; De Dieu, N.J.; Zeric, N.T.; Kengne, J.; Abd-El-Atty, B.; Belazi, A.; El-Latif, A.A.A. A memristive RLC oscillator dynamics applied to image encryption. J. Inf. Secur. Appl. 2021, 61, 102944. [Google Scholar] [CrossRef]
  29. Patro, K.A.K.; Acharya, B. A Simple, Secure, and Time-Efficient Bit-Plane Operated Bit-Level Image Encryption Scheme Using 1-D Chaotic Maps. In Innovations in Soft Computing and Information Technology; Springer: Singapore, 2019; Volume 1, pp. 261–278. [Google Scholar] [CrossRef]
  30. Patro, K.A.K.; Acharyy, B. A novel multi-dimensional multiple image encryption technique. Multimed. Tools Appl. 2020, 79, 12959–12994. [Google Scholar] [CrossRef]
  31. Patro, K.; Acharva, B. An efficient dual-layer cross-coupled chaotic map security-based multi-image encryption system. Mul-Timed Tools Appl. 2020, 104, 1–47. [Google Scholar] [CrossRef]
  32. Yang, F.; Mou, J.; Sun, K.; Chu, R. Lossless image compression-encryption algorithm based on BP neural network and chaotic system. Multimed. Tools Appl. 2020, 79, 19963–19992. [Google Scholar] [CrossRef]
  33. Zhang, Y.; Xu, P.; Xiang, L. Research of Image Encryption Algorithm Based on Chaotic Magic Square. In Advances in Electronic Commerce, Web Application and Communication; Springer: Berlin/Heidelberg, Germany, 2012; Volume 149, pp. 103–109. [Google Scholar] [CrossRef]
  34. Li, R.L.; Liu, Q.; Liu, L.F. Novel image encryption algorithm based on improved logistic map. IET Image Process. 2019, 13, 125–134. [Google Scholar] [CrossRef]
  35. Liu, Y.; Qin, Z.; Liao, X.F.; Wu, J.H. Cryptanalysis and enhancement of an image encryption scheme based on a 1-D coupled Sine map. Nonlinear Dyn. 2020, 100, 2917–2931. [Google Scholar] [CrossRef]
  36. Chen, C.; Sun, K.H.; Peng, Y.; Alamodi, A.O. A novel control method to counteract the dynamical degradation of a digital chaotic sequence. Eur. Phys. J. Plus 2019, 134, 31. [Google Scholar] [CrossRef]
  37. Rehman, A.U.; Liao, X.; Hahsmi, M.A.; Haider, R. An efficient mixed inter-intra pixels substitution at 2bits-level for image encryption technique using DNA and chaos. Optik 2018, 153, 117–134. [Google Scholar] [CrossRef]
  38. Patro, K.A.K.; Acharya, B.; Nath, V. Various dimensional colour image encryption based on non-overlapping block-level dif-fusion operation. Microsyst. Technol. 2020, 26, 1437–1448. [Google Scholar] [CrossRef]
  39. Yang, Y.; Wang, L.; Duan, S.; Luo, L. Dynamical analysis and image encryption application of a novel memristive hyperchaotic system. Opt. Laser Technol. 2021, 133, 106553. [Google Scholar] [CrossRef]
  40. Kaur, G.; Agarwal, R.; Patidar, V. Chaos based multiple order optical transform for 2D image encryption. Eng. Sci. Technol. 2020, 23, 998–1014. [Google Scholar] [CrossRef]
  41. Wu, Y.; Zhou, Y.; Saveriades, G.; Agaian, S.; Noonan, J.P.; Natarajan, P. Local Shannon entropy measure with statistical tests for image randomness. Inf. Sci. 2013, 222, 323–342. [Google Scholar] [CrossRef] [Green Version]
  42. El-Latif, A.A.A.; Abd-El-Atty, B.; Belazi, A.; Iliyasu, A.M. Efficient Chaos-Based Substitution-Box and Its Application to Image Encryption. Electronics 2021, 10, 1392. [Google Scholar] [CrossRef]
  43. Patro, K.; Soni, A.; Netam, P.K.; Acharya, B. Multiple grayscale image encryption using cross-coupled chaotic maps. J. Inf. Secur. Appl. 2020, 52, 102470. [Google Scholar] [CrossRef]
  44. Sravanthi, D.; Patro, K.A.K.; Acharya, B.; Majumder, S. A Secure Chaotic Image Encryption Based on Bit-Plane Operation. In Soft Computing in Data Analytics; Springer: Singapore, 2018; Volume 758, pp. 717–726. [Google Scholar] [CrossRef]
  45. Asgari-Chenaghlu, M.; Balafar, M.A.; Feizi-Derakhshi, M.R. A novel image encryption algorithm based on polynomial com-bination of chaotic maps and dynamic function generation. Signal Process. 2019, 157, 1–13. [Google Scholar] [CrossRef]
  46. Khan, J.S.; Ahmad, J. Chaos based efficient selective image encryption. Multidimens. Syst. Signal Process. 2019, 30, 943–961. [Google Scholar] [CrossRef]
  47. Ayoup, A.M.; Hussein, A.H.; Attia, M.A.A. Efficient selective image encryption. Multimed. Tools Appl. 2016, 75, 17171–17186. [Google Scholar] [CrossRef]
Figure 1. Octrees of a pixel matrix with size 6 × 8.
Figure 1. Octrees of a pixel matrix with size 6 × 8.
Mathematics 10 00457 g001
Figure 2. The trajectories of improved sequences: (a) x-dimensional variable (b) y-dimensional variable.
Figure 2. The trajectories of improved sequences: (a) x-dimensional variable (b) y-dimensional variable.
Mathematics 10 00457 g002
Figure 3. The phase diagrams: (a) x-dimensional variable of improved sequences (b) y-dimensional variable of improved sequences (c) Equations (1).
Figure 3. The phase diagrams: (a) x-dimensional variable of improved sequences (b) y-dimensional variable of improved sequences (c) Equations (1).
Mathematics 10 00457 g003
Figure 4. Approximate entropy of x-dimensional proposed sequence and Equation (1).
Figure 4. Approximate entropy of x-dimensional proposed sequence and Equation (1).
Mathematics 10 00457 g004
Figure 5. Permutation entropy of x-dimensional proposed sequence and Equation (1).
Figure 5. Permutation entropy of x-dimensional proposed sequence and Equation (1).
Mathematics 10 00457 g005
Figure 6. Lyapunov exponent of x-dimensional proposed sequence and Equation (1).
Figure 6. Lyapunov exponent of x-dimensional proposed sequence and Equation (1).
Mathematics 10 00457 g006
Figure 7. Auto-correlation function.
Figure 7. Auto-correlation function.
Mathematics 10 00457 g007
Figure 8. Sensitivity analysis: (a) The key change is a + 2−14 (b) The key change is x1 + 2−14 (c) The key change is x2 + 2−14 (d) The key change is y1 + 2−14 (e) The key change is y2 + 2−14.
Figure 8. Sensitivity analysis: (a) The key change is a + 2−14 (b) The key change is x1 + 2−14 (c) The key change is x2 + 2−14 (d) The key change is y1 + 2−14 (e) The key change is y2 + 2−14.
Mathematics 10 00457 g008
Figure 9. Bifurcation diagrams: (a) The original chaotic map; (b) The improved chaotic map.
Figure 9. Bifurcation diagrams: (a) The original chaotic map; (b) The improved chaotic map.
Mathematics 10 00457 g009
Figure 10. The flowchart of the shuffling process.
Figure 10. The flowchart of the shuffling process.
Mathematics 10 00457 g010
Figure 11. The flowchart of the substitution process.
Figure 11. The flowchart of the substitution process.
Mathematics 10 00457 g011
Figure 12. The flowchart of the image encryption algorithm.
Figure 12. The flowchart of the image encryption algorithm.
Mathematics 10 00457 g012
Figure 13. Encryption and decryption experiments (a–d) Plain-text images; (eh) Encrypted images; (i–l) Decrypted images with correct keys.
Figure 13. Encryption and decryption experiments (a–d) Plain-text images; (eh) Encrypted images; (i–l) Decrypted images with correct keys.
Mathematics 10 00457 g013
Figure 14. The histogram analysis: (ad) Original images: Baboon, Horse, Flower, Cameraman; (eh) Encrypted images: Baboon, Horse, Flower, Cameraman.
Figure 14. The histogram analysis: (ad) Original images: Baboon, Horse, Flower, Cameraman; (eh) Encrypted images: Baboon, Horse, Flower, Cameraman.
Mathematics 10 00457 g014
Figure 15. Correlation analysis of Baboon image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Figure 15. Correlation analysis of Baboon image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Mathematics 10 00457 g015
Figure 16. Correlation analysis of Horse image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Figure 16. Correlation analysis of Horse image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Mathematics 10 00457 g016
Figure 17. Correlation analysis of Flower image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Figure 17. Correlation analysis of Flower image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Mathematics 10 00457 g017
Figure 18. Correlation analysis of Cameraman image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Figure 18. Correlation analysis of Cameraman image: (a) Adjacent pixel points of the plain-text image in horizontal direction; (b) Adjacent pixel points of the plain-text image in vertical direction; (c) Adjacent pixel points of the plain-text image in diagonal direction; (d) Adjacent pixel points of the encrypted image in horizontal direction; (e) Adjacent pixel points of the encrypted image in vertical direction; (f) Adjacent pixel points of the encrypted image in diagonal direction.
Mathematics 10 00457 g018
Figure 19. Decrypted images with only 10−10 difference in the secret keys (a1e1): Baboon cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a2e2): Horse cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a3e3): Flower cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a4e4): Cameraman cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10.
Figure 19. Decrypted images with only 10−10 difference in the secret keys (a1e1): Baboon cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a2e2): Horse cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a3e3): Flower cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10; (a4e4): Cameraman cipher images with a + 10−10, x1 + 10−10, x2 + 10−10, y1 + 10−10, y2 + 10−10.
Mathematics 10 00457 g019
Figure 20. MSE analysis of encryption process of Baboon image: (a) x1; (b) x2; (c) y1; (d) y2; (e) a.
Figure 20. MSE analysis of encryption process of Baboon image: (a) x1; (b) x2; (c) y1; (d) y2; (e) a.
Mathematics 10 00457 g020
Figure 21. MSE analysis of decryption process of Baboon image: (a) x1; (b) x2; (c) y1; (d) y2; (e) a.
Figure 21. MSE analysis of decryption process of Baboon image: (a) x1; (b) x2; (c) y1; (d) y2; (e) a.
Mathematics 10 00457 g021
Figure 22. Robustness analysis (a1) 1% speckle noise (encrypted); (a2) 1% speckle noise (decrypted); (b1) 3% speckle noise (encrypted); (b2) 3% speckle noise (decrypted); (c1) 5% data loss (encrypted); (c2) 5% data loss (decrypted); (d1) 10% data loss (encrypted); (d2) 10% data loss (decrypted).
Figure 22. Robustness analysis (a1) 1% speckle noise (encrypted); (a2) 1% speckle noise (decrypted); (b1) 3% speckle noise (encrypted); (b2) 3% speckle noise (decrypted); (c1) 5% data loss (encrypted); (c2) 5% data loss (decrypted); (d1) 10% data loss (encrypted); (d2) 10% data loss (decrypted).
Mathematics 10 00457 g022
Table 1. The 16-order magic square.
Table 1. The 16-order magic square.
256232532526724924810112452441415241
1723923820212352342425231230282922722632
3322322236372192184041215214444521121048
2085051205204545520120058591971966263193
1926667189188707118518474751811807879177
8117517484851711708889167166929316316296
97159158100101155154104105151150108109147146112
144114115141140118119137136122123133132126127129
128130131125124134135121120138139117116142143113
1451111101481491071061521531031021561579998160
1619594164165919016816987861721738382176
8017817977761821837372186187696819019165
6419419561601981995756202203535220620749
2094746212213434221621739382202213534224
2253130228229272623223323222362371918240
16242243131224624798250251542542551
Table 2. Adjacent pixel position annotation.
Table 2. Adjacent pixel position annotation.
a1 = a(i−1)(j−1)a8 = a(i−1)ja7 = a(i−1)(j+1)
a2 = ai(j−1)aija6 = ai(j+1)
a3 = a(i+1)(j−1)a4 = a(i+1)ja5 = a(I + 1)(j+1)
Table 3. Variance comparison results.
Table 3. Variance comparison results.
AlgorithmImagesVariance
OriginalEncryptedDecrypted
ProposedBaboon57,916255.356957,916
Horse189,049223.5373189,049
Flower1,969,923275.90591,969,923
Cameraman124,091286.8784124,091
Baboon57,916255.356957,916
Patro, K. A. K .et al. [26]Cameraman110,970250.4141110,970
Patro, K. A. K. et al. [27]Cameraman110,970259.1328110,970
Tsafack, N. et al. [28]Baboon753,712.8784909.4980-
Patro, K. A. K. et al. [29]Cameraman110,970334.5391-
Patro, K. A. K. et al. [30]Cameraman110,970298.1875110,970
Table 4. The Chi-square test results.
Table 4. The Chi-square test results.
AlgorithmsImagesχ2 TestTesting Results
χ22550.05 = 293.2478χ22550.01 = 310.457
ProposedBaboon254.3594PassPass
Horse222.6641PassPass
Flower274.8281PassPass
Cameraman285.7578PassPass
Patro, K.A. K. et al. [31]Baboon225.3438Pass
Yang, F. et al. [32]Baboon (512 × 512)265.4Pass
Table 5. Correlation coefficient analysis.
Table 5. Correlation coefficient analysis.
ImagesHorizontalVerticalDiagonal
Baboon image0.85020.81740.7646
Encrypted Baboon0.00020.0038−0.0007
Horse image0.64250.66820.5179
Encrypted Horse0.0027−0.0051−0.0030
Flower image0.88620.96130.8772
Encrypted Flower0.00250.00250.0013
Cameraman image0.93330.95690.9052
Encrypted Cameraman0.0055−0.0065−0.0024
Patro, K. A. K. et al. [26] Cameraman−0.00130.00170.0070
Patro, K. A. K. et al. [27] Baboon0.00290.0003−0.0020
Patro, K. A. K. et al. [31] Baboon0.0003−0.0002−0.0017
Table 6. Key space.
Table 6. Key space.
AlgorithmsKey Space
Proposed2233
Tang, J. et al. [5]2231
Zhang, Y. P. et al. [33] 2.6 × 1023
Li, R. Z. et al. [34]2200
Liu, Y. et al. [35]2186
Chen, C. et al. [36]2135
Liao, X. et al. [37]2194
Patro, K. A. K. et al. [38]1.2446 × 2327
Table 7. Information entropy.
Table 7. Information entropy.
Original ImageEncrypted Image
Baboon7.24367.9972
Horse6.56457.9976
Flower5.51457.9970
Cameraman7.00847.9968
Yang, Y. et al. [39] Cameraman-7.9970
Kaur, G. et al. [40] Baboon7.70677.9852
Kaur, G. et al. [40] Cameraman7.00977.9846
Table 8. Local entropy.
Table 8. Local entropy.
Original ImageEncrypted Image
Baboon6.7879277.9020763
Flower5.1599317.902534
Horse6.2941017.901957
Cameraman5.1664507.901997
Kaur, G. et al. [40] Cameraman-7.8822
Kaur, G. et al. [40] Baboon-7.8945
El-Latif, A. A. A. et al. [42] Rustic5.441147.90284
Table 9. The values of NPCR and UACI.
Table 9. The values of NPCR and UACI.
AlgorithmsNPCRUACI
Baboon0.99630.3344
Horse0.99610.3347
Flower0.99640.3365
Cameraman 0.99620.3344
Toktas, A. and Erkan, U. [23] Cameraman 0.99610.3347
Patro, K.A. K. et al. [27] Cameraman 0.99620.3344
Yang, Y. et al. [39] Cameraman 0.99630.3341
Patro, K. A. K. et al. [43] Baboon (512 × 512)0.99610.3347
Sravanthi, D. et al. [44] Cameraman 0.99610.3342
Table 10. Speed tests.
Table 10. Speed tests.
AlgorithmsImagesUnit (s)Speed (Mb/s)
ProposedBaboon0.60870.8214
Horse0.60330.8287
Flower0.59570.8393
Cameraman 0.60210.8304
Khan, J. S. and Ahmad, J. [46]Flower0.55-
Ayoup, A. M. et al. [47] Flower7.21-
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wang, J.; Liu, L. A Novel Chaos-Based Image Encryption Using Magic Square Scrambling and Octree Diffusing. Mathematics 2022, 10, 457. https://doi.org/10.3390/math10030457

AMA Style

Wang J, Liu L. A Novel Chaos-Based Image Encryption Using Magic Square Scrambling and Octree Diffusing. Mathematics. 2022; 10(3):457. https://doi.org/10.3390/math10030457

Chicago/Turabian Style

Wang, Jie, and Lingfeng Liu. 2022. "A Novel Chaos-Based Image Encryption Using Magic Square Scrambling and Octree Diffusing" Mathematics 10, no. 3: 457. https://doi.org/10.3390/math10030457

APA Style

Wang, J., & Liu, L. (2022). A Novel Chaos-Based Image Encryption Using Magic Square Scrambling and Octree Diffusing. Mathematics, 10(3), 457. https://doi.org/10.3390/math10030457

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop