Enhancing chaos in multistability regions of Duffing map for an image encryption algorithm

This paper investigates and analyzes the dynamics of the two-dimensional Duffing map. Multistability behavior has been observed from the system numerically. Such behavior, especially the coexistence of chaotic and periodic attractors, is undesirable in the applications of chaos-based cryptography. Therefore, we design and implement a Sine–Cosine chaotification technique to enhance chaos in the multi-stable regions. Furthermore, this paper proposes a new image encryption algorithm to examine the performance of the generalized Duffing map in cryptography applications. Simulation results and security analysis reveal that the proposed algorithm can effectively encrypt and decrypt several image types with a high level of security.


Introduction
Information security has become crucial due to the rapid development of multimedia and Internet technology, especially images, that are shared online.Recent security analyses revealed that the classic encryption algorithms, such as Advanced Encryption Standard (AES) and Data Encryption Standard (DES), are undesirable for images because of their characteristics [1].Therefore, several approaches for increasing security have been proposed, such as cellular automata [2], DNA coding [3], compressive sensing [4,5], wavelet transmission [6], and chaos [7,8].Due to the high security and fast speed of the chaos-based image encryption technique and the similarity between the features of chaotic systems and images, this technique has become widely used and most preferable in cryptography applications [9,10,11].
Many image encryption schemes have thus been developed using chaotic systems [12,13,14,15,17,18,19,20]. It has been established that the security level of a chaos-based encryption algorithm is highly dependent on the characteristics of the employed chaotic maps [21].However, recent investigations have revealed that numerous employed maps can have some drawbacks, such as chaos degradation with finite precision platforms, low complex performance, narrow and discontinuous chaotic ranges [22].In this way, several studies have been performed to improve the characteristic of chaotic maps by proposing different chaoticfication techniques.For example, Hua et al. [25,23] enhanced the chaotic behaviors of the Logistic map by modulating its output using a nonlinear transforme.Natiq et al. [24] enhanced the chaos complexity of the 2D Henon map using a Sine map for image encryptions.Hua et al. [26] proposed a Cosine chaoticfication technique to generate robust chaotic maps for encrypting images.
However, some investigations on the dynamics of chaotic systems have discovered appealing nonlinear phenomena, namely multistability behaviors or coexisting attractors [27].Multi-stable chaotic systems can exhibit more than one chaotic or periodic attractor with appropriate initial conditions.Multi-stable chaotic systems with continuous-time have been presented during the last few years [28].Meanwhile, little attention has been focused on the multistability in discrete-time chaotic systems or maps [29].Note that a multi-stable system with coexisting chaotic and periodic attractors is not preferable in cryptography applications.Therefore, it is crucial to determine either the regions of coexisting only chaotic attractors or a suitable chaotification technique to enhance chaos in the multistability regions.
In this work, we revisit the dynamics of a 2D discrete chaotic system, namely, the 2D-Duffing map.The numerical investigations show that the Duffing map can produce multistability behaviors in which the coexistence of chaotic and non-chaotic attractors and the coexistence of two chaotic attractors can observe with a specific set of system parameters.It is imperative to note that such complicated behavior is rare in lowdimensional chaotic maps.Therefore, we introduce a chaotification technique based on two trigonometric functions to overcome this situation.Dynamical properties show that the proposed chaotification technique can improve the chaotic and non-chaotic attractors to become hyperchaotic attractors.Besides, it enhances the unpredictability and randomness of the map.Based on the generalized Duffing map, we propose a new image encryption algorithm with the principles of confusion and diffusion.Firstly, the hyperchaotic sequences are generated for scrambling of plain-image pixels.Then, the diffusion process is accomplished by the elliptic curves, S-box, and hyperchaotic sequences.The simulation results confirm that the proposed encryption algorithm can effectively encrypt various kinds of digital images including Grey-scale, RGB, medical, and hand writing images.Security analysis shows that this algorithm can resist common attacks, such as statistical, differential, known plaintext attack and chosen plaintext attack.Efficient analysis indicates that it has low computation and time complexity.Therefore, it has excellent application prospect.
This paper is arranged as follows: Section 2 describes the dynamics of the 2D-Duffing map.In Sec-tion3, we introduce a chaotification approach to enhance chaos complexity of the 2D-Duffing map, and then calculate the performance of the enhance map.Section 4 introduces an image encryption algorithm based on the enhanced Duffing map.Simulation results for image encryption using some existing schemes and our proposed scheme are presented in Section 5. Section 6 is left to perform the security analysis of encrypted images.Finally, Section 7 concludes the results.

The Duffing model
The Duffing map, also known as the Holmes map [30], is a 2D discrete-time chaotic system, given by, where the parameters α and β are positive.

Stability of equilibrium points
From a graphical point of view, a point E is said to be an equilibrium point of the function G(x) only if G n (E) = E. Thus, one can obtain the equilibrium points of the system (1) by reducing its dimension as follows: where v = 1, 2, . . .For the parameters α = 2.75 and β = 0.2, the equilibrium points can be obtained as: The stability of the equilibrium points is determined by the following Jacobian matrix of the Duffing map (1).
Next, the Duffing map (1) can be linearized with respect to an equilibrium point The corresponding eigenvalues at E i can be obtained by solving det(λI − J Ei ) = 0, which yields Thus, the eigenvalues are given by In discrete dynamical systems, the stability of equilibrium points is dependent on the corresponding eigenvalues.If an eigenvalue lies the interval [−1, 1], then the equilibrium point is said to exhibit a stable state.
Otherwise, it represents an unstable state.For the parameters α = 2.75 and β = 0.2, the stability of the equilibrium points of the Duffing map ( 1) is illustrated in Table 1.Clearly, the Duffing map has one unstable and two stable equilibrium points.

Self-excited chaotic attractor
To investigate the dynamical behaviors of the map (1), we calculate the Lyapunov exponents (LE) as depicted in Figure 1 corresponding to the initial conditions (0.25, 0.77).
It is seen that the map (1) exhibits two different behaviors in one of which it exhibits chaos where the largest Lyapunov exponent (LLE) is positive, and in the other it shows periodic behaviors with LLE is zero or negative.Figure 2 demonstrates the chaotic behaviors of the Duffing map corresponding to the parameters α = 2.75 and β = 0.2.Furthermore, since the map (1) has one unstable equilibrium point corresponding to a different set of parameters α = 2.75 and β = 0.2, the chaotic attractor in Figure 2 is self-excited [27].

Coexisting attractors
Multistability behaviors or coexisting attractors indicate that the nonlinear dynamical system can produce two or more attractors by changing the initial conditions.The coexistence of attractors is a phenomenon that happens in nonlinear dynamical systems due to the high sensitivity of such systems to their initial conditions.In this subsection, we demonstrate the existing of multistability behaviors in the Duffing map (1) by considering an appropriate set of initial conditions.Such complicated behaviors of the Duffing map have not been studied in the previous studies.
For a fixed value of β, i.e., β = 0.218, when the parameter α is varied from 2.4 to 2.75, the coexisting bifurcation model and the LE of the Duffing map (1) corresponding to the initial conditions (0.25, 0.97) (blue), (0.25, 0.77) (red) are plotted as shown in Figure 3.It is seen that the coexistence of self-excited chaotic attractors and the periodic orbits occur mainly in the region 2.532 ≤ α ≤ 2.539.However, two self-excited chaotic attractors can also coexist in some other region of 2.71 ≤ α ≤ 2.74.To further visualize these interesting features, we consider two other values of α, i.e., α = 2.5392 and 2.73.The results are displayed in Figure 4 (a) and (b) respectively.As can be seen in Fig. 4 (a), the Duffing map (1) shows the coexistence of a chaotic attractor and periodic orbit.Furthermore, this map shows in Fig. 4 (b) the coexistence of two chaotic attractors located in different positions depending on the location of the two unstable equilibria E 2 and E 3 .
It is to be noted that the keys in the chaos-based cryptosystems are typically formed by means of the initial conditions and the parameters of the chaotic map.However, when the chaotic map exhibits multistability behaviors, such as the coexistence of chaotic attractors and periodic orbits, the corresponding cryptosystems will be insecure.In this situation, one requires to introduce an efficient chaotification technique on 2D Duffing map (1) for enhancing chaos in the non-chaotic regions.(3) and its stability when the parameters α = 2.75 and β = 0.2: 1) for A = 1 and B = 1, there is only one stable equilibrium point (green color); 2) for A = 2 and B = 3, there are three equilibria (red color) in which two stable and one unstable; 3) for A = 15 and B = 3.7, there are 25 equilibria (blue color) in which 15 stable and 10 unstable.

Sine-Cosine chaotification technique
This section proposes a new chaotification technique that uses two trigonometric functions as nonlinear transforms to the outputs of the Duffing map (1).The Sine and Cosine functions are applied to enhance the chaos and complexity of the Duffing map in the chaotic region.Moreover, these functions can also be used to produce chaos in the non-chaotic regions.
The structure of the proposed technique is shown in Figure 6, where f (y(n)) and g (x(n), y(n)) are two seed maps taken from Eq. (1).Mathematically, the proposed map can be defined as follows where A (> 0), and B (> 0) are parameters.

Stability analysis of the enhanced Duffing map
In the previous section 2.1, we have seen that the Duffing map (1) has three equilibrium points in which two of them are stable and the other unstable, as illustrated in Table 1.So, it is interesting to know whether the enhanced Duffing map (3) generates the same numbers or different numbers of equilibria when α = 2.75 and β = 0.2.Besides, it is important to investigate the stability of these equilibria.We note that the eigenvalues of the enhanced Duffing map satisfy the relation λ 1 = −λ 2 .Three cases may be of interest to investigate the stability of equilibrium Thus, it can be concluded that depending on the values of the parameters A and B, the enhanced Duffing map (3) can generate equilibrium points less than or equal to or greater than those of the Duffing map (1).

Enhancing chaos of Duffing map
Since the number of equilibria of the enhanced map (3) can be larger than those of the original map when the parameters A and B are large enough [See the third case in Figure 5], it is quite reasonable to assume that increasing the equilibria of a dynamical system in a limited range can enhance chaos with overlapping coexisting attractors.
In order to graphically demonstrate the above features, we consider the parameters of the enhanced map (3) as β = 0.218, A = B = 4.5 for which the map has 37 equilibrium points distributed within the range [−3.89, 3.97].Figure 7 (a) and (b) depict the coexisting bifurcation model and LLE of the Duffing map (1) corresponding to two sets of initial conditions (0.25, 97) (blue), (0.25, 0.77) (red).Clearly, the chaotic regions of the 2D Duffing map are enhanced and the non-chaotic regions shift to the chaotic regions.Furthermore, the two coexisting chaotic attractors of the enhanced map (3) are overlapped, and occupied a much larger region in the 2D phase space, as can be seen in Figure 7 (c).

Generating hyperchaotic behaviors
A nonlinear dynamical system exhibits hyperchaotic behaviors only when it has at least two positive values of the LEs.So, the 2D Duffing map (1) exhibits no hyperchaotic behavior as it has only one positive value of the LE with some parameter values (See Figure 1).Typically, the trajectory of a dynamical system with hyperchaotic behavior is more difficult to predict than chaotic ones, and so is desirable for cryptography applications.
To examine the occurrence of hyperchaotic behaviors in the enhanced Duffing map (3), we calculate the LEs when both the parameters A and B vary as shown in Figure 8.The LLE of the enhanced map ( 3) is illustrated in Figure 8 (a), while the lowest LE is illustrated in Figure 8 (b).It is seen that the enhanced map shows chaotic behaviors with higher values of the LLE when B ∈ (7.3, 15] and for any value of the parameter A. However, the hyperchaotic behaviors of the enhanced map are observed in two regions as follows: 1) A ∈ [12,15] and B ∈ [4, 7.3); 2) A ∈ [3,15] and B ∈ [2,4].
In order to verify the features of the enhanced Duffing map (3) that the hyperchaotic attractor has high level of complexity and spreads in a wide region of the 2D phase space, we plot the hyperchaotic attractor of the enhanced map as well as the attractors of other chaotic and hyperchaotic maps as shown in Figure 9.
Figure 9 shows that the attractor of the enhanced map with the parameters α = 1, β = 5, A = 15, B = 3.7 occupies the whole 2D phase space with regions x ∈ [−15, 15] and y ∈ [−3.7, 3.7].This means that the enhanced map generates some extreme unpredictable sequences, and its ergodicity property is much better than other maps.

Complexity based Sample Entropy
Richman et al. [33] introduced an approach to develop an Approximate Entropy, which is widely used as a measure for estimating the time series complexity.Several analyses have demonstrated that the developed measure, namely, the Sample Entropy (SamEn) is more accurate than Approximate Entropy.
To illustrate the complexity of the enhanced map (3), Figure 10 2. As can be seen that the sequences {x} and {y} pass all the statistical tests, which means that these two sequences are reliable PRNG, and have excellent randomness property.
In summary, Lyapunov exponents, trajectory, SamEn, and FIPS 140-2 have demonstrated that the enhanced map (3) exhibits decent ergodicity property, wide hyperchaotic behavior, high level of complexity and randomness.As a result, the enhanced map would be very promising for cryptography applications.

Chaos based image encryption and decryption
This section introduces a new image encryption algorithm.Figure 12 illustrates the structure of the proposed algorithm, which achieves the confusion and diffusion processes by the hyperchaotic sequences and elliptic curve over the Galois field GF 2 8 .Specifically, the enhanced Duffing map (3) is used to generate hyperchaotic sequences for scrambling the pixels of a plainimage through image scrambling algorithm.Subsequently, the diffusion process is accomplished by field matrix, S-box, and hyperchaotic sequence.Simulations results demonstrate that the proposed encryption algorithm gives the users a flexibility to encrypt several kinds of images such as Grey scale, Medical, and RGB images with a higher level of security.

Confusion based bit-plane transformation
An efficient encryption algorithm should disassemble the high correlations between adjacent pixels.These high correlations can be de-correlated by scrambling adjacent pixels to different positions.To ensure an efficient scrambling process, we divided the plain-images into 8-bit-plane.Then the positions of all adjacent pixels are randomly scrambled by the image scrambling algorithm.The latter is demonstrated in Algorithm 1.
The algorithm typically illustrates the pseudo-code of scrambling and de-scrambling processes.

S-box and the field matrix
We construct the S-box and the field matrix based on the points of an elliptic curve over the Galois field GF 2 n .The description of the elliptic curve and its points is given below.The elliptic curve is a set of points that satisfy the following Weierstrass equation: where a 1 , a 2 , a 3 , a 4 , a 5 , and a 6 represent the parameters and the initial conditions of the map (3) A, α, B, β, IC 1 , and IC 2 , respectively.The elliptic curve equation over the field GF 2 8 is defined as which is obtained by the following transformation where a 1 = 0 and a, b ∈ F 2 8 .Thus, the curve is defined over the field GF 2 8 , and a and b are calculated as with c 1 = a 3 /a 3 1 and c 2 = (a 2 3 .a4 + a 3 3 )/a 6 1 .To construct the field matrix F , we first extract some points which satisfy Eq. ( 5), by means of the following primitive polynomial.
Here, if the generator g satisfies f (g) = 0, one obtains g 8 = g 4 + g 3 + g 2 + 1, where g ≡ (00000010).Thus, the properties of the points on elliptic curve E 2 8 (a, b) over the field F 2 8 can be stated as follows:  3), 2D-LICM [17], 2D-LASM [23], 2D-SIMM [31], and 2D-SLMM [25], respectively.(5) and if O is the additive identity, i.e., P + O = P then −P = (x p , x p + y p ) and P − P = O. -If P = (x p , y p ), Q = (x q , y q ) ∈ E 2 8 (a, b) and P = ±Q, then R = P + Q = (x r , y r ), where (x r , y r ) = (α 2 + α + x p + x q + A, α(x p + x r ) + x r + y p ) and α = (y q + y p )/(x p + x q ).Again, if The algorithm for the field matrix and its inverse is stated in Algorithm 2. The field matrix is constructed by the initial conditions IC 1 , and IC 2 of the enhanced map (3) and the primitive polynomial f (x).It is imperative to note here that the field matrix is invertible over Z 2 , which gives the possibility to generate the inverse S-Box for decryption process.
Next, in order to extract points P (x, y) to form the S-box of order 16×16, we require 256 number of points, i.e.P = [P 1 , P 2 , ..., P 256 ] that satisfy Eq. ( 5).As an Algorithm 2: The field matrix and its inverse.
Input: The initial conditions IC 1 , and IC 2 , as well as the primitive polynomial f (x).Output: The field matrix and inverse field matrix.Input: The sequences {x 1 } and {y 1 }, as well as the extract points P , field matrix F and f (x).Output: The S-Box and inverse S-Box.GF 2 8 into two new sequences as follows: x 1 =f loor(mod(x × 10 5 , 256)), y 1 =f loor(mod(y × 10 5 , 256)).
The new sequences {x} and {y} along with the extracted points P (x, y) of the elliptic curve over the Galois field GF 2 8 , the primitive polynomial f (x) and the field matrix F are then used to construct the S-box.The corresponding algorithm is given in Algorithm 3.

Diffusion process
An image encryption algorithm has the ability to defeat chosen-plaintext attack when it has an efficient diffusion process.Therefore, this section introduces a new algorithm based on the field matrix F , S-Box, and the hyperchaotic sequence {y}.The process is described as follows: Step  Step 3 : The new scramble image matrix SC i k×k is generated by the field matrix, which can be defined as , where i 1 , j 1 = 1, 2, ...k and l = 1, 2, ..., i.
Step 4 : The block cipher image (CI) CI i k×k is obtained by the bitwise XOR operation among SC i k×k , S-Box and the sequence S y .
Step 5 : The cipher image is obtained by reshaping CI i k×k into CI m×n as: CI m×n ←− reshape(CI i k×k , m, n).

The process of decryption
The receiver section gets the cipher image along with the initial condition and control parameters of the enhanced map (3).Then the receiver constructs the field matrix F and the S-box, which are considered as secrete key.Using the elliptic curve, hyperchaotic sequences, and the secrete key, the receiver can construct the inverse field matrix and the inverse S-Box which represent the original key.Finally, the plain-image is recovered by the following decryption process.

Simulation results and key analysis
In this section, the proposed image encryption algorithm is simulated to demonstrate its efficiency.Moreover, the robustness of the employed key is investigated by performing the key space and the key sensitivity analyses.

Encrypting different kinds of images
To illustrate the ability of the proposed image encryption algorithm for ciphering different types of images, Figure 13 depicts the encryption results with uniformly distributed histograms of various kinds of plain-images including Grey scale, RGB, Sketch, and Hand writing images with the size of (512 × 512).Moreover, this figure shows the encryption of a medical image of size (630 × 630) with its histogram.It can be seen from these results that the proposed encryption algorithm can effectively encrypt various kinds of images.

Key space analysis
Typically, the security key of chaos-based cryptography contains two main components, namely the initial conditions and the control parameters of the employed chaotic map.In the proposed encryption algorithm, the parameters and the initial conditions of the enhanced Duffing map (3) are the main roots of the secrete keys.Each parameter and initial values are considered with 15 to 16 decimal places, which means that the complexity of each parameter and the initial value is 2 52 .Besides that, the hyperchaotic sequences of the enhanced map (3) are generated by the parameters and the initial conditions for constructing the field matrix and the S-box.So, the key space in producing F and the S-Box is 2 64 (for 64−bit operation)×2 102 (initial conditions) = 2 166 , and the total key combinations is 2 478 i.e., the size of the key in the proposed algorithm is 478 bits.Consequently, the security key of the proposed algorithm achieves the standard requirement [21].Furthermore, the total time to break an encrypted image is calculated as follows where Y is the total years to break an encrypted image, and T is the total security key space.A super computer has 10 15 floating-point operation per second (FLOPS).So, the total time to break the encrypted image by the proposed algorithm is approximately 1.230593278× 10 137 years.

Security analysis
The most important indicator to evaluate an image encryption algorithm is the security performance of its encrypted image.This section introduces an analysis framework to investigate the security of the encrypted images by the proposed algorithm.

Robustness analysis of noise and data loss
Different kinds of noise and data lose can corrupt the encrypted images.So, the image encryption algorithms should be able to resist these kinds of noise and data lose.The first and second columns of Figure 14 demonstrate the quality results of the recovered image when the corresponding encrypted image undergoes Gaussian noise with 5% density, as well as salt and pepper noise with 12% density.It can be observed that although the encrypted images have noise, the corresponding recovered images contain the most visual information of the original images.Besides that, the proposed algorithm has successfully recovered the images with Peak Signalto-Noise Ratio (PSNR) equal to 22.32 and Mean Squre Error (MSE) equal to 381.08 even with an addition of 5% Gaussian noise.Meanwhile, the obtained PSNR and MSE for addition of 12% of salt and pepper noises are 17.3648 and 1192 respectively.Moreover, the third column of Figure 14 shows that the recovered images by the proposed algorithm can still be recognizable when the encrypted image has 15% data loss.As a result, the proposed encryption algorithm can resist different kids of noise and data loss.

Differential attack resistance
A vulnerable encryption scheme could attack by observing the change in the encrypted images when a small change or modification happens in the corresponding plain image.This type of attack is namely chosen plaintext attack or differential attack.The NPCR and UACI tests could be employed to estimate the resistance of encryption algorithms against differential attacks.The NPCR indicates the pixel change rate, while the UACI indicates the unified averaged changed intensity.These two measures are as follows: where D(i, j) is the change of the pixel values from the plain-image to the encrypted image due to the encryption process, in which D(i, j) = 0 when P (i, j) = CI(i, j) As the pixel values are changed, the UACI can be used to determine the average intensity of the difference between the original and the encrypted image, where However, Wu [34] presented a new standard of NPCR and UACI measures for better estimating the ability of an encryption algorithm for resisting differential attack.
In this regard, an image encryption algorithm can pass the NPCR test when its NPCR value is bigger than a level α, which is given by the following equations.
where Φ −1 is the inverse CDF of the standard Normal distribution N (0, 1), and F is the largest supported pixel value compatible with the cipher text image format.An encryption algorithm successfully passes the UACI test when the simulation value is in the range of U ACI ∈ (U − α , U + α ).Here, U − α and U + α are given by with In this test, for each plaint image, namely, P I 1 , we generate an another image, namely, P I 2 by selecting a pixel from P I 1 and changing its value by 1-bit.Subsequently, the UPCR and UACI values can be calculated by generating the encrypted images of both P I 1 and P I 2 .The NPCR and UACI results of 27 different types of images, which are taken from USC-SIPI Miscellaneous data set and which have been encrypted by the proposed algorithm and several other schemes, are illustrated in Table 3. From these results it is found that that the proposed algorithm has superior or competitive performance in defending the differential attack.

Resisting Noise Attack Analysis
The encoded image version is inevitably exposed to different types of noises, when the data passes through a real communication channel.This noise can cause problems during the acquisition of the original image.Therefore, the algorithm should be noise resistant, so that the encryption scheme can be valid.The Peak Signalto-Noise Ratio (PSNR) is used to measure the quality of the decoded image after the attacks.For the image components, PSNR can be obtained by the following formulation where MSE is the mean square error between the original and recovered images and is represented as P and DCI respectively, with the size of m × n.The first and second columns of Fig. 14 demonstrate the quality results of the recovered image when the corresponding encrypted image undergoes Gaussian noise with 5% density, as well as salt and pepper noise with 12% density.The MSE and PSNR of these decoded images are shown in Table 4. From this table and Fig. 14, we can understand that the original image is entirely obtained again, which is noticeable, the PSNR value is near about 30dB when Gaussian noise density 1%, 22dB with 5% density and 18dB for 12% density and the decoded images are highly correlated with original image.

Key sensitivity analysis
The employed key of an image encryption scheme is considered as highly sensitive when the encrypted image cannot be recovered due to a slight difference in one of the key components.To visualize the key sensitivity of the proposed encryption algorithm, we set the main root of the secrete keys, which represent the initial conditions and parameters of the map (3), as A = 15.02154872,B = 3.50142547, β = 5.02314723, α = 10.00148752,IC 1 = 0.2501254781, IC 2 = 0.2712548731.Subsequently, we change 14 th decimal places in the parameters, or initial conditions, or both to obtain three other keys.Figure 16 demonstrates the key sensitivity in the decryption process with the original key and the modified keys.We consider different image sizes and calculate the NPCR and UACI values corresponding to the encryption with the actual parameters and initial condition as well as the decryption with wrong parameters and initial condition.The results are given in Table 5.Thus, from Table 5 it is clear that even with a small change, i.e., a change in the 14-th decimal place of the parameters or initial condition, the change in the pixel values is more than 99% after decryption with wrong initial condition and/or parameters.

Correlation analysis
The adjacent pixels of the original image are highly correlated along the vertical, diagonal, and horizontal directions.Thus, an efficient encryption algorithm can resist a statistical attack when the adjacent pixels of its encrypted image is nearly zero.To calculate the pixels correlation, let us first define the covariance between a pair of pixel values x and y, which is given by where E(x) and E(y) are the means.Now, the correlation coefficients can be calculated by where σ(x) and σ(y) are the standard deviations of the distribution of the pixel.
In our analysis, adjacent pixels in horizontal, vertical, and diagonal directions are randomly chosen from both plaint and encrypted images, as shown in 15.As can be seen, most of the pixels are close to the diagonal line of axis for the plain image.Meanwhile, the pixels of the encrypted image distribute randomly on the whole space.Furthermore, quantitative and comparison results of adjacent pixels correlations of Lena image, which is encrypted by the proposed encryption algorithm and other existing schemes, are illustrated in Table 6.Clearly, the ρ xy values of our scheme are more closer to 0, and superior and competitive than those of some other schemes.

Local Shannon Entropy
The Local Shannon entropy, which quantitatively measures the distribution of information, is used to estimate the randomness of an encrypted image.Mathematically, it is defined as where s 1 , s 2 , ..., s k are k selected blocks with T B pixels of a chosen image.If H k,T B is in the interval of (h lef t , h right ), then the cipher text image will be considered as passing the test.Next, we calculate the critical values h lef t and h right with α level of significance in a Z − test as follows: where Φ −1 is the inverse cumulative density function of the standard normal distribution N (0, 1) and µ H k,T B , and σ H k,T B be the mean and variance of Local Shannon entropy calculated in k non overlapping blocks.
In this test, we select 27 different images from USC-SIPI Miscellaneous data set, and then encrypt these images by various image encryption algorithms.According to the recommendation in [37], we set the parameters (k, T B) = (30,1936) and α = 0.001, then an image is considered to pass the test if the obtained Local Shannon Entropy falls into the interval (7.901515698, 7.903422936).

Computational and time complexity analyses
In the row-column permutation or the confusion stage, the computational complexities to perform the row shuffling and the column shuffling operations using the chaotic sequence, respectively, are O(m) and O(n), where m and n are the pixel values.So, the computational complexity to perform the pixel shuffling is 8(m + 8n).
In the diffusion stage, the images are first divided into scramble matrices SC i k×k for k = 1, 2, ..., 16 and i = 1, 2, ..., m×n k 2 .This means that each block is of the order of k × k in which each vector is multiplied by the field matrix of order 8 × 8. Thus, the time complexity is given as O( 64×m×n k 2 ).Also, in the final encryption in which bitwise-XOR is performed, the time complexity is given as 72(m + n).So, the total time complexity is 64×m×n k 2 + 8(10m + 17n).As an illustration, we consider a Barbara image of size 512 × 512, encrypt it 60 times using R2016a Matlab software with i3-4005 CPU 1.7 GHz, 4-Gb RAM, finally compare with different existing schemes to show the efficiency of our proposed algorithm.The results are dilplayed in Table 9.

Conclusion
A low-dimensional discrete chaotic system such as the Duffing map can exhibit complicated multistability behaviors.The coexistence of chaotic attractors with periodic orbits as well as the coexistence of two chaotic attractors in the 2D Duffing map are shown.We have introduced the Sine-Cosine chaotification technique to enhance chaos complexity in the multistable regions of the 2D Duffing map.The proposed chaotification technique can be easily generalized to other low-dimensional chaotic maps.Several performance evaluations includ-ing the trajectory, Lyapunov exponents, bifurcations, FIPS 140-2 test, and Sample entropy have demonstrated that the enhanced Duffing map exhibits a wide hyperchaotic range, high randomness and extreme unpredictability.Furthermore, its hyperchaotic sequences appear in a large area in the 2D phase space without exhibiting periodic behaviors.Consequently, the enhanced Duffing map could be a better choice than other existing chaotic maps for cryptography applications.Thus, we propose an image encryption algorithm, which achieves the confusion and diffusion processes by hyperchaotic sequences, elliptic curve, and S-box.Simulation results have revealed that the proposed encryption algorithm can give the users a flexibility to encrypt several kinds of images such as Grey scale, Medical, and RGB images with a higher level of security.As the proposed image encryption algorithm based on the enhanced Duffing map has high security and efficiency, our future work will investigate its application in video encryption.

Compliance with ethical standards
Conflict of interest All authors declare that they have no conflict of interest.
Ethical approval This article does not contain any studies with human participants or animals performed by any of the authors.
Informed Consent Not applicable.

Fig. 3 :Fig. 4 :
Fig. 3: Coexisting two attractors with the parameter β = 0.218, and under two sets of initial states in which the blue and red orbits are initiated from (0.25, 0.97) and (0.25, 0.77) respectively: (a) Bifurcation diagram with respect to the variable x 1 ; (b) Largest Lyapunov exponents.

1 Fig. 5 :
Fig.5: Equilibrium points of the enhanced Duffing map (3) and its stability when the parameters α = 2.75 and β = 0.2: 1) for A = 1 and B = 1, there is only one stable equilibrium point (green color); 2) for A = 2 and B = 3, there are three equilibria (red color) in which two stable and one unstable; 3) for A = 15 and B = 3.7, there are 25 equilibria (blue color) in which 15 stable and 10 unstable.

Fig. 12 :
Fig. 12: Schematic diagram of the proposed image encryption and decryption algorithm.

Fig. 13 :
Fig. 13: Encryption results of different images: the first column depicts the plain-images including animal sketch image, hand writing image, Lena grey-scale image, medical image, animal color image, Barbara color image; the second column depicts histograms of the plain-images; the third column depicts the encryption of the plain-images; the fourth column depicts histograms of the encrypted images.

Fig. 14 :
Fig. 14: Robustness analysis of noise and data loss: (a) and (d) depict the encrypted image with 5% Gaussian noise, and the decrypted image respectively; (b) and (e) depict the encrypted image with 12% salt and pepper noise, and the corresponding decrypted image respectively; (c) and (f) depict the encrypted image with 15% data loss, and the decrypted image respectively.

Fig. 15 :
Fig. 15: The correlation of the neighboring pixel pairs: the first column depicts the plain-image and the corresponding encrypted image; the second column depicts the horizontal direction of plain-image and the encrypted image; the third column depicts the vertical direction of the plain-image and the encrypted image; the fourth column depicts the diagonal direction of the plain-image and the encrypted image.

Fig. 16 :
Fig. 16: Key sensitivity analysis: (a) plain-image, (b) the encrypted image, (c) the decrypted image with the right key.Subplots (d)-(f) are the decrypted images with wrong keys.They are obtained due to a slight change in both the parameters and the initial conditions [subplot (d)], in the parameters only [subplot (e)], in the initial condition only [subplot (f)].

Table 2 :
Randomness analysis test with FIPS-140-2 results of sequences x and y generated by the map 3.

Table 3 :
The NPCR and UACI values are calculated with α = 0.05 for different images using some existing schemes and our scheme.

Table 7 lists
Local Shannon entropy results of the encrypted image.The results demonstrate that the proposed algorithm successfully pass the test.

Table 4 :
MSE and PSNR analysis of plain image and decrypted image in which cipher image is introduced withGassian Noise with different level of density 1%, 5% and 12%.

Table 5 :
The encrypted and decrypted NPCR and UACI values for different image sizes are shown due to a small change in the parameters and/or initial condition.

Table 6 :
The correlation coefficients of the plain-image and the encrypted image by various methods.

Table 7 :
The local Shannon entropy analysis with α = 0.001 k = 30, T B = 1936 of images which are collected from USC-SIPI Miscellaneous data-set

Table 8 :
Randomness test of s-box and Encrypted image

Table 9 :
The computational complexity and the time complexity using different algorithms