A Color Image Encryption Technique Based on Bit-Level Permutation and Alternate Logistic Maps

Abstract The paper presents an approach to encrypt the color images using bit-level permutation and alternate logistic map. The proposed method initially segregates the color image into red, green, and blue channels, transposes the segregated channels from the pixel-plane to bit-plane, and scrambles the bit-plane matrix using Arnold cat map (ACM). Finally, the red, blue, and green channels of the scrambled image are confused and diffused by applying alternate logistic map that uses a four-dimensional Lorenz system to generate a pseudorandom number sequence for the three channels. The parameters of ACM are generated with the help of Logistic-Sine map and Logistic-Tent map. The intensity values of scrambled pixels are altered by Tent-Sine map. One-dimensional and two-dimensional logistic maps are used for alternate logistic map implementation. The performance and security parameters histogram, correlation distribution, correlation coefficient, entropy, number of pixel change rate, and unified averaged changed intensity are computed to show the potential of the proposed encryption technique.


Introduction
In this information age, with the advent of technology, it becomes easier for an individual to send processed data. The processed data are classified into different categories as digital images, text, audio, videos, etc. Digital images are also one of the types of processed data, which are often sent through the various media like networking sites, electronic media, and social media. These are used in many application areas like video conversation, medical science, online albums, and military images database. The color images draw more attention as these incorporate more data than grayscale images [12,38,39,42]. Hence, their security and authenticity is the major issue of research interest [30]. A number of image encryption algorithms are being developed for the security and safety of digital image data while transferring them through the networking medium. The classical algorithms like Data Encryption Standard [10], Advanced Encryption Standard [32], International Data Encryption Algorithm [16], etc. are incapable of encrypting digital images as there is strong correlation among adjacent pixels and redundant data and bulk capacity of data is present in digital images. Also, the classical algorithms require higher processing time and power [3,24,30,46,47]. The chaotic encryption techniques acquired the consideration of researchers because of their ubiquitous nature like sensitivity to seed value and control parameters, ergodic state, quasi-randomness, complex dynamics, etc. [1, 18,24,27,30,46].
The chaotic map is an integral part of the chaotic cryptosystem. It helps in implementing the chaotic behavior within the cryptosystem. By using seed value and control parameters, chaotic maps produce fractals of pseudorandom numbers. Chaotic maps are also used as key streams generator for the various encrypted

Logistic Map
This is one of the oldest, simple, and extensively used chaotic maps that have been used in many chaos-based cryptography systems.

One-Dimensional LM
It can be easily implemented through hardware and software because of its simplicity. It has less processing overhead and is more balanced. Hence, it is a candidate for characterizing the sophisticated dynamic behavior. Equation (1) gives the mathematical expression of the one-dimensional LM.
where p j lies in the range between 0 and 1 for n number of iterations. The dynamic nature of the function p depends on the control parameter B k . The function shows complete chaotic nature within the range of 3.56 < B k ≤ 4. In the proposed scheme B k is taken as 3.9989. The initial value of p 0 is also called seed value [42].

Two-Dimensional LM
The two-dimensional LM is the extension of one-dimensional LM. Chaotic cryptosystems usually employ the chaotic maps of more than one dimension to provide better key space and dependency on the control parameter. Hence, two-dimensional LM has a more complicated structure [28]. It shows more chaotic behavior than the one-dimensional LM. So it becomes harder for an attacker to breach the cryptosystem [42]. It can be mathematically expressed by Eq. (2).
where 2.75 < B k1 ≤ 3.4, 2.75 < B k2 ≤ 3.45, 0.15 < L y1 ≤ 0.21, and 0.13 < L y2 ≤ 0.15. The values of q and r lie in the interval (0, 1). The values of B k1 , B k2 , L y1 , and L y2 and the initial values of the q 0 , r 0 are provided by the secret key (Lorenz system) used for image encryption in alternate one-dimensional and two-dimensional LM [42,49].

Four-Dimensional Chaotic Map (Lorenz System)
The Lorenz system is the four-dimensional differential chaotic equation, an extended version of the three-dimensional differential equations. Equation (3) represents the mathematical expression of the fourdimensional Lorenz system [45].
Here z 1 , z 2 , z 3 , and z 4 are state variables and a, b, c, d, e, f, and g are the constant parameters of the system. In [19] and [9], two Lorenz systems have been combined, and the performance analysis of new fourdimensional chaotic systems has been done. The developed differential equation system provides a set of dynamic solutions.

ACM
The ACM is performing the permutation within the pixels of an image. It is used to decrease the interrelationship between the pixels of the color image. Equation (4) gives the mathematical expression for the iterative form of ACM [24].
Here, a′ and b′ become the new coordinate positions of the pixel for the original positions of a and b. Y i and Z i are the control parameters of ACM.

LSM
This chaotic map is a combination of one-dimensional logistic and one-dimensional sine map. It provides greater chaotic range as compared to individual logistic and sine map. Equation (5) gives the mathematical expression for the LSM [6].
where B k ϵ(0, 4). B k is the control parameter, and its value is taken as 3.9999 in the implemented work.

LTM
This chaotic map is the combination of the one-dimensional LM and one-dimensional tent map. Equation (6) gives the mathematical expression for the LTM [6].
where B k ϵ(0, 4). B k is the control parameter, and its value is taken as 3.9999 in the implemented work.

TSM
This map is also the combination of one-dimensional tent map and one-dimensional sine map. Equation (7) gives the mathematical expression for the TSM [6].

Proposed Scheme
This section of the paper describes the color image encryption technique. The proposed scheme comprises bit-level permutation and alternate one-dimensional, two-dimensional LM. Firstly, the color image of [M * N * 3] is taken as input and is separated into red (p r ), green (p g ), and blue (p b ) channels. Then  bit-level permutation is applied using ACM, LTM, LSM, and TSM, which gives scrambled red (h r ), green (h g ), and blue images (h b ) as output. In alternate LMs, the four-dimensional chaotic map (Lorenz system) is used as key generator to further confuse-diffuse the permutated image and to form the final encrypted images for the red (e r ), green (e g ), and blue channels (e b ). The decryption process is just reversal encryption steps inverse chaotic confusion-diffusion using alternate LMs followed by an inverse bit-level permutation using ACM, LTM, LSM, and TSM. The block diagram for the proposed method is shown by Figure 1.

Bit-Level Permutation
A color image of size [M * N * 3] is taken and split it into its red (p r ), green (p g ), and blue (p b ) gray scale image channels. Each gray scale image is transposed from pixel plane to bit plane. The ACM is applied to scramble the bits of gray-scale images. The two chaotic functions LSM and LTM are used to generate a sequence of random numbers s1 and s2. The sequence is used to figure out the new location of the image pixels. The mathematical expression used to obtain a new location in ACM is given as follows: Next, the TSM is used to generate pseudorandom number series (C) to diffuse the intensity value of the scrambled image by XORing with random numbers. The following expression is used to diffuse the intensity value of image pixel.

Encryption Technique
The scrambled image is encrypted using one-dimensional and two-dimensional LMs one after another employing the four-dimensional Lorenz system as pseudorandom key generator.

Pseudorandom Key Generator
The Algorithm 1 below describes the steps for generating the encryption key using Lorenz system.

Algorithm 1: Pseudorandom Key Generator Using Lorenz System
Input: For generating keys for red, green, and blue channel, the initial values of constant parameters a, b, c, d, e, f, and g of the Lorenz system are taken as 16, 45, −2, 45, 16, −4, and 16.
Step 1: Create a four-dimensional chaotic sequence by taking the root values as z01, z02, z03, and z04 of chaotic system to iterate Eq. (3) ((M × N)/3 + 10) times. Eliminate the first 10 group values of pseudorandom sequence and then obtain the four sequences z1, z2, z3, and z4.
Step 2: Quantize four-dimensional chaotic sequence by taking all the values of z j i , where j = 1, 2, 3, 4 and i = 1, 2, 3. . . .(M × N)/3 and then obtain the decimal part of the four-dimensional chaotic sequence by using Eq. (11) The decimal part of the chaotic sequence is quantized, and the integer sequence values z1, z2, z3, and z4 are obtained using Eq. (12).
Step 3: Generate key sequence where z j i a sequence of integer values is and it is mathematically expressed by Eq. (13).
The following order reduces the correlation between three random bit sequences, and crosswise different bits of every sequence are taken.
Key 1 obtained from the first to eighth bits of z1 i , z2 i , and z3 i is shown in Eq. (14).
Key 2 obtained from the fifth to twelfth bits of z3 i , z4 i , and z1 i is shown in Eq. (15).
Key 3 obtained from the ninth to sixteenth bits of z2 i , z3 i , and z4 i is shown in Eq. (16).
Output: k1, k2, and k3 are the encryption keys for red, green, and blue channels obtained as output of this algorithm.
The time taken to generate different lengths of multi-dimensional chaotic sequence is 5.181768 by this technique. A good pseudorandom key generator efficiently minimizes the length of chaotic sequence and hence largely reduce the time for encrypting the image.

Alternate LMs
The scrambled color image (h) of size M × N obtained through the bit-level permutation is further encrypted. The image is divided into R, G, and B channels. Each channel is represented by a pixel matrix of size M × N, and the range of pixels is from 0 to 255. Each channel pixel matrix is denoted as h r , h g , and h b , respectively. Algorithm 2 describes the steps involved in alternate LM.

Algorithm 2: Alternate Logistic Maps
Input: The scrambled image of size [M * N * 3] after bit-level permutation is performed is given as input.
Step1: Divide the scrambled image into R, G, and B channels matrix h r , h g , and h b , respectively, and obtain the matrix A.
Step 2: H1, H2, and H 3 are determined for each channel of the image h by employing Eqs. (17) to (19), respectively. After that some permutations are done on each channel.
Step 3: Repeat Eqs. (5) and (6) using B k , B k1 , B k2 , Ly1, and Ly2 as the initial values of the p0, q0, and r0 are used. In each repetition the new values p j , q j , and r j are obtained.
Step 4: Assign the value of keys k1, k2, and k3 should be to p i , q i , and r i , and continue repeating two-dimensional equations and one-dimensional equation of logistic map alternately.
Step 5: Diffuse the values of red, green, and blue channels to obtain the final encrypted image A.
where A(p, r − 1) is the previous value of the channels and (D(p,r)) is the current value of the channels which are being processed.

Output:
The final encrypted image with its red, green, and blue channels is obtained by the algorithm.

Experimental Setup and Security Analysis
This section of the paper discusses the tool used for implementing the color image encryption technique and results obtained after applying the technique. To implement the technique, MATLAB R2013a simulation tool, Operating System Windows 10 Pro, and processor intel core i-5 were used. The seed values for LSM, LTM, and TSM are set to 0.19235188279821, 0.73457891876543, and 0.56399882091176, respectively. The value of bifurcation parameter is 3.9999 for all the three maps. The implementation of the alternate LM with Lorenz system as the key generator is done by using the parameters, and initial values are v = 3.99, v 1 = 3.39, v 2 = 3.4489, L 1 = 0.21, L 2 = 0.15, x 0 = 0.345, y 0 = 0.365, and z 0 = 0.537. Figure 2A shows the input "Aerial" image of size 170 × 170 taken for testing the proposed work. Figure 2B-D show its red, green, and blue channels. Figure 3A-D show the final encrypted color image with the red, green, and blue channels, respectively. Figure 4A-D show the final decrypted image with red, green, and blue channels, respectively. Figure

Key Space Analysis
The key space analysis demonstrates the probability of finding an encryption key by applying all the possible keys [29]. The key space of the implemented technique increases exponentially with increase in key size. It also depends upon the initial value of chaotic maps used in the system [45]. In the proposed scheme, the three chaotic maps are used which has 14 digits after the decimal points. The key space for them is equal to 10 14×3 , which is more than 2 186 , and the parameters v, v 1 , v 2 , L y1 , L y2 , x 0 , y 0 , and z 0 are used as encryption keys in alternate one-dimensional and two-dimensional map. The precision for them is 10 −15 . Since the total key space becomes almost 10 165 . Hence, the overall key space is large enough to resist brute force attack [42].

Statistical Analysis
It demonstrates the nearness between the plaintext image and the cipher image. There must be no similarity between the cipher and the plaintext image. The two measures of statistical analysis are image histogram and correlation between the adjacent pixels [40]. The histogram illustrates the distribution of image pixels by plotting the graph of the intensity level of each pixel present in the image. Usually, for original plaintext, the graph formed is steeper, raised, and fluctuating in nature, while for encrypted images the graph is consistently scattered and much different from the original plaintext. Hence, it shows no statistical similarity between the original and the encrypted images. Figure 5A-C show histograms of R, G, and B channels of the original image, respectively. Figure 6A-C show the histograms of R, G, and B channels of the encrypted image, respectively. The correlation among the adjacent pixels of an original plaintext image is stronger, whereas in the encrypted image the correlation must be weaker such that the original images cannot be easily retrieved from the encrypted images. The correlation distribution of the red, green, and blue channels of the "Aerial" color image in each direction is shown in Figure 7. Figure 7A-C show the correlation distribution of the red channel of the plain color image horizontally, vertically, and diagonally. Figure 7D-F show the correlation distribution of the green channel of the plain color image horizontally, vertically, and diagonally. Figure 7G-I show the correlation distribution of the blue channel of the plain color image horizontally, vertically, and diagonally.
The correlation distribution of the red, green, and blue channels of the encrypted color image in each direction is shown in Figure 8. Figure  encrypted color image horizontally, vertically, and diagonally. Figure 8D-F show the correlation distribution of the green channel of the encrypted image horizontally, vertically, and diagonally. Figure 8G-I show the correlation distribution of the blue channel of the encrypted image horizontally, vertically, and diagonally.

Correlation Coeflcient Analysis
The correlation among the pixels of the original plaintext is high in each direction whether it is horizontal, vertical, or diagonal, while for the encrypted image the correlation should be very small in each direction. When the correlation is low, it implies that the algorithm has a better ability to resist statistical attack [40].
In plain image and encrypted image, 3000 pairs of adjacent pixels are selected to calculate the correlation coefficient. It is calculated by using the following equations [5]: where cov(y, Table 1 shows the correlation coefficients between the R, G, and B channels of the encrypted color image.

Information Entropy
Information entropy is used for measuring the robustness of the algorithm. The entropy value of the ciphered image is relatively equivalent to 8; then the algorithm has the capability of resisting against the entropy attack. Equation (42) gives mathematical expression for information entropy [19,29,40]. Here P (︀ r j )︀ represents the probability of the symbol. Table 2 shows the entropy of the R, G, and B components of the original plaintext and encrypted image.

Differential Analysis
This differential analysis illustrates the sensitivity of the encryption technique towards the negligible changes [37]. If an intruder does small changes in the original plaintext (for example, 1 pixel) to notice its impact on results, this interruption would result in a major change in the ciphered image. Then, the intruder could not get the connection between the original plaintext and the encrypted image. Thus, the differential attack by an intruder fails. Two measures, NPCR and UACI, are used to test against differential attack. NPCR is an acronym for a number of pixel change rate with respect to a one-pixel change in the original image. UACI is an acronym for unified average changing intensity which demonstrates the average intensity of differences between two encrypted images, corresponding to plain images having only one-pixel difference between them. The NPCR and UACI are expressed as follows: where C(i, j) is a two-dimensional array which has been of the same size as the encrypted image and A × B shows the total number of pixels in the original image.
where A and B show the width and height of the image, and C 1 and C 2 are the encrypted image before and after one pixel of the color plain image is changed. Table 2 shows the NPCR and UACI of R, G, and B components of the original plaintext and encrypted image.

PSNR and MSE
The parameters used for measuring encryption and decryption efficiency are mean squared error (MSE) and peak signal-to-noise ratio (PSNR) [4,44]. MSE measures error present in images. The mathematical expression for calculating mean squared error is defined as follows in Eq. (28).
Here, z′ is the original plain image, and z is an encrypted image. N is the size of the image. PSNR is defined as the ratio between peak signal to MSE. The mathematical formula for calculating the PSNR is as follows, defined in Eq. (29).

Encryption Eflciency
For encryption process efficiency, the PSNR and MSE are calculated for the original image and the encrypted image. Lower PSNR value and higher MSE value demonstrate the more efficient image encryption. The encryption efficiency is shown in Table 3.

Decryption Eflciency
For decryption process efficiency, the value of PSNR should be higher and MSE is lower between the original and the decrypted images. Table 3 shows the decryption efficiency of the algorithm.

Encryption Time Analysis
Time is the most important parameter in image encryption [40]. The proposed image encryption algorithm has been implemented on a personal computer with operating system Windows 10 Pro, with processor Intel core i-5 and using MATLAB R2013 as a simulation tool. Table 4 represents the time taken for encryption of the red, green, and blue components of the image.

Conclusion
The proposed scheme presents a color image encryption technique using bit-level permutation and fourdimensional Lorenz system. The bit-level permutation is done with help of ACM. The three channels go through the confusion-diffusion process by four-dimensional Lorenz system and ultimately are transformed to an encrypted color image. Also, the tested performance metrics like key space analysis, entropy analysis, and differential analysis reveal that the developed system is highly resistant towards brute-force attack, is more secure, and is highly sensitive towards differential attack, respectively. The PSNR and MSE are used to calculate efficiency of encryption and decryption process.