A new color image encryption algorithm based on iterative mixing of color channels and chaos

In this paper, we present a novel secure cryptosystem for direct encryption of color images, based on an iterative mixing spread over three rounds of the R, G and B color channels and three enhanced chaotic maps. Each round includes an a ﬃ ne transformation that uses three in-vertible matrices of order 2 × 2 , whose parameters are chosen randomly from a chaotic map. The proposed algorithm has a large secret key space and strong secret key sensitivity, which protects our approach from a brutal attack. The simulation results show that our algorithm is better for color images in terms of Peak Signal to Noise Ratio (PSNR), entropy, Uniﬁed Average Changing Intensity (UACI) and Number of Pixels Change Rate (NPCR).


Introduction
The proliferation of access to information terminals, as well as the implementation of digital personal data transfers, requires the availability of means that ensure a reliable, fast and genuine exchange. In fact, the use of a communications network exposes the transfer of data to certain risks, which require adequate and appropriate security measures. For example, Pirated images can subsequently be the subject of data exchange and illegal digital storage. Data encryption is often the only effective way to meet these requirements. According to Shannon, the basic techniques [1] for an encryption system can be classified into two main categories: permutation of positions (diffusion) and transformation of values (confusion). And the combination between the two classes is also possible. In the literature, several algorithms based on confusion and diffusion have been developed [2][3]. Currently, the use of chaos in cryptosystems, has caught the attention of researchers. This is due to the characteristics of the chaotic signals. To quote, unpredictability, ergodicity, and sensitivity to parameters and initial values. Recently, several chaos-based articles have been proffered [4][5]. Unfortunately, the one-dimensional logistic map has been widely used in several cryptosystems based on chaos [6][7]. Nev-ertheless, this map has some disadvantages when it is used in cryptography such as not uniform distribution, small space key, chaotic discontinuous ranges, and periodicity in chaotic ranges [8]. Its very important to produce a new chaotic system with better chaotic performance. In this work, we proposed a method based on an improvement of the three chaotic maps, namely the Pseudorandomly Enhanced Logistics Map (PELM) [9], the Pseudorandomly Enhanced Sine Map (PESM) and the Pseudorandomly Enhanced Skew Tent Map (PESTM). Thus, the red channel of the original image is mixed with the ELM, the green channel with the ESM, and the blue channel with the ESTM. Then, a strong avalanche effect will be applied on the three mixed channels, so that a small perturbation on a pixel of the original image will be reflected on the entire image.
The paper is organized as follows. Section 2 makes a new chaotic maps by using the above mentioned three 1D chaotic maps. Section 3 gives a detailed explanation of the proposed image encryption scheme. Section 4 present experimental results demonstrating performance of the proposed method against statistical and sensitivity cryptanalysis. section 5 shows conclusion.

The pseudorandom number generator
The proposed image encryption scheme relies on three improved chaotic maps PELM, PESME and the PESTM, for the generation of pseudo-random number sequences. In this section we show the improvement of the three chaotic maps in terms of chaotic behavior, Lyapunov exponent, bifurcation and distribution.

Pseudorandomly Enhanced Logistics Map
The logistic map is a simple dynamic nonlinear equation with a complex chaotic behavior, is one of the famous chaotic maps, expressed by the following equation: Where µ ∈ [0, 4] is a control parameter of the logistic map, the variable X n ∈ [0, 1] with n is the iterations number used to generate the iterative values. The one-dimensional logistics map is characterized by its simple structure and its ease of implementation. Its usually used to encrypt large data in real time [11]. On the other hand, it has several weaknesses [10], including discontinuity, non-uniformity, short periodicity, numerical degradation and weak key space.
We have thus improved the pseudo-randomness of the sequences generated by the logistic map, by a simple multiplication by 10 6 and an application of the modular arithmetic (mod 1). This new pseudorandom generator is indicated in equation (2) [9]: where mod is the operation of module 1. the proposed generator has a Lyapunov exponent higher than that of the logistic map ( Fig. 1), and a good distribution (Fig. 2).

Pseudorandomly Enhanced Sine Map
The sine map is also one of the one-dimensional chaotic maps whose chaotic behavior is similar to that of the logistic map described by the following equation: Where r ∈]0, 1] is a control parameter of the sine map, the variable Y n ∈ [0, 1] with n is the iterations number used to generate the iterative values. We have also improved the pseudo-randomness of the sequences generated by the Sine map, by a simple multiplication by 10 6 and an application of the modular arithmetic (mod 1). This new pseudo-random generator is indicated in equation (4): To test the property of the PESM in terms of the Lyapunov exponent and distribution, several simulations and analysis were performed (see Fig. 1 and Fig.  2).

Pseudorandomly Enhanced Skew Tent Map
The skew tent map is a one-dimensional simple chaotic system which can be described by [12]: Where Z n ∈ [0, 1] is the state of the chaotic system, and b ∈ [0, 0.5] ∪ [0.5, 1] is the control parameter. We have also improved the pseudo-randomness of the sequences generated by the skew tent map. This new pseudo-random generator is indicated in equation (6): The figure below shows the Lyapunov exponents of the logistic map, the sin map, the skew tent map, and of the pseudo-random generators proposed.  We can see in the fig. 1 that the Lyapunov exponent is large for the proposed pseudo-random generator. Therefore, this generator presents a higher and faster divergence between two chaotic trajectories having very similar initial conditions. From a cryptographic point of view, a good pseudo-random generator must produce chaotic sequences with uniform distribution. The figure below shows the distribution densities of the logistic map, the sin map, the skew tent map, and of the pseudo-random generators proposed.
It is clear from the fig. 2 that the pseudo-random generators proposed has a uniform distribution density. Therefore, has excellent statistical properties, and is more recommended to use for a robust encryption system.

Description of the proposed scheme
Our algorithm is based on three stages of confusion and a diffusion step. Let us consider an H × W color image P to be encrypted. With H is the height and W the width. The process of our proposed algorithm will be summarized in Fig. 3 :

Confusion process
The confusion step is described as follows : Step 1: Load the plain image P of size W × H, and divide it into 3 images with R, G and B channels respectively.
Step 2: Choose six values X 0 , Y 0 , Z 0 , µ, r and b which represent the initial conditions and the control parameters of the pseudo-random generators proposed.
Step 6 : Mix each color channel with to another or with a key according to the following formulas : T mp (1) , T mp (2) and T mp (3) are variables not taken into consideration in the encryption process.

Diffusion process
The diffusion step is described as follows : Step 1: Step 2 : Concatenate the three sequences X, Y and Z into a single vector Then by sorting the order of the vector V (K) , the chaotic sequence is changed into a sorted order. This sequence is called V (p) .
Step 3 : Obtain the permuted image pixel vector P = {p 0 , p 1 , ..., p W ×H−1 }, by using the permutation position vector V (p) according to the following formula : Step 4 : Obtain the diffusion vector D = www.astesj.com {d 0 , d 1 , ..., d 3×W ×H−1 }, by the following algorithm : Step 5 : Convert the diffusion vector D into the R, G and B color image with the size of W ⊗ H.

Decryption algorithm
The decryption process is similar to that of encryption procedure in the reversed order.

Experimental results and analysis
In this section, we will validate our encryption system in terms of key space, histogram, entropy, correlation coefficient, NPCR, and UACI. All simulations are performed on a personal computer. Table 1 shows the hardware, the software environment and the image source.

Space of key
The exhaustive attack is to try all possible combinations of keys until obtaining a clear text. Therefore, in a good image cryptosystem, the space of key should be large enough to make brute-force attack infeasible. The secret key of the proposed cryptosystem contains six real numbers (µ, r, b , X 0 , Y 0 , Z 0 ). If the precision is 10 −14 , the key space size can reach to 2 252 . From a cryptographic point of view, the size of the key space should not be less than 2 100 to ensure a high level of Security [14]. This means that our algorithm can withstand the brute force attack.

Histogram analysis
An image histogram is a graphical representation of the number of pixels with the same gray level. Thus, the abscissa axis represents the color level, which starts from zero (color channel off) to 255 (maximum color channel). Fig. 4(a)-(b) show the plain and cipher image. Fig. 4(c)-(d) show the histogram of plain and cipher components' R, G, and B. Comparing the two histograms of plain and cipher image, we can see that histogram of encrypted image is fairly uniform and is significantly different from that of the original image, and that the encrypted images obtained do not provide any information to the attacker, which can strongly resist statistical attacks.

Information Entropy
Information entropy is designed to evaluate the uncertainty in a random variable as shown in the following equation [1]: Where, M is the total number of symbols and represents the probability of occurrence of the symbol, for a grayscale image with a data range of, its maximum Information entropy is 8. The results are shown in Table 2. It is clear from Table 2 that the values of the entropy of the encrypted images are very close to the theoretical value (which is equal to 8).

Correlation analysis
The obvious characteristics of visually meaningful images is redundancy and strong correlation among adjacent pixels, and it can be used by attackers. In order to test the correlation, we randomly select 1000 pairs of adjacent pixels in three dimension (vertical, horizontal and diagonal). The results are shown in Table 3 and Fig 5. The correlation coefficient for a sequence of adjacent pixels is given by the following formula: Where u and v represent two vectors formed respectively by the values of the pixels of the chosen sequence of the image and the values of their adjacent pixels. The terms cov(u, v), D(u) and D(v) are calculated by the following formulas: Where N is a large number of adjacent pixel pairs randomly selected in the image (In our case N = 1000), u i and v i are respectively the color levels of the collected pixels. We can see in the Table 3, the correlation coefficient values are nearing to zero and negative values which prove that there is no correlation between the plain and cipher image.

Differential analysis
The Number of Pixels Change Rate (NPCR) [15] and Unified Average Changing Intensity (UACI) [16] are used to analyze the effect of slight change (one bit of single pixel) in the plain image on the cipher image [21]. The formulas used to calculate NPCR and UACI are defined by the following two equations: Where, C 1 (i, j) is the encrypted image and C 2 (i, j) is the encrypted image after changing a pixel of the clear image. For the pixels at the position (i, j) , if C 1 (i, j) C 2 (i, j) , then g(i, j) = 1 , otherwise it's equal to zero. A value of U ACI > 33.4635% and N P CR > 99.6094% ensures that an image encryption scheme is immune to a differential attack. Table 4 below shows the results of the UACI and NPCR simulations. It is clear from Table 4 that the value of NPCR is greater than 99.6094% and that of UACI is greater than 33.4635%. That is to say a modification of a single pixel of the original image results in a radical change of all the pixels of the encrypted image.

Conclusion
In this work, firstly, we proposed a technique of making an effective pseudorandom number generator by using a difference of the output states of three famous one-dimension chaotic maps namely logistic map, sine map and skew tent map. Simulations evaluations in terms of the Lyapunov exponent and the distribution density showed that the proposed generator is able to generate a one-dimension chaotic system with excellent statistical properties and good chaotic behavior. Secondly, we proposed a novel algorithm based on an iterative mixing of the three components R, G and B with the three chaotic sequences generated from the proposed pseudo-random generator, followed by a strong diffusion. The values of the performance metrics in terms of key space, histogram, entropy, correlation coefficient, NPCR, and UACI, satisfy that the proposed algorithm is extremely difficult to break and withstands on various kinds of security attacks.