# Image Encryption with Fusion of Two Maps

Authors: Yannick Abanda; Alain Tiedeu; Guillaume Kom
Journal: Security and Communication Networks
 (2021)

---

## 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.


---

## Body

## 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 [1–14]. 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 [17–24], 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. Section2 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 Figure1. Applying Kirchhoff laws (KL), we obtained the following system of equations:(1)CdVcdt=I1−I2−VCRC,L1dVI1dt=V1−VEC−VC−I1RL1,L2dI2dt=Vc−I2RL2−I2−IBRL.Figure 1
Circuit of Hartley oscillator used.Let us model the BJT by the following systems:(2)IB=−VEB−VTHRON,VEB>VTH,0,VEB≤VTH,(3)VEC=VEC0,VEB>VTH,VTH−VEBk,VEB≤VTH,where VTH is the threshold voltage and RON is the small-signal on-resistance of the base-emitter junction; VEB can also be written from the circuit in Figure 1 as(4)VEB=V1−I2−IBRL.Let us use the following dimensionless variables and (4) to build the nonlinear functions F and F∗ and transform systems (1)–(3). We obtain (6)–(8).(5)gam=RL+R0NR0N,alpha=RLR0N,a=rauRC,rau=L1C,τ=L1C,x1=VCV1,y1=rau×I1V1,z1=rau×I2V1,t=tτ,s=VEC0VTH,q=V1VTH,f=L1×RLL2×VTH,b=RL1rau,d=L1L2,e=τRL+RL2L2,g=VTH−V1R0N×gam,h=VTH−V1gam×R0N−RL×kR0N×gam,m=RL×VTH×kgam−alphagam×rau,a1=alpha×VTHgam×rau,lamda=gam×rauRL×alphagam+V1gam×VTH−1,(6)Fz1=−1VTHh+m×z1,z1≥lamda,s,z1<lamda,(7)F∗z1=0,z1≥lamda,fg+a1z1,z1<lamda,(8)x˙1=y1−z1−ax1,y˙1=q−x1−by1−Fz1,z˙1=dx1−ez1+F∗z1.The following values were used for systems (1) and (8):(9)RC=95.5Ω,RL1=1.5Ω,RL=78Ω,R0N=100Ω,RL1=1.5Ω,VTH=0.75V,C=22nF,L1=100μH,L2=100μH,VEC0=0.2V,alpha=0.76,gam=2.3158,rau=67.42,k=900,a=0.706,a1=0.0037,alpha=0.76,b=0.0222,d=1,e=1.1495,101.3333,g=−0.013,h=−1.8139×10−3,lamda=3.0554m=511.1878,q=5,s=0.2667.


#### 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).(10)x¨+εx˙+bx3=Bcosωt,(11)x˙=y;y˙=−εy−bx3+Bcosωz;z˙=z.The following parameters have been selected in order to simulate chaotic behavior:(12)ε=0.1,b=0.25,B=400,ω=0.8.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 Figures2(a) and 2(b) that each oscillator’s phase portrait is a strange attractor.Figure 2
2D numerical phase portraits inX-Y plane of Hartley (a) and Duffing (b) oscillators with initial conditions (0.2, 0.5, 0.5) and (0, 1, 1), respectively.
(a)(b)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 Figures3(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 V1 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.Figure 3
Dynamics of Lyapunov exponents for (a) Hartley oscillator and (b) Duffing oscillator.
(a)(b)Figure 4
Bifurcation diagram of Hartley oscillator:x1, y1, z1 versus Rc.
(a)(b)(c)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. Figure3 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 Kij′ can be obtained as follows:whileu≤m∗nfori = 1 to mforj = 1 to nKij = mod (x1u + y1u + z1u + x2u, 1)EndEndu = u + 1EndKij′ = 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 Figure5.Figure 5
Phase portrait of Ku versusX1, X2, X3,Z2.
(a)(b)(c)(d)


#### 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:(13)si=Pti+1−Pti,1≤i≤n−1.We thus defined the largest slope ofPt 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 is(14)hsn=−1lnn−1∑pslnps,where(15)ps=Nbt|t≤T−n,St=ST−N+1,where 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 (Figure6),(16)t0=1,τ=1,T=10000,n=20,x10,y10,z10=0.2,0.5,0.5,x20,y20,z20=0,1,1,sequence1:=580,Hs=0.3944,sequence2:B=400,sequence3:Hs=0.4892,Hs=0.7601.Figure 6
Flowchart of the PLSE test.


### 2.3. Transformation Function

#### 2.3.1. Theory

Given a plain imageOij 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.(17)Tijn+1=roundα×255×Oij+round1−αXij×1016mod256mod256⊕SHA256Tijn,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 imageOij 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 vectorXt and select the chaotic map with the maximum value of the entropy.(6)
Use mathematical transformation described in Section2.3.1 to process the plain image Oij using Kij′ as chaotic map to obtain encrypted image Tij.(18)Tij1=roundα×255×O1,1+round1−αK1,1′×1016mod256mod256⊕SHA256Tij0,Tijn+1=roundα×255×Oij+round1−αKij′×1016mod256mod256⊕Tijn.


## 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 Figure1. Applying Kirchhoff laws (KL), we obtained the following system of equations:(1)CdVcdt=I1−I2−VCRC,L1dVI1dt=V1−VEC−VC−I1RL1,L2dI2dt=Vc−I2RL2−I2−IBRL.Figure 1
Circuit of Hartley oscillator used.Let us model the BJT by the following systems:(2)IB=−VEB−VTHRON,VEB>VTH,0,VEB≤VTH,(3)VEC=VEC0,VEB>VTH,VTH−VEBk,VEB≤VTH,where VTH is the threshold voltage and RON is the small-signal on-resistance of the base-emitter junction; VEB can also be written from the circuit in Figure 1 as(4)VEB=V1−I2−IBRL.Let us use the following dimensionless variables and (4) to build the nonlinear functions F and F∗ and transform systems (1)–(3). We obtain (6)–(8).(5)gam=RL+R0NR0N,alpha=RLR0N,a=rauRC,rau=L1C,τ=L1C,x1=VCV1,y1=rau×I1V1,z1=rau×I2V1,t=tτ,s=VEC0VTH,q=V1VTH,f=L1×RLL2×VTH,b=RL1rau,d=L1L2,e=τRL+RL2L2,g=VTH−V1R0N×gam,h=VTH−V1gam×R0N−RL×kR0N×gam,m=RL×VTH×kgam−alphagam×rau,a1=alpha×VTHgam×rau,lamda=gam×rauRL×alphagam+V1gam×VTH−1,(6)Fz1=−1VTHh+m×z1,z1≥lamda,s,z1<lamda,(7)F∗z1=0,z1≥lamda,fg+a1z1,z1<lamda,(8)x˙1=y1−z1−ax1,y˙1=q−x1−by1−Fz1,z˙1=dx1−ez1+F∗z1.The following values were used for systems (1) and (8):(9)RC=95.5Ω,RL1=1.5Ω,RL=78Ω,R0N=100Ω,RL1=1.5Ω,VTH=0.75V,C=22nF,L1=100μH,L2=100μH,VEC0=0.2V,alpha=0.76,gam=2.3158,rau=67.42,k=900,a=0.706,a1=0.0037,alpha=0.76,b=0.0222,d=1,e=1.1495,101.3333,g=−0.013,h=−1.8139×10−3,lamda=3.0554m=511.1878,q=5,s=0.2667.


### 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).(10)x¨+εx˙+bx3=Bcosωt,(11)x˙=y;y˙=−εy−bx3+Bcosωz;z˙=z.The following parameters have been selected in order to simulate chaotic behavior:(12)ε=0.1,b=0.25,B=400,ω=0.8.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 Figures2(a) and 2(b) that each oscillator’s phase portrait is a strange attractor.Figure 2
2D numerical phase portraits inX-Y plane of Hartley (a) and Duffing (b) oscillators with initial conditions (0.2, 0.5, 0.5) and (0, 1, 1), respectively.
(a)(b)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 Figures3(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 V1 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.Figure 3
Dynamics of Lyapunov exponents for (a) Hartley oscillator and (b) Duffing oscillator.
(a)(b)Figure 4
Bifurcation diagram of Hartley oscillator:x1, y1, z1 versus Rc.
(a)(b)(c)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. Figure3 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.1.1. Hartley Oscillator

The circuit of the Hartley oscillator is given in Figure1. Applying Kirchhoff laws (KL), we obtained the following system of equations:(1)CdVcdt=I1−I2−VCRC,L1dVI1dt=V1−VEC−VC−I1RL1,L2dI2dt=Vc−I2RL2−I2−IBRL.Figure 1
Circuit of Hartley oscillator used.Let us model the BJT by the following systems:(2)IB=−VEB−VTHRON,VEB>VTH,0,VEB≤VTH,(3)VEC=VEC0,VEB>VTH,VTH−VEBk,VEB≤VTH,where VTH is the threshold voltage and RON is the small-signal on-resistance of the base-emitter junction; VEB can also be written from the circuit in Figure 1 as(4)VEB=V1−I2−IBRL.Let us use the following dimensionless variables and (4) to build the nonlinear functions F and F∗ and transform systems (1)–(3). We obtain (6)–(8).(5)gam=RL+R0NR0N,alpha=RLR0N,a=rauRC,rau=L1C,τ=L1C,x1=VCV1,y1=rau×I1V1,z1=rau×I2V1,t=tτ,s=VEC0VTH,q=V1VTH,f=L1×RLL2×VTH,b=RL1rau,d=L1L2,e=τRL+RL2L2,g=VTH−V1R0N×gam,h=VTH−V1gam×R0N−RL×kR0N×gam,m=RL×VTH×kgam−alphagam×rau,a1=alpha×VTHgam×rau,lamda=gam×rauRL×alphagam+V1gam×VTH−1,(6)Fz1=−1VTHh+m×z1,z1≥lamda,s,z1<lamda,(7)F∗z1=0,z1≥lamda,fg+a1z1,z1<lamda,(8)x˙1=y1−z1−ax1,y˙1=q−x1−by1−Fz1,z˙1=dx1−ez1+F∗z1.The following values were used for systems (1) and (8):(9)RC=95.5Ω,RL1=1.5Ω,RL=78Ω,R0N=100Ω,RL1=1.5Ω,VTH=0.75V,C=22nF,L1=100μH,L2=100μH,VEC0=0.2V,alpha=0.76,gam=2.3158,rau=67.42,k=900,a=0.706,a1=0.0037,alpha=0.76,b=0.0222,d=1,e=1.1495,101.3333,g=−0.013,h=−1.8139×10−3,lamda=3.0554m=511.1878,q=5,s=0.2667.


## 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).(10)x¨+εx˙+bx3=Bcosωt,(11)x˙=y;y˙=−εy−bx3+Bcosωz;z˙=z.The following parameters have been selected in order to simulate chaotic behavior:(12)ε=0.1,b=0.25,B=400,ω=0.8.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 Figures2(a) and 2(b) that each oscillator’s phase portrait is a strange attractor.Figure 2
2D numerical phase portraits inX-Y plane of Hartley (a) and Duffing (b) oscillators with initial conditions (0.2, 0.5, 0.5) and (0, 1, 1), respectively.
(a)(b)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 Figures3(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 V1 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.Figure 3
Dynamics of Lyapunov exponents for (a) Hartley oscillator and (b) Duffing oscillator.
(a)(b)Figure 4
Bifurcation diagram of Hartley oscillator:x1, y1, z1 versus Rc.
(a)(b)(c)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. Figure3 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 Kij′ can be obtained as follows:whileu≤m∗nfori = 1 to mforj = 1 to nKij = mod (x1u + y1u + z1u + x2u, 1)EndEndu = u + 1EndKij′ = 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 Figure5.Figure 5
Phase portrait of Ku versusX1, X2, X3,Z2.
(a)(b)(c)(d)


### 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:(13)si=Pti+1−Pti,1≤i≤n−1.We thus defined the largest slope ofPt 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 is(14)hsn=−1lnn−1∑pslnps,where(15)ps=Nbt|t≤T−n,St=ST−N+1,where 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 (Figure6),(16)t0=1,τ=1,T=10000,n=20,x10,y10,z10=0.2,0.5,0.5,x20,y20,z20=0,1,1,sequence1:=580,Hs=0.3944,sequence2:B=400,sequence3:Hs=0.4892,Hs=0.7601.Figure 6
Flowchart of the PLSE test.


## 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 Kij′ can be obtained as follows:whileu≤m∗nfori = 1 to mforj = 1 to nKij = mod (x1u + y1u + z1u + x2u, 1)EndEndu = u + 1EndKij′ = 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 Figure5.Figure 5
Phase portrait of Ku versusX1, X2, X3,Z2.
(a)(b)(c)(d)


## 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:(13)si=Pti+1−Pti,1≤i≤n−1.We thus defined the largest slope ofPt 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 is(14)hsn=−1lnn−1∑pslnps,where(15)ps=Nbt|t≤T−n,St=ST−N+1,where 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 (Figure6),(16)t0=1,τ=1,T=10000,n=20,x10,y10,z10=0.2,0.5,0.5,x20,y20,z20=0,1,1,sequence1:=580,Hs=0.3944,sequence2:B=400,sequence3:Hs=0.4892,Hs=0.7601.Figure 6
Flowchart of the PLSE test.


## 2.3. Transformation Function

### 2.3.1. Theory

Given a plain imageOij 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.(17)Tijn+1=roundα×255×Oij+round1−αXij×1016mod256mod256⊕SHA256Tijn,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 imageOij 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 vectorXt and select the chaotic map with the maximum value of the entropy.(6)
Use mathematical transformation described in Section2.3.1 to process the plain image Oij using Kij′ as chaotic map to obtain encrypted image Tij.(18)Tij1=roundα×255×O1,1+round1−αK1,1′×1016mod256mod256⊕SHA256Tij0,Tijn+1=roundα×255×Oij+round1−αKij′×1016mod256mod256⊕Tijn.


## 2.3.1. Theory

Given a plain imageOij 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.(17)Tijn+1=roundα×255×Oij+round1−αXij×1016mod256mod256⊕SHA256Tijn,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 imageOij 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 vectorXt and select the chaotic map with the maximum value of the entropy.(6)
Use mathematical transformation described in Section2.3.1 to process the plain image Oij using Kij′ as chaotic map to obtain encrypted image Tij.(18)Tij1=roundα×255×O1,1+round1−αK1,1′×1016mod256mod256⊕SHA256Tij0,Tijn+1=roundα×255×Oij+round1−αKij′×1016mod256mod256⊕Tijn.


## 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 (Figure7) 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.Figure 7
Test images: (a) Mandrill; (b) Barbara; (c) Lena; (d) Man.
(a)(b)(c)(d)Table 1
Statistical properties of plaintext images: HC: horizontal correlation; VC: vertical correlation; DC: diagonal correlation;H: entropy.
ImageSizeHCVCDCHLena512 × 5120.9720.9850.9597.45Mandrill480 × 5000.9330.9120.8667.21Barbara512 × 5120.9540.8920.8847.34Man1024 × 10240.98130.97740.96717.52


### 3.2. Cipher Evaluation

Visual examples of plain, encrypted, and decrypted images are given in Figure8.Figure 8
Visual examples: (a), (d), (g) (j) plain images; (b), (e), (h), (k) encrypted images; (c), (f), (i), (l) decrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)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 a512×512 resolution Lena image, 1.2 seconds for a 512×512 resolution Barbara image, 1 second for a 480×500 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 2448≈7.26×10134, 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 Figure9, the three histograms of the ciphered images are almost flat.Figure 9
Histograms: (a), (d), (g), (j) plain images of Barbara, Lena, Man, and Mandrill, respectively; (b), (e), (h), (k) encrypted images; (c), (f), (i), (j), (l) decrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)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, Figure10 displays results yielded by the proposed cryptosystem.Figure 10
Correlation between pixels’ pairs for Man image (a–c), Barbara image (g–i), Lena image (m–o), and Mandrill image (s–u). Horizontal, vertical, and diagonal direction correlation for plain images (d–f), (j–l), (p–r), and (v–x), respectively. Encrypted images of Man, Barbara, Lena, and Mandrill correlation in horizontal, vertical, and diagonal directions.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)


### 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.(19)H=∑i=12kpmilog2pmi,(20)NPCR=1MN∑i=1M∑j=1NDi,j,where(21)Di,j=0siImoi,j=Imci,j,1siImoi,j≠Imci,j,(22)UACI=100MN∑i=1M∑j=1NImoi,j−Imci,j255,(23)VarZ=1n2∑i=1n∑j=1n12zi−zj2,where Z is the vector of the histogram values. Z=z1,z2,…,z256, with zi and zj being the numbers of pixels whose gray values are equal to i and j, respectively. The results are summarized in Tables 2 and 3.Table 2
Values of common metrics.
LenaMandrillBarbaraManNPCR99.577199.471299.34699.5UACI35.08232.912333.40633.41H7.9967.9957.9977.999Table 3
Variances of histograms for plain and ciphered images from the proposed scheme.
ImagePlainCipheredMandrill6.13 × 1051049.5Lena1.018 × 106935.54Barbara7.32 × 105934.22Man1.139 × 1074535.3The 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 Table3 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 keyx10 = 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.Figure 11
Key sensitivity analysis: (a), (e), (i) plain images; (b), (f), (j) encrypted images byx10; (c), (g), (k) decrypted images by changing x10 by x10 + 10−15; (d), (h), (l) difference images between (b) and (c), (f) and (g), (j) and (k), respectively.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)


#### 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:(24)MSE=1MN∑iM∑jMPij−Cij2,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.(25)PSNR=10logR2MSE,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, theR 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 imagesPij 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.(26)SSIM=2μpμc+C12σpc+C2μp2+μc2+C1σp2+σC2+C2.Table 4
Pixels resemblance and pixels disparities analyses between plain encrypted images and their comparison with existing methods.
Reference [29]SSIM————PSNR——8.4865—MSE——5201.746—Reference [28]SSIM0.02308———PSNR9.2570———MSE4666.515———Plain encrypted disparitySSIM0.00700.00590.00690.0079PSNR5.71774.91595.48847.6769MSE17431209651833311102ImagesLenaBarbaraMandrillMan


## 3.1. Test Images

In this section, we present results yielded by our cryptosystem and analyze them. Four images (Figure7) 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.Figure 7
Test images: (a) Mandrill; (b) Barbara; (c) Lena; (d) Man.
(a)(b)(c)(d)Table 1
Statistical properties of plaintext images: HC: horizontal correlation; VC: vertical correlation; DC: diagonal correlation;H: entropy.
ImageSizeHCVCDCHLena512 × 5120.9720.9850.9597.45Mandrill480 × 5000.9330.9120.8667.21Barbara512 × 5120.9540.8920.8847.34Man1024 × 10240.98130.97740.96717.52


## 3.2. Cipher Evaluation

Visual examples of plain, encrypted, and decrypted images are given in Figure8.Figure 8
Visual examples: (a), (d), (g) (j) plain images; (b), (e), (h), (k) encrypted images; (c), (f), (i), (l) decrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)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 a512×512 resolution Lena image, 1.2 seconds for a 512×512 resolution Barbara image, 1 second for a 480×500 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 2448≈7.26×10134, 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 Figure9, the three histograms of the ciphered images are almost flat.Figure 9
Histograms: (a), (d), (g), (j) plain images of Barbara, Lena, Man, and Mandrill, respectively; (b), (e), (h), (k) encrypted images; (c), (f), (i), (j), (l) decrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)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, Figure10 displays results yielded by the proposed cryptosystem.Figure 10
Correlation between pixels’ pairs for Man image (a–c), Barbara image (g–i), Lena image (m–o), and Mandrill image (s–u). Horizontal, vertical, and diagonal direction correlation for plain images (d–f), (j–l), (p–r), and (v–x), respectively. Encrypted images of Man, Barbara, Lena, and Mandrill correlation in horizontal, vertical, and diagonal directions.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)


## 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 2448≈7.26×10134, 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 Figure9, the three histograms of the ciphered images are almost flat.Figure 9
Histograms: (a), (d), (g), (j) plain images of Barbara, Lena, Man, and Mandrill, respectively; (b), (e), (h), (k) encrypted images; (c), (f), (i), (j), (l) decrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)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, Figure10 displays results yielded by the proposed cryptosystem.Figure 10
Correlation between pixels’ pairs for Man image (a–c), Barbara image (g–i), Lena image (m–o), and Mandrill image (s–u). Horizontal, vertical, and diagonal direction correlation for plain images (d–f), (j–l), (p–r), and (v–x), respectively. Encrypted images of Man, Barbara, Lena, and Mandrill correlation in horizontal, vertical, and diagonal directions.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)


## 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.(19)H=∑i=12kpmilog2pmi,(20)NPCR=1MN∑i=1M∑j=1NDi,j,where(21)Di,j=0siImoi,j=Imci,j,1siImoi,j≠Imci,j,(22)UACI=100MN∑i=1M∑j=1NImoi,j−Imci,j255,(23)VarZ=1n2∑i=1n∑j=1n12zi−zj2,where Z is the vector of the histogram values. Z=z1,z2,…,z256, with zi and zj being the numbers of pixels whose gray values are equal to i and j, respectively. The results are summarized in Tables 2 and 3.Table 2
Values of common metrics.
LenaMandrillBarbaraManNPCR99.577199.471299.34699.5UACI35.08232.912333.40633.41H7.9967.9957.9977.999Table 3
Variances of histograms for plain and ciphered images from the proposed scheme.
ImagePlainCipheredMandrill6.13 × 1051049.5Lena1.018 × 106935.54Barbara7.32 × 105934.22Man1.139 × 1074535.3The 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 Table3 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 keyx10 = 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.Figure 11
Key sensitivity analysis: (a), (e), (i) plain images; (b), (f), (j) encrypted images byx10; (c), (g), (k) decrypted images by changing x10 by x10 + 10−15; (d), (h), (l) difference images between (b) and (c), (f) and (g), (j) and (k), respectively.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)


### 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:(24)MSE=1MN∑iM∑jMPij−Cij2,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.(25)PSNR=10logR2MSE,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, theR 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 imagesPij 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.(26)SSIM=2μpμc+C12σpc+C2μp2+μc2+C1σp2+σC2+C2.Table 4
Pixels resemblance and pixels disparities analyses between plain encrypted images and their comparison with existing methods.
Reference [29]SSIM————PSNR——8.4865—MSE——5201.746—Reference [28]SSIM0.02308———PSNR9.2570———MSE4666.515———Plain encrypted disparitySSIM0.00700.00590.00690.0079PSNR5.71774.91595.48847.6769MSE17431209651833311102ImagesLenaBarbaraMandrillMan


## 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 keyx10 = 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.Figure 11
Key sensitivity analysis: (a), (e), (i) plain images; (b), (f), (j) encrypted images byx10; (c), (g), (k) decrypted images by changing x10 by x10 + 10−15; (d), (h), (l) difference images between (b) and (c), (f) and (g), (j) and (k), respectively.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)


## 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:(24)MSE=1MN∑iM∑jMPij−Cij2,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.(25)PSNR=10logR2MSE,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, theR 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 imagesPij 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.(26)SSIM=2μpμc+C12σpc+C2μp2+μc2+C1σp2+σC2+C2.Table 4
Pixels resemblance and pixels disparities analyses between plain encrypted images and their comparison with existing methods.
Reference [29]SSIM————PSNR——8.4865—MSE——5201.746—Reference [28]SSIM0.02308———PSNR9.2570———MSE4666.515———Plain encrypted disparitySSIM0.00700.00590.00690.0079PSNR5.71774.91595.48847.6769MSE17431209651833311102ImagesLenaBarbaraMandrillMan


## 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:(27)A=A′⊕B′⊕Map,where A is the decrypted image, A′ is its cipher, B′ 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.Figure 12
CPA cryptanalysis attack: (a) Barbara; (b) neutral image; (c) encrypted image of Barbara; (d) extracted key map; (e) decrypting (c) with (d).
(a)(b)(c)(d)(e)


## 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 Table5.Table 5
Comparison of some ciphers using Lena as test image: TR: time required; RND: round numbers of diffusion; AC: average correlation; KS: key space;H: entropy; VH: variance of histograms.
AlgorithmTR (s)RNDACKSHVHUACI (%)NPCR (%)Proposed scheme1.210.00247.2 × 101347.99931091.133.4199.6[28]1.690.0177.998431.7199.42[30]5.50.0327.86 × 103667.9993819.4833.4799.64[31]0.00057.999833.4799.64[32]10.011210797.99733.4599.6[27]0.00650.0597.2 × 101347.81931.1599.63We 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.



---

*Source: 6624890-2021-07-15.xml*