Abstract

In this paper, we propose a fusion technique for image encryption combining two maps and generate a new optimized map by fusing Hartley and Duffing chaotic oscillators. In order to measure and quantify the amount of chaos present in data sequences, the resultant map is tested by a new method of nonlinear time series analysis. This test ensures its robustness during its use to construct an encrypted image when combined with some mathematical function that we have designed. The cryptosystem was tested on images such as Lena, Barbara, Mandrill, and Man. The results were compared to those in the literature and proved satisfactory.

1. Introduction

The need to preserve privacy and confidentiality in communications has triggered the rapid development of cryptographic techniques. This has spurred an intense research activity in the field of cryptography. Thanks to their excellent properties of unpredictability, ergodicity, and sensitivity to their parameters and initial values, chaotic maps are good candidates for encryption algorithms. Over the years, many generators of chaos have been used in cryptosystems. However, robustness is still a major challenge in chaos-based cryptosystems. This is shown through the important number of attacked and broken cryptosystems [114]. Security defects in cryptosystems are from different origins. Remarkable flaw is the insufficient robustness of chaotic maps used in some encryption algorithms. Indeed, in some chaos-based encryption systems, the link between the control parameters and the secret key is not carefully established. This is because of disappearance of chaos in some portions of the map used, culminating in reduction of the entropy level in the encrypted image and consequently vulnerability of the system to attacks. Those shortcomings were studied by Huang and Guan [5] and Pareek et al. [6]. Another flaw is the fact that eavesdropper can estimate the control parameters from a chaotic orbit and finally, through this, break the cryptosystem. The work by Skrobek [7] presents the methodology to do that. Several encryption algorithms perform transformation from original to encrypted image by many rounds. For each round, the chaotic map is iterated k times. Then, they use the number of rounds and k as part of the key. Such cryptosystems can be broken through a timing attack which analyzes the encryption/decryption time. An illustration is given in the paper of Pisarchik et al. [8] which was cryptanalyzed by Arroyo and al. [9].

The cryptosystems, in which the transformation from plaintext to ciphertext roughly corresponds to a mapping that depends only on the key, have been found to succumb to known and/or chosen plaintext attacks. For example, the two cryptosystems developed by Patidar et al. [12] have been broken, using different approaches, by Rhouma et al. [2] and Li et al. [4]. Another example is the algorithm of Guan et al. [10] that has been cryptanalyzed by Çokal and Solak [11].

Insufficient key space has also in the past accounted for a number of cryptosystems being broken. However, this flaw is rather rare these last years, especially with the optimization of one-dimensional (1D) chaotic generators for digital image encryption. This is justified by their ease of implementation, their discretized forms, and their flexibility when it comes to optimizing them [15, 16]. To solve this problem and improve the chaotic maps, many researchers claim that high dimensional (HD) digital chaotic maps have better security and mixing method permits the extension of the period length of chaotic systems in order to get closer to robust chaos. In addition, the absence of periodic windows and coexisting attractors in some neighborhood of the parameter space means the improvement of the dynamic degradation.

In this paper, we develop a new cryptosystem that covers some of the security flaws enumerated above. Our cryptosystem is based on a chaotic map derived from the fusion of samples from time series data from Hartley and Duffing chaotic oscillators, coupled with mathematical transformation function. One of the main contributions in this work is the production of a new chaotic map resulting from the piecewise linearity introduced in the variables of Hartley’s oscillator, but this oscillator was also merged with another one in order to produce chaotic and quite robust data maps.

In our generated sequences, we have chosen a new technique to quantify the quality of the chaos. A comparative study was conducted on several traditional techniques such as MLE, Shannon entropy, and permutation entropy [1724], but this study revealed that they were all time consuming and therefore less suitable for real-time systems [25]. A new algorithm was developed, the PLSE (permutation large slope entropy).

This technique has the advantage of being more appropriate for experimental data, for continuous time systems, and for the analysis of data coming from systems without a well-defined mathematical model in order to quantify the chaos. Another contribution is the modeling of an encryption function whose complexity is based on the principle of affine cryptography. This function uses an external key alpha which is added to the initial conditions of the chaotic oscillators to build the main secret key. The cryptosystem has the following advantages:(i)Firstly, the chaos generated is robust.(ii)Secondly, even if the attacker succeeds to correctly estimate the parameters and recovers a map, he cannot get the exact map which was actually used for encryption because it has been truncated, and it is therefore difficult for the attacker to know which part has been cut.(iii)Thirdly, in the proposed algorithm, only one round is necessary for encryption, and therefore there is no way of breaking the scheme based on time analysis.(iv)Fourthly, the transformation from plaintext to ciphertext is not a simple mapping function dependent on the initial conditions only. Therefore, as will be seen in the security analysis section, neither the plaintext nor the ciphertext attack can break the proposed cryptosystem.(v)Finally, the key space is large enough to resist all forms of brute attack.

The paper is organized as follows. Section 2 presents the chaotic map generation followed by the encryption algorithm. In Section 3, results and performance of the algorithm are given. Section 4 deals with the cryptanalysis of the system. In Section 5, the proposed cryptosystem is compared to some recent ones. The paper is concluded in Section 6.

2. Chaotic Maps and Encryption Algorithm

2.1. Chaotic Maps

This section presents the two chaotic seed maps. These are Duffing and Hartley maps. They are combined to generate the final map as will be described later. The set of equations (6)–(8) describes the Hartley oscillator while the set of equations (11) governs the Duffing oscillator.

2.1.1. Hartley Oscillator

The circuit of the Hartley oscillator is given in Figure 1. Applying Kirchhoff laws (KL), we obtained the following system of equations:

Let us model the BJT by the following systems:where is the threshold voltage and RON is the small-signal on-resistance of the base-emitter junction; can also be written from the circuit in Figure 1 as

Let us use the following dimensionless variables and (4) to build the nonlinear functions F and and transform systems (1)–(3). We obtain (6)–(8).

The following values were used for systems (1) and (8):

2.1.2. Duffing Oscillator

The Duffing oscillator is one of the nonautonomous equations (10) that produces nonlinear dynamics, leading to the presence of chaos when it is well calibrated [26]. It can be transformed into an autonomous 3D system by introducing a new state variable z=t. The new 3D system is given in (11).

The following parameters have been selected in order to simulate chaotic behavior:

The sets of equations for each of the two oscillators were numerically solved using Runge–Kutta algorithm with a step Δt = 0.01. Figure 1 displays phase portraits yielded for each oscillator in the chaotic mode.

We can see from Figures 2(a) and 2(b) that each oscillator’s phase portrait is a strange attractor.

This, however, does not automatically mean that these oscillators are chaotic. To prove the chaotic nature of these oscillators, Lyapunov analysis was carried out for each of them. In Figures 3(a) and 3(b), the dynamics of Lyapunov exponents are displayed. The computation of the Lyapunov exponents of Hartley system gives us a positive exponent by changing in Figure 1 the voltage value at the Emitter from 3.75 V to 2.75 V. LE1 = 0.0585 > 0, and the other two are negative LE2 = −0.8709 < 0 and LE3 = −2.8722 < 0, which proves that the system is chaotic. The bifurcation diagram in Figure 4 also proves this. By setting the parameters L1 and C, the control parameter is the resistance Rc. This resistance is associated with the control parameter a in (8). Thus, Rc can be chosen between the values 10.5 and 170.5 ohm and the parameter a between 0.39 and 6.742.

Lyapunov exponents represent the average exponential rates of divergence or convergence of nearby orbits in the phase space. Chaotic systems exhibit exponential orbital divergence. This is manifested by the fact that small differences in initial conditions which we may not be able to resolve get magnified rapidly leading to loss of predictability. Figure 3 displays the dynamics of Lyapunov exponents for Hartley and Duffing oscillators used with initial conditions x10, y10, z10 = (0.2, 0.5, 0.5) and x20, y20, z20 = (0, 1, 1), respectively. By solving the two systems using 4th order Runge–Kutta technique with step 0.01, three series of values, LE1, LE2, and LE3, were obtained and plotted for each of the oscillators. For each oscillator, one series is positive, the second one nil, and the third one negative. These prove the chaotic nature of the oscillators [17].

2.2. Encryption Algorithm

The encryption algorithm has two steps. The first consists in combining the two original chaotic maps to generate a third one which is used in the encrypting function. The second step is the implementation of the mathematical encrypting function.

2.2.1. Fusion Technique and New Chaotic Map

Let (x1, y1, z1) be the state variables of the first oscillator while (x2, y2, z2) are those of the second oscillator. Each iteration i generates sets of state variables (x1i, y1i, z1i) and (x2i, y2i, z2i). Let m × n be the size of the image to be encrypted. After a given number of iterations, the resultant map can be obtained as follows:while for i = 1 to m for j = 1 to nKij = mod (x1u + y1u + z1u + x2u, 1) EndEndu = u + 1End = Trunc (Kij)

The truncation function represents the way that data mask can be extracted from the data obtained by merging the two oscillators. The notion of periodicity is lost when the combination of two chaotic maps extends the cycle length of the chaotic orbit and improves the chaotic behavior of the pseudorandom generator. For the new map obtained, we choose the variables that have more nonlinearity in their state equations and therefore provide high probability of more random data to merge. In order to preserve the parameter estimation and be sure that the orbit of the new system is bounded, we take values from the established mathematical equations and combine them, emphasizing the unpredictable side of the newly calculated data with the modulo operator at the output. Ku represents the chaotic map when we merge the oscillators. You can see the phase portrait in Figure 5.

2.2.2. Chaotic Nature of the Resultant Map

The resultant map is a truncated fusion of two chaotic maps. However, this resultant map may not automatically be chaotic. The goal of this section is to prove that it is chaotic.

In order to prove that a map is chaotic, a number of techniques such as 0-1 test [18, 19], 3ST test [27], and permutation entropy (PE) [21, 22] can be used. They help to distinguish the regularity or irregularity of the map and also measure the complexity of the finite data sequence coming from system, in order to make sure that the latter is chaotic. To characterize data, all the above-mentioned techniques are directly applied to the time series. This permits the detection of the chaotic nature of the corresponding dynamics thanks to either its chaos indicator or the entropy. The entropy is a metric to characterize the complexity of time series and helps to distinguish between regular (periodic, for example), random, and chaotic signals and to quantify their complexity. Most of prementioned tests have been successfully applied to continuous time systems [18, 23] and discrete time systems [20]. Furthermore, they are robust in presence of noise and require neither phase space reconstruction nor modeling equations of the underlying system. However, some of them are time consuming and cannot be used for real-time implementation [24]. Recently, a new test proposed by Eyebe Fouda et al. [25] was used efficiently with interesting results. Its principle is described below and then used to test our data series.

2.2.3. Description of the Permutation Largest Slope Entropy (PLSE) Test Method

Let {Xt}t=1,…,T be a time series of length T, where t is the time index. The permutation entropy (PE) of order n is defined as a measure of the probabilities of permutations of order n. Permutations of order n are obtained from the comparison of neighboring values (increasing order) in embedding vectors Xt = (Xt+1, Xt+1+τ, …, Xt+1+(n−1)τ), where n is the number of values of Xt and τ the distance between two values in Xt. Assuming that the permutation Pt of order n derived from Xt is a piecewise linear function, we consider the slope of each linear function as the difference between pairs of neighboring values in Pt as follows:

We thus defined the largest slope of Pt as St = max − (Si) as the maximum value of {Si}. It has been shown that L = limn⟶∞ |St| for regular dynamics and that L-periodic dynamics are characterized by a single value of largest slope if the embedding dimension n is such that L < n [20]. As a result, the entropy related to the distribution of the largest slopes may be equal to zero in the case of regular dynamics. The normalized permutation largest slope entropy (PLSE) of order n ≥ 2 iswherewhere p (s) is the probability of S and Nb denotes the number of slopes apparition. For regular dynamics, hs (n) = 0 with period L < n, and for irregular dynamics, 0 < hs ≤ 1. Indeed, regular dynamics are characterized by a single value of largest slope St = S, for all t and hs = 0 as p (S) = 1; for irregular dynamics, St takes different values.

2.2.4. Application of PLSE Test

The algorithm of PLSE is applied to the resultant map, and only the maximal value of the corresponding entropies is retained. Choosing τ > 1 allows reducing detection errors due to small values of embedding dimensions n while 1 < t0 < n allows considering smaller observation time T for detection purposes. Moreover, choosing 1 < t0 < n speeds up the scanning time of the time series under study [23]. Three sequences of data were tested depending on control parameter B in the Duffing oscillator. The following parameters were used.

For the PLSE test (Figure 6),

2.3. Transformation Function
2.3.1. Theory

Given a plain image Oij of size m × n and a chaotic map Xij, apply the following equation; the mathematical transformation function is implemented by the following equation to obtain the ciphered image Tij.where SHA256 is the hash algorithm in order to scramble image deterministically. Tij is encrypted image and α a parameter.

2.3.2. Pseudocode of the Encryption Process
(1)Load the plain image Oij of size n × m.(2)Choose six values which represent the initial conditions for the two chaotic systems.(3)Choose the unsigned parameter α = 0.05. For a good choice of α, 0 < α < 0.8.(4)Create a 1D signal of chaotic sequences {Xt}t=1,…,L by modular addition of the two chaotic maps which are solutions of (8) and (11) as follows.(5)Use PLSE Test in the resultant vector Xt and select the chaotic map with the maximum value of the entropy.(6)Use mathematical transformation described in Section 2.3.1 to process the plain image Oij using as chaotic map to obtain encrypted image Tij.

3. Results and Performances of the Cryptosystem

3.1. Test Images

In this section, we present results yielded by our cryptosystem and analyze them. Four images (Figure 7) were used to test our algorithm. The statistical properties of the plaintext images are summarized in Table 1. Two images of this testing set were of gray-level type while the other two were color ones. They were of size m × n with m ≠ n for one of them and m = n for the rest. This permits us to test the various combinations.

3.2. Cipher Evaluation

Visual examples of plain, encrypted, and decrypted images are given in Figure 8.

Brute force attack, speed, histogram, correlation, key space, and key sensitivity analyses were also carried out for the proposed cryptosystem. With a laptop equipped with a 2.0 GHz Core Duo and 2Go DDR, we had encryption times of 1.2 seconds for a resolution Lena image, 1.2 seconds for a resolution Barbara image, 1 second for a resolution Mandrill image, and 3 seconds for a 1024 × 1024 resolution Man image.

3.2.1. Key Space Analysis

The secret key of the proposed cryptosystem contains 7 real numbers (6 initial conditions and many parameters). By considering only the initial conditions of the two oscillator models, let us use real data type to attenuate effect caused by discretization. In the event of using a programming language compatible with IEEE Standard 754-2008 [21], it is necessary to use the double data type, which stores real numbers on 8 bytes (64 bits), with an accuracy of 15 decimal positions. In this case, the secret key length will be 448 bits (7 numbers × 64 bits). This means that the size of the secret key space will be equal to , which is sufficiently large to resist all kinds of known brute force attack.

3.2.2. Histogram Analysis

Histogram analysis refers to quality of the frequency distribution of pixels in an image. When the grayscale frequencies in the ciphered image are approximately in the same level, this will result in a flat histogram and excellent resistance to statistical analysis attacks. As illustrated in Figure 9, the three histograms of the ciphered images are almost flat.

We can notice that, contrary to those of plain images that clearly exhibit some modes, histograms of ciphered images are roughly flat which is a good indication for a cipher. As for the correlation analysis, Figure 10 displays results yielded by the proposed cryptosystem.

3.3. Further Analyses

A number of common metrics such as image entropy (19), number of pixel change rate ((20) and (21)), unified average changing intensity (22), and variance of histogram (23) were computed to evaluate the proposed system.wherewhere is the vector of the histogram values. , with and being the numbers of pixels whose gray values are equal to and , respectively. The results are summarized in Tables 2 and 3.

The average value of NPCR which is 99.464 falls into the bracket of what the literature presents. That of UACI is 33.8, a bit higher than 33.3 which is the average value in the literature. The observation of Table 3 shows that, from plain to ciphered images, there is a ratio of 103 as concerns the values of variances of histograms.

3.3.1. Key Sensitivity Analysis

The security of a cryptosystem is clearly related to the sensitivity of the key. Thus, for a chaos-based encryption algorithm, the smallest difference in the key or in the plaintext image leads to a failure to decrypt the encrypted image. To test the sensitivity to the encryption key, we encrypt the color and grayscale images “Lena (512 × 512),” “Barbara (512 × 512),” and “Man (1024 × 1024)” with the key x10 = 0.12345678919876; then, this key will be slightly modified and used for decryption. Figure 11 clearly shows that the image encrypted by the x10 is not correctly decrypted by using the key x10 + 10−15. Accordingly, it can be concluded that the proposed scheme is very sensitive to the key.

3.3.2. Pixels’ Resemblance Analysis

The pixels’ resemblance reveals the similarity between different digital contents [28]. The quality of the encrypted image compared to the original image can be measured using mathematical tools such as PSNR (Peak Signal Low Noise Ratio between images) and SSIM (Structured Similarity Index Measure). The most widely used classical metric for objectively estimating the distortion between two images is the PSNR which is considered to be a reliable indicative measure. To calculate PSNR (25), first we have to calculate the MSE using the following expression:where Pij and Cij refer to the pixels’ position at ith row and jth column of plain and ciphered images distinctly. MSE is the mean square error.where R2, R is the maximum fluctuation in the input image data type.

The higher the PSNR, the better the quality of compressed or reconstructed image. If the input image has double-precision floating point data type, the R is 1; if it has 8 bit unsigned integer data type, R is 255 etc. PSNR and MSE are used to compare image compression quality.

SSIM determines the structural similarity of images in order to be closer to visual perception than the PSNR is and is used to compare contrast of plain and enciphered contents too. For plain and ciphered images Pij and Cij with mean values μp, μc and the standard deviation σpc, the SSIM (26) has values between 0 and 1. If the value is close to 1, there will be more resemblance between plain and ciphered contents; if the value approaches 0, there will be dissimilarity between contents. Pixels’ resemblance analysis of proposed approach is given in Table 4.

4. Cryptanalysis of the System

As far as the security analysis is concerned, the cryptosystem was submitted to the CPA (Chosen-Plaintext Attack). In this attack, we have an adversary model in which an eavesdropper is presumed to have the ability to encrypt a plain image to obtain its corresponding cipher but does not have the secret key. The eavesdropper has access to the encryption mechanism or process and encrypts a neutral image, in the hope of discovering the secret key. According to [26], it can be summarized by the following equation:where is the decrypted image, is its cipher, is the eavesdropper’s encrypted image obtained from an extreme plaintext, “” is the machinery, and Map is the presumed key. Two test images were used, and the results obtained are shown in Figure 12. We note that the eavesdropper does not reveal any keys or patterns in the plain image.

5. Comparison with Other Cryptosystems

Not all published cryptosystems present an extensive evaluation of the system. Our system was compared to recent papers in the literature based on performances with a common image which is Lena. Results are displayed in Table 5.

We can see from the table that one first advantage of the proposed system is the fact that one round is enough to encrypt an image. This also means a short encryption time and therefore possibility of real-time encryption. Furthermore, the key space of our cryptosystem and that of Choi et al. [27] are the largest. We can also notice from Table 5 that the average UACI, NPCR, and entropy yielded by the proposed scheme are among the best. Finally, its NPCR and entropy are among the best in literature.

6. Conclusion

In this work, we have suggested a chaos-based cryptosystem. A new data chaotic map has been built by combining two oscillators. To do this, we first introduce continuous functions in the dynamics of the Hartley oscillator; then, by modular addition, we perform a fusion with the Duffing oscillator. The robustness of the resulting data chaotic maps is evaluated by the PLSE algorithm. Furthermore, the resulting chaotic map is combined with a new iterative mathematical transformation function we have proposed to encrypt images.

The encryption and decryption process are tested on 4 very popular images and evaluated using very common metrics such as NPCR, UACI, SSIM, PSNR, and variance of histograms. The system was further analyzed in terms of speed, correlation, and attacks. Results obtained were compared to very recent systems in the literature and proved to be of equal or better quality. We aim to carry out the experimental setup in future work.

Data Availability

The images used in this paper to support our results were Lena, Mandrill, and Barbara. These can be found via the following links: https://www.programmersought.com/article/40272792839/ for Lena image; http://www.hlevkin.com/TestImages/baboon.bmp for Mandrill image; https://homepages.cae.wisc.edu/∼ece533/images/Barbara.png for Barbara image. Mandrill image can also be found in Matlab database. More generally, images for testing encryption algorithm can be found at https://homepages.cae.wisc.edu/∼ece533/images/.

Conflicts of Interest

The authors declare that they have no conflicts of interest.