Due to the growing of the use of Internet and communication media, image encryption is rapidly increased. Image sharing through unsafe open channels is vulnerable for attacking and stealing. For protecting the images from attacks, encryption techniques are required. Recently, new and efficient chaos-based techniques have been suggested to develop secure image encryption. This study presents a novel image encryption framework based on integrating the chaotic maps and color codes. Three phases are involved in the proposed image encryption technique. Piecewise chaotic linear map (PWLCM) is used in the first phase for permuting the digital image. In the second phase, substitution is done using Hill cipher which is the mixing of color codes with the permuted image. The third phase is implemented by XORing, a sequence generated by the chaotic logistic map (CLM). The proposed approach enhances the diffusion ability of the image encryption making the encrypted images resistant to the statistical differential attacks. The results of several analyses such as information entropy, histogram correlation of adjacent pixels, unified average changing intensity (UACI), number of pixel change rate (NPCR), and peak signal-to-noise ratio (PSNR) guarantee the security and robustness of the proposed algorithm. The measurements show that the proposed algorithm is a noble overall solution for image encryption. Thorough comparison with other image encryption algorithms is also carried out.

1. Introduction

Images are a substantial source of information not limited to the daily routine of a common person, but having diverse applications in various fields of military, medical, and industry. For example, we may enumerate military image records, trusted video conferencing, satellite imagery, planetary motion images, and keeping a person’s medical record [1]. The requirements of consistent, fast, and robust techniques to store and transmit digital images have led to the development of novel encryption techniques. The information conveyed through images is very complex as compared to simple text. Data sent through open channels such as Internet can be illegally accessed and restored. Therefore, the progress in the field of image encryption creates diverse opportunities and applications in upcoming future. Several assessment criteria including the information entropy, correlation between adjacent pixels, peak signal-to-noise ratio (PSNR), the number of pixels change rate (NPCR), and unified average changing intensity (UACI) related to the image encryption are essential for performance evaluation of the encryption algorithms. The algorithm for which the values of these criteria fulfill the standard expectation level can resist the statistical and differential attacks [2]. Moreover, for resisting the brute-force attacks, an algorithm with large key space and sensitive to initial conditions is recommended.

Imaging technology meets chaos and propagation requirements compared with traditional encryption systems; chaotic systems [3] have powerful features, such as nonperiodicity, nonlinearity, unpredictability, and extreme sensitivity to initial conditions [4]. Matthews [5] introduced the concept of chaotic function in cryptography. He suggested that a random sequence can be generated by iterating a nonlinear function with certain conditions. In 1998, [6] Friedrich first applied the chaotic system to image encryption. Since then, image encryption based on chaotic systems has gradually become the main field of cryptography [7]. Chen and Mao used chaotic 3D cat maps [8] and Baker maps [9] to create permuted image in their proposals. Guan used a chaotic 2D cat map [10] to swap pixels in 2005. Patidar et al. [11] presented image encryption scheme based on substitution-diffusion using chaotic standard map and chaotic logistic maps.

In 2014, [12] Zhang and Wang proposed a new multiimage encryption algorithm based on mixed pixels and piecewise linear chaotic mapping. It is the fastest way to solve the problem. Many researchers have designed image encryption techniques by using various combinations of chaotic maps such as logistic map and Baker map [13], tent and logistic map [14], and the logistic-sine-coupling map [15]. The security and efficiency of algorithms is improved by these suggestions. Liao et al. [16] recently implemented a shorthand strategy based on the enlarged channel model’s probability. He also used critical functions and pixel correlation functions [17] for stenographic purpose.

Chaos system plays a vital role in the different fields of mathematics. Many complicated systems can be investigating through chaos systems. Chaotic maps have very interesting features such as sensitivity to the initial value: a completely different sequence is generated with the small change in the initial value. Other features may include nonperiodicity, the map which is used to generate the chaotic sequence is nonperiodic, and randomness behavior, the chaotic sequences which are generated by the chaotic map are mostly pseudorandom sequences with complex structures. Due to these features, security of image encryption can be improved because without knowing the correct values of control parameters and initial conditions, an attacker cannot predict the chaos map. These features of chaotic maps enable them to be highly recommended for creating the confusion and diffusion in image encryption. For instance, see references [1823].

The present study is inspired by the above cited investigations and their applications to different areas. The core goal of this work is to make advanced venture in the regime of image encryption using chaotic maps. More accurately, this manuscript deals with developing and analyzing a novel image encryption that comprises three phases: pixel permutation process, substitution process, and pixel diffusion process. The permutation sequence for the first phase is generated by PWLCM, and the pixels of the plain image are then permuted according to the permutation sequence. Instead of using S-boxes for substitution phase, the substitution of pixels in the permuted image is determined by Hill cipher whose key is generated by color codes. The same key is used in the decryption process because it is self-invertible. At the end, the diffusion process is completed by CLM to ensure the secrecy of the entire image encryption technique. The effectiveness of the proposal is shown by several experimental results. By using information entropy analysis along with other indicative parameters such as entropy, PSNR, UACI, NPCR, and correlation factors, the proposed image encryption technique is compared with some existing techniques.

The remaining study is outlined as follows. The proposed image encryption algorithm is given in Section 2. In Section 3, we present the decryption process. Section 4 is based on the details of implementation results generated by executing the encryption and decryption algorithm to some test images. Section 5 consists of assessments of the algorithm in different aspects. Section 6 concludes the presented work.

2. The Proposed Image Encryption Algorithm

To develop an algorithm, following three aspects should be considered:(1)The evaluation and implementation of the algorithm must be simple and easy(2)The design of the encryption algorithm must resist the known attacks(3)For the algorithms, the concepts and basic ideas must be well established and reliable

Keeping in mind all the three aspects, an efficient and secure technique for image encryption is proposed here, using the chaotic logistic map and color codes.

For the image selection, the size of pixels image is recommended for its encryption. The original image is processed into one-dimensional array for encryption, but the encrypted image is again of the size

There are three phases involved in encryption; pixel permutation, substitution process using Hill cipher with color codes, and pixel diffusion. In the first phase, the piecewise linear chaotic map is used for permuting the pixels, so that the statistical structure of the plain image is dissipated into long-range statistics of the cipher image. The permuted image is then mixed with a self-invertible key matrix generated by secret color codes, in the second phase. Finally, confusion is achieved by XORing with another chaotic map to make the relationship between the statistics of the cipher image and the value of the key as complex as possible to thwart attempts of cryptanalyst. The designed flowchart shown in Figure 1 summarizes our proposed encryption algorithm.

2.1. Permutation Process

Three keys are used in three phases, respectively, of our proposed encryption algorithm. The first phase changes the position of pixels of the original image I. The piecewise chaotic linear map is used to permute the pixels. Using , iterate the piecewise chaotic linear map (PWLCM) to get a chaotic sequence and sort the obtained chaotic sequence in ascending order. By comparing the positions of the chaotic sequence and sorted sequence, obtain the permutation sequence. This permutation sequence is used to permute the one-dimensional array of the plain image.

2.1.1. Piecewise Linear Chaotic Map (PWLCM)

There are many different ways to generate the chaotic sequences or the piecewise chaotic maps for the encryption. The authors of [24] proposed hyperchaotic encryption based on multiscroll piecewise linear systems. The manuscript [25] describes maximal unstable dissipative interval to preserve multiscroll attractors via multisaturated functions.

The piecewise linear chaotic map is defined [26] ashas many dynamic properties, for example, Lyapunov exponent, random-like behavior, and uniform unvarying density function. For these attributes, PWLCM is highly recommended for cryptographic purposes. The conditions and parameters of PWLCM are as follows:(1), where is the initial value(2), where η is the control parameter(3), where is the secret key of the permutation process

The following Algorithm 1 describes the permutation process.

Input. Color image I, secret key K1 = (ξ0, η), PWLCM (1)
 Output. Image array with scrambled pixels
 Step 1. One-dimensional array of size is created by reshaping the original image matrix to one-dimensional array, where are the number of rows and columns, respectively, of the original image matrix
 Step 2. Using PWLCM (1) with the key, generate the chaotic sequence and sort the resulting sequence in ascending order
 Step 3. Compute the position vector of in and note down the transformed positions
 Step 4. The array is permuted using to get PM
2.2. Substitution Process Using Hill Cipher and Color Codes

The Hill cipher [27, 28] is a polygraphic block cipher invented by Lester S. Hill in 1929. It serves a significant role in cryptography because of its simplicity, high speed, high throughput, and resistance against frequency analysis attack.

The Hill cipher method requires an invertible key matrix, so that the decryption can be allowed. To overcome the difficulty of having an invertible key matrix, self-invertible matrix is introduced by Acharya et al. [29]. The substitution process is carried out by employing Hill cipher which uses the self-invertible key matrix based on color codes, making the substitution phase simple and efficient.

RGB color format is a model that adds red, blue, and green colors in different quantities and produces new colors. Total bits that each color uses are 8, and hence, they can have any integer value from 0 to 255. There are possibilities of generating different colors. Any three colors, color1, color2, and color3, from these possible colors can be selected as our second secret key. Now, is used to generate a self-invertible matrix of order 6 × 6. The permuted image array PM is divided into submatrices of order 6 × 1. These submatrices are multiplied one by one with. The resulting matrices are combined once again to make a one-dimensional array Q. Figure 2 shows the schematic representation of key mixing with color codes. The Algorithm 2 describes the substitution process.

Input. Permuted array PM, , where ,, and are any three random secret colors in format and k is any random integer, such that
 Output. An array Q of order L
 Step 1. Computing self-invertible matrix
(a)Make a matrix of order 3 × 3 as
(b)Take a random integer , such that
 where is the identity matrix.
(d)Form a 6 × 6 self-invertible matrix as
Step 2. Making submatrices
(a)Convert one-dimensional array PM into submatrices of order. The matrix is , where
(b)Key mixing is performed using the subsequent formula of Hill cipher
(c)Concatenate all the ’s in the form of one-dimensional array again as  .
2.3. Pixel Diffusion Process

In the final phase, using key , a sequence of real numbers, is generated by iterating CLM (2) and converted into integer’s sequence using Algorithm 3. To create diffusion, one-dimensional array Q is bitwise XORed with the integer sequence. The resulting one-dimensional array is reshaped as a matrix of order again, and cipher image is generated by this matrix.

 Input. An array, secret key , CLM (2)
 Output. Encrypted image
 Step 1. With key and CLM (2), generate a sequence
 Step 2. The sequence is transformed into a sequence of integers using the following formula: .
 Step 3. Bitwise XOR each element of with element of at the corresponding positions and preceding ciphered pixel as ,
 Step 4. Reshape array in the form of a matrix of order
 Step 5. Convert resulting matrix in step (4) to get the cipher image
2.3.1. Chaotic Logistic Map (CLM)

The final phase is a combination of a chaotic logistic map and XOR operation to apply the diffusion of pixels. Due to this change of pixel value, the pixels of the cipher image drastically change with even small one bit change in the plain image. For this process, we generate a random sequence using CLM which is defined as follows:

The conditions and parameters of CLM are defined as(1), where is the initial state of the system(2), where is the bifurcation control parameter

The chaotic behavior of the CLM with infinite period is shown in Figure 3.

The following Algorithm 3 describes the diffusion process.

3. Image Decryption Process

The following image decryption algorithm is used to revert back to the encryption algorithm for getting the original image. The decryption process also comprises three stages. In the first stage, the XOR operation is eradicated with the sequence generated with key . The effect of color mixing is wiped out by multiplying with the self-invertible key matrix generated by key . Finally, a random sequence and ultimately the inverse of permutation is constructed using key . To reverse the permutation, the inverse permutation is used. The original image is obtained by transforming the subsequent array into image form.

The following Algorithm 4 describes the decryption process.

Input. Encrypted image, secret keys , PWLCM (1), CLM (2).
 Output. Plain color image
 Step 1. The encrypted image matrix is placed in an array of size
 Step 2. As in step 1 and step 2 in Algorithm 3, the receiver generates a sequence R of size L by secret key and CLM (2)
 Step 3. Each element of in step 2 is passing through the following formula:
 Step 4. By using key K2, receiver generates matrix Kp as in Algorithm 2, which is self-invertible matrix
 Step 5.Convert one-dimensional array into submatrices of order
 Step 6. Key mixing is reversed by using the formula
 Step 7. Rewrite all ’s in the form of one-dimensional array
 Step 8. By iterating the PWLCM and using the shared secret key , get a sequence and get by sorting in ascending order
 Step 9. The permutation array is computed by inverse transform position
 Step 10. Use on to get
 Step 11. Reshape in a matrix form of order and converted to image

4. Implementation of Proposed Algorithms

For the evaluation of the proposed scheme, we used Matlab 2018a. The algorithms of pixel permutation, key mixing using Hill cipher with color codes, and pixel diffusion are executed to get the encrypted image and decryption algorithm to again get the plain image back. The standard colored images of Lena with (256 × 256) pixels are taken for the testing of our proposal. We perform the encryption using, , and . For comparison purpose, we take image of Lena to compare our results with many other schemes present in the literature. The sample input and output of Lena image by proposed algorithms is shown in Figure 4. The proposed algorithm takes 12.41 seconds to encrypt the Lena image.

5. Results, Analysis, and Performance Evaluation

In this section, proposed algorithm is evaluated by analyzing the statistical and differential parameters. We have developed the guidelines, both generally and specifically to compare the algorithm with different techniques. For performing correct encryption and decryption, these guidelines should be followed when choosing certain parameters involved in the algorithms.

5.1. Statistical Histogram Analysis

Figure 5 shows the histogram of red, green, and blue channels of the cipher image. It is clearly observed that the histogram of the cipher image is fairly uniform. It is evident that no information is leaked from the cipher image of the dispersal of pixels in the original image.

5.2. Correlation Analysis of Adjacent Pixels

The confusion and diffusion can be tested by using correlation analysis between neighboring pixels in the original image and the corresponding encrypted image. The correlation is calculated by using the following formula:where and are the values of two neighboring pixels and is the total number of pixels taken for calculating correlation. The highest value of correlation coefficient equals 1 and shows that the adjacent pixels are having high correlation. So, our encryption algorithm must encrypt the image with correlation coefficients very small and near to zero, so that the cryptanalyst cannot get any valuable information. Figures 68 display the correlation of the original image pixels in row, column, and diagonal directions, respectively. Figures 911 show the correlation of the cipher image pixels in row, column, and diagonal directions, respectively. Table 1 gives the values of correlation of scattering pixels in the horizontal, vertical, and diagonal directions for the plain and cipher image. The value obtained from equation (3) for cipher image is close to zero which shows that adjacent pixels in cipher image are almost uncorrelated.

5.3. Information Entropy Analysis

Entropy is a measurement of unpredictability of the pixel concentrations in the encrypted image. For an 8 bit image, the encryption algorithm with a value of the entropy close to 8 is considered as a good algorithm. It is calculated by the following equation:where C be a ciphered image and is the probability of character in encrypted image. For the security of the image encryption algorithm, it should be least possible to predict the original image from the encrypted image. With the entropy value 8, there are less chances of predicting plain image from cipher image. Using Matlab R2018a, the entropy value of encrypted image obtained from the proposed encryption turns out to be 7.9990. Table 2 gives a brief comparison of obtained information entropy value with various image encryption algorithms. The resulting value depicts that entropy of the proposed encryption is close enough to the ideal value 8. It guarantees that there is no loss of information.

5.4. Sensitivity Analysis of the Proposed Algorithm

The net pixel change rate (NPCR) and unified average changing intensity (UACI) are two measuring criteria used for investigating the effect of altering one pixel of the plain image on the cipher image. Both indicators are defined by the following formulas, respectively:where and show the width and height of ciphered image, respectively. represents cipher image corresponding to plain image, while represents the cipher image corresponding to plain image with change of one pixel, respectively.

The NPCR and UACI measures indicate the resistance of the algorithm against differential attacks, such as a ciphertext-only attack, a plaintext attack, or a known plaintext attack. The higher values of NPCR and UACI give the best security measures. The comparison of the NPCR and UACI values of encrypted Lena image is given in Table 3. The estimate of critical values of NPCR and UACI of proposed scheme is given in Table 4.

5.5. Mean Square Error Analysis

In the cipher image of test image Lena, we add 1%, 5%, and 10% salt and pepper noise as shown in Figures 12(a), 13(a), and 14(a) , respectively. The corresponding decrypted images of noised cipher images are shown in Figures 12(b), 13(b), and 14(b), respectively. From these figures, it is evident that when the cipher image bear salt and pepper noise or data loss attacks, the decrypted image preserves huge majority of original image information having only a small portion of uniformly distributed noise.

The mean square error (MSE) is the measurement of difference between the original and cipher images. The high value of MSE is related to a high difference between original image and cipher image. It can be calculated by the following equation:where represent the number of rows and columns, respectively. and represent the plain image and cipher image, respectively. For the difference between the plain image and cipher image, MSE ≥ 30  db. The MSE of proposed image algorithm is given in Table 5.

5.6. Peak Signal-to-Noise Ratio Analysis

The peak signal-to-noise ratio (PSNR) measures the conformity between the plain and cipher images. It can be calculated using the following formula:

The value of PSNR should be as low as possible between the plain and cipher images for good encryption algorithms. The value of PSNR of the proposed algorithm is given in Table 5.

The proposed algorithms are also applied to another sample colored image of onion (198 × 135 pixels). The entropy value of onion image is 7.9975. The resulting encrypted and decrypted images are shown in Figure 15. The histogram of cipher image and correlation of neighboring pixels of plain and cipher images are shown in Figures 1622 , respectively. Table 6 illustrates the values of correlation of neighboring pixels of cipher image of onion.

5.7. Key Space Analysis

The key space is all the possibilities of keys that can be utilized in the encryption algorithm. The size of key space is treated as a significant aspect of the algorithm. It should be huge enough to avoid brute-force attacks. With today’s computing abilities, an algorithm can resist exhaustive attacks [33] if the size of key space is larger than . There are three keys involved in our proposed image encryption algorithm. The secret keys and contain parameters of associated chaotic maps which are By considering the precision of these parameters to be , the total number of possibilities of choosing these two keys will be . The key is a combination of three random colors and a random number . The number of possibilities for choosing three colors are . The integers that satisfy the condition are . So the total possibilities of choosing are . The total size of key space is . Therefore, our proposed algorithm is resistant against the brute-force attacks because the size of the key space is large enough. Table 7 lists the key space size of several schemes.

The computational complexity is analyzed as follows.

Assume that a fastest computer can calculate computations in one second. So, in one year, the number of computations performed by the computer is . Hence, the total of years is required. To resist the brute-force attack against this encryption algorithm, this computational load is large enough.

5.8. Key Sensitivity Analysis

An image encryption algorithm should be highly sensitive to its secret key, that is, a variation of single bit in secret key should yield a totally different cipher result. A highly sensitive key may contribute towards the security of the image encryption algorithm. The output of our decryption algorithm is totally changed with a slight modification in any part of the key . Making even a slight variation in value of one part of encryption key as , the image will be produced but not same as plain image. So, it is observed that the cipher image does not contain any clue or gesture about the original image. The proposed algorithm is highly sensitive to secret keys.

6. Conclusion

This study presents a novel color image scheme based on chaotic maps. In contrast to the traditional chaos-based cryptosystems, the suggested cryptosystem is proposed using Hill cipher and color codes. The confusion phase is done by the piecewise chaotic linear map. The Hill cipher with color codes is employed for the substitution phase. The diffusion process is performed by a chaotic logistic map and bitwise XOR. The key space size of the encryption algorithm is adequately high to combat brute-force attacks. Also, the algorithm is highly sensitive to keys. Several experimental tests have been carried out with detailed numerical analysis which exhibits the robustness of the suggested algorithm against numerous attacks such as statistical and differential attacks. The proposed image encryption algorithm is highly secure which is demonstrated by performing different assessment tests. The results of these experiments and performance tests are compared with different algorithms and summarized in Table 8.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest.


The authors thank Taif University, Taif, Saudi Arabia, for its support under the project Taif University Researchers Supporting Project number (TURSP-2020/114).