New Image Encryption Algorithm Using Hyperchaotic System and Fibonacci Q-Matrix

: In the age of Information Technology, the day-life required transmitting millions of images between users. Securing these images is essential. Digital image encryption is a well-known technique used in securing image content. In image encryption techniques, digital images are converted into noise images using secret keys, where restoring them to their originals required the same keys. Most image encryption techniques depend on two steps: confusion and diffusion. In this work, a new algorithm presented for image encryption using a hyperchaotic system and Fibonacci Q-matrix. The original image is confused in this algorithm, utilizing randomly generated numbers by the six-dimension hyperchaotic system. Then, the permutated image diffused using the Fibonacci Q-matrix. The proposed image encryption algorithm tested using noise and data cut attacks, histograms, keyspace, and sensitivity. Moreover, the proposed algorithm’s performance compared with several existing algorithms using entropy, correlation coefﬁcients, and robustness against attack. The proposed algorithm achieved an excellent security level and outperformed the existing image encryption algorithms.


Introduction
The transmission of digital images through various networks is a routine process where thousands of digital images are transmitted every moment. In social networks, users do not want others to access their images. In healthcare networks, medical images are sensitive where any misuse of these images may lead to wrong diagnoses and inaccurate medical decisions. Transmission of the military images via different networks requires high-security levels to prevent intruders from getting them. Generally, owners of digital images do not want others to access their images without permission. For these reasons, securing images' contents has become an important issue. Several security approaches are used to achieve image confidentiality, so an unauthorized user cannot access image content.
Image security approaches are divided into three main categories: data hiding [1,2], image watermarking [3][4][5][6][7], and encryption [8][9][10][11]. In data hiding techniques, a secrete message is embedded in the cover image so that it is not detectable. In image watermarking techniques, pieces of digital data inserted in the image where the original and watermarked images' perceptibility are similar. In image encryption techniques, the digital input image converted to a noise image using a key, which is not understood or predicting its content. Users cannot restore the encrypted image without knowing the key.
There are several techniques used in digital image encryption, such as the theory of chaos [12][13][14], DNA [15][16][17], the method of quantum [18,19], and compressive sensing [20,21]. Image encryption techniques depend on two significant steps. The first step is confusion in which pixel arrangements changed. Diffusion is the second step, which 1.
The first utilization of the Fibonacci Q-matrix in image encryption. 2.
Using 6D hyperchaotic system in image encryption for the first time. 3.
Integration of the 6D hyperchaotic system and Fibonacci Q-matrix assure highsecurity level. 4.
The large keyspace of the proposed algorithm leads to good resistance to brute force attacks. 5.
The proposed image encryption algorithm has super robustness to most attacks. 6.
Analysis of the obtained results shows the excellent performance of the proposed algorithm.
The following sections are: The mathematical foundations of the 6D hyperchaotic system and the Fibonacci Q-matrix presented in Section 2. The proposed algorithm is presented in Section 3. Tests and results are discussed in Section 4. The conclusion is presented in Section 5.

Six-Dimensional Hyperchaotic System
Generally, mathematical analysis shows that chaotic functions are nonlinear with dynamic behavior. Therefore, their responses are unpredictable. Previous studies show that the hyperchaotic functions' dynamical behavior is much complicated than the corresponding one of the low-dimension chaotic functions. A hyperchaotic system should have at least four dimensions. Moreover, low-dimension chaotic functions contain only one positive Lyapunov exponent, while the hyperchaotic systems have at least two.
x 6 = rx 1 (1) where a, b, c, d, e, and r are constants; x 1 , x 2 , x 3 , x 4 , x 5 , and x 6 refer to state variables of the 6D hyperchaotic system. In this paper, the constant values selected are a = 10, b = 8 3 , c = 28, d = −1, e = 8, and r = 3. This selection ensures that the system has two positive Lyapunov exponents that achieve the condition (sum of all exponents is negative).

Fibonacci Q-matrix
The elements of the Fibonacci sequence, F n , are [43]: where F 1 = F 2 = 1. The Fibonacci Q matrix is given by: The nth power of the Fibonacci Q matrix is the matrix defined by: where F n is the Fibonacci number, and the determinants of the Fibonacci Q-matrix is: The inverse matrix Q −n has the following form:

The Proposed Algorithm
The new algorithm utilized a 6D hyperchaotic system and Fibonacci Q-matrix to encrypt the input image. Since the 6D hyperchaotic system has complex high-dynamic behaviors and two positive Lyapunov exponents, its utilization improves the encryption performance and increases security level. Fibonacci Q-matrix is very simple, fast, and able to diffuse the scrambled image. A flowchart of the proposed encryption-decryption algorithm is shown in Figure 1.

Encryption
The encryption depends on two steps: confusion and diffusion. The pixels' arrangements and values are modified in these processes, respectively. The confusion step is based on the 6D hyperchaotic system. First, we calculate the initial condition of the system that is based on the plain image. Then a new vector is obtained by iterating the hyper chaotic system, and then we select three sequences (x 1 , x 3 , and x 5 ). This vector is sorted, and the position of the sorted numbers is used to confuse the plain image. After confusing the plain image, the diffusion step is performed to obtain the encrypted image. In our algorithm, the diffusion is based on the Fibonacci Q-matrix. The scrambled image is divided into blocks, each with size 2 × 2, and then each block is diffused using the Fibonacci Q-matrix. Two rounds of confusion and diffusion steps are performed to get the encrypted image. Algorithm 1 describes the encryption steps.

Decryption
The decryption steps are the reverse of the encryption steps. The plain image can be retrieved from the encrypted image by doing the following steps: 1.
The encrypted image (C) is divided into blocks, each with size 2 × 2, and then the diffusion equation with Q −10 is applied to image blocks by using the following equation: The scrambled image (D ) obtained from the previous step is converted into vector W.

3.
The vector S generated in the encryption step is used to return each pixel to its original position by the following equation:

4.
Convert the vector ER in to matrix to obtain the decrypted image (D).

5.
Two rounds of decryption steps are performed to get the decrypted image. crypt the input image. Since the 6D hyperchaotic system has complex high-dynamic be-haviors and two positive Lyapunov exponents, its utilization improves the encryption performance and increases security level. Fibonacci Q-matrix is very simple, fast, and able to diffuse the scrambled image. A flowchart of the proposed encryption-decryption algorithm is shown in Figure 1.   Transform the image array to a vector P.

4:
Iterate the hyperchaotic system in (1) N 0 + MN/3 times then discard the N 0 values to make a new sequence L with size M × N. (we select three sequences (x 1 , x 3 , and x 5 ) from the system in (1)).

5:
Sort L in ascending order and return their positions in vector S.

6:
Permit the image vector P to generate newly shuffled sequence R as follows: Convert the sequence R into the matrix R and divide it into sub-blocks, each with size 2 × 2.

8:
Get the Chipper image C by multiplying each 2 × 2 sub-block in R with the Fibonacci Q matrix (Q 10 ): Let I = C then i = i + 1. 10: Replicates steps 2 TO 8 for i <= 2.

Tests and Results
The proposed algorithm's effectiveness was tested using different standard grayscale images (Baboon, Pepper, Boat, Airplane, and Lena) with sizes 512 × 512 and 256 × 256. Additionally, the proposed algorithm compared with existing algorithms for image encryption. All performed experiments executed using MATLAB (R2015a) with a Laptop computer equipped with Core i5-2430M 2.4GH CPU and 4 GB RAM.
Eight experiments were performed to evaluate the proposed encryption algorithm using entropy, correlation coefficients, differential attack, noise and data cut attacks, histograms, keyspace, key sensitivity, and NIST Statistical Test.

Entropy
The image randomness measured by entropy can be defined by: where the occurrence probability of m i is P(m i ); the number 2 w refers to the total number of m i , where the total number of image pixels is represented by the integer w. An ideal value of entropy for gray images is 8. The entropy of a few gray images encrypted using the new and existing algorithms [44][45][46][47][48] shown in Tables 1 and 2. Our proposed method records the highest average entropy value. Additionally, our proposed algorithm is tested on 10 images of the size 512 × 512, and 10 images of the size 256 × 256 are selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness. is tested on 10 images of the size 512 × 512, and 10 images of the size 256 × 256 are selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness.

Average
Plain image selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness. selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness. selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness. selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness. selected from SIPI datasets. The average of entropy values for each image size obtained using our proposed algorithm is listed in Table 3. Then, the results are compared with methods [44][45][46][47][48]. All entropy values for the chipper images that encrypted with the new method approached 8. The chipper images encrypted using the proposed encryption method have the highest randomness.

Correlation Coefficient
Generally, the input images' adjacent pixels have a high correlation in the diagonal, horizontal, and vertical directions. A successful encryption algorithm must minimize this correlation. Any two neighboring pixels, x and y, have the following correlation coefficient: where the integer T refers to the total number of adjoining pixels; D(x) and E(x) are the variance and expectation of x, respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0. In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions.  Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image.

Method
where the integer refers to the total number of adjoining pixels; ( ) and ( ) are the variance and expectation of , respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0.
In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions. Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image. where the integer refers to the total number of adjoining pixels; ( ) and ( ) are the variance and expectation of , respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0. In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions. Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image. where the integer refers to the total number of adjoining pixels; ( ) and ( ) are the variance and expectation of , respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0. In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions. Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image. where the integer refers to the total number of adjoining pixels; ( ) and ( ) are the variance and expectation of , respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0. In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions. Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image. where the integer refers to the total number of adjoining pixels; ( ) and ( ) are the variance and expectation of , respectively. In the successfully encrypted image, the correlation between adjoining pixels should approach 0. In this experiment, nearby pixels are grouped in pairs, where 40,000 of these pairs are randomly selected, then the correlation coefficients computed for the three directions. Tables 4 and 5 shows the encrypted images' calculated correlation coefficients' absolute values using the new and existing image encryption algorithms [44][45][46][47][48]. The average coefficient correlations for the new encryption algorithm are very close to 0. All the results confirm that our proposed algorithm can remove the correlation between adjacent pixels in the encrypted image.

Differential Attack
In this attack, the attacker aims to decrypt the encrypted images without using the key through determining the relation between original and encrypted images. Therefore, small pixel changes in the original image significantly affect the encrypted image, making it more difficult for attackers to crack the encrypted image. Successful algorithms for image encryption must resist this attack. Robustness to this attack based on the Number of Pixels Change Rate (NPCR) and Unified Average Changing Intensity (UACI): The symbol C 2 refers to the chipper image that encrypted from the original image by changing only one pixel, while C 1 refers to the chipper image encrypted from the same plain image. Table 6 shows the computed values of the five gray images encrypted using the proposed and the existing image encryption algorithms [44][45][46][47][48]. In addition, the average values of NPCR and UACI of the images selected from SIPI datasets are presented in Table 7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48]. Table 6. Number of Pixels Change Rate (NPCR) and Unified Average Changing Intensity (UACI) of the encrypted image using different encryption algorithms.

Size Method
ues of NPCR and UACI of the images selected from SIPI datasets are presented in Table  7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48].  Table  7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48].  Table  7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48].  Table  7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48].  Table  7. To confirm the efficiency of our algorithm, the results are compared with other methods [44][45][46][47][48]. As mentioned in [49], the critical values of NPCR and UACI are N * α and u α , respectively, which are calculated as follows: To resist the differential attacks, the value of NPCR for the encrypted image should be larger than N * α , and the value of UACI should be in the range of (u * − α , u * + α ). When significant level α = 0.05, then N * α = 99.5693% and (u * − α , u * + α ) = (33.2824% , 33.6447%) for the image with size 256 × 256. However, when the size of the image is 512 × 512, the N * α is 99.5893% and (u * − α , u * + α ) = (33.3730%, 33.5541%). In Tables 6 and 7, the values that did not pass the test are displayed in bold. Our proposed algorithm achieves the highest pass rate compared to other methods, reflecting excellent robustness of the differential attack.

Noise and Data Cut Attacks
When images are transmitted over the network, they are vulnerable to noise or cropping (data cut). Successful image encryption algorithms should have robustness against noise and cropping attacks. The well-known measure, PSNR (peak signal to noise ratio), is used to evaluate the decrypted image quality. Mathematically, for original and decrypted images, I O and I D , the PSNR is: where MSE refers to the mean square error: A higher PSNR value reflects high image quality. For a PSNR > 35, original and decrypted images are indistinguishable.
This experiment was performed to test robustness against noise and data cut attacks. In this experiment, an encrypted image is contaminated with "salt and peppers" noise of 2 different levels, 0.002 and 0.005, decrypted using the new method. The encrypted images were also attacked by a data cut of 128 × 128 and 64 × 64 and then decrypted using the new algorithm. The PSNR for the five tested images with noise and data cut with a size of 512 × 512 is shown in Table 8. The new algorithm is robust against "salt and peppers" noise with density 0.002, where all values of PSNR are approaching 30db. When the level of noise increased to 0.005, the average value of PSNR decreased to 25.6db. For the data cut off size 64 × 64, the PSNR values are around 24db, and the decrypted image's content is visible. Moreover, when the encrypted image is attacked with the data cut off size 128 × 128, a relatively big cut off (i.e., the encrypted image lost 1/8 information), the PSNR is decreased to 18dB. Despite the reduction in PSNR values, the decrypted image is recognizable. Figure 2 shows the noise and data cut attacks for an encrypted image, demonstrating that the reader can easily recognize the decrypted images' content in different cases (i.e., noise, data cut). Therefore, the new algorithm is durable and resistant to these attacks. cut off (i.e., the encrypted image lost 1/8 information), the PSNR is decreased to 18dB. Despite the reduction in PSNR values, the decrypted image is recognizable. Figure 2 shows the noise and data cut attacks for an encrypted image, demonstrating that the reader can easily recognize the decrypted images' content in different cases (i.e., noise, data cut). Therefore, the new algorithm is durable and resistant to these attacks.

Histograms
Visual representation of image pixels distribution is called "Image Histogram," used to evaluate image encryption algorithms. A successful algorithm for image encryption must generate a flat histogram for the encrypted image.
Three standard gray images, Peppers, Airplane, and Boat, encrypted using the new algorithm. The histogram of the original and encrypted images displayed in Figure 3. Based on the distinguishable contents of the original images, their histograms are different. On the other side, the encrypted images have very similar and uniform histograms. Attackers are not able to recover the original images from encrypted image histograms. To ensure the uniform distribution of the histogram, the chi-square test is calculated by the following equation:

Histograms
Visual representation of image pixels distribution is called "Image Histogram," used to evaluate image encryption algorithms. A successful algorithm for image encryption must generate a flat histogram for the encrypted image.
Three standard gray images, Peppers, Airplane, and Boat, encrypted using the new algorithm. The histogram of the original and encrypted images displayed in Figure 3. Based on the distinguishable contents of the original images, their histograms are different. On the other side, the encrypted images have very similar and uniform histograms. Attackers are not able to recover the original images from encrypted image histograms. To ensure the uniform distribution of the histogram, the chi-square test is calculated by the following equation: where O i refers to the recurrence rate of the grey value i; EV = O/256 is the expected frequency of each grey value. Assume a significant level of 0.05, χ 2 (255.05) = 293.2478. The histogram of the encrypted image is considered to be uniform if the value of χ 2 is less than 293. Here we calculate the χ 2 for the encrypted images and record the results in Table 9. All values in Table 9 are less than 293, so the histograms of images encrypted using the proposed algorithm have uniform distribution. These results ensure the efficiency of the new algorithm.

Keyspace
The keyspace size is crucial in the encryption process. The encryption algorithm is robust to brute force attacks if its keyspace size >2 100 . The proposed encryption algorithm has different security keys: x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , N 0 , a, b, c, d, e, and r. If we assume the accuracy of the initial value equals to 10 16 , then the total keyspace is larger than N 0 × 10 96 , which shows robustness to the brute force attack.

Key Sensitivity
Successful image encryption algorithms must show high sensitivity to the secrete keys, which results in a noticeable change in a decrypted image with minimal modifications in initial conditions of the utilized secrete key used in the encryption process. An experiment was performed to test the key sensitivity of the new algorithm. The original image of "Lena" encrypted using the initial conditions (0.1, 0.1, 0.1, 0.1, 0.1, and 0.1). Figure 4a

Keyspace
The keyspace size is crucial in the encryption process. The encryption algorithm is robust to brute force attacks if its keyspace size > 2 100 . The proposed encryption algorithm has different security keys: 1 , 2 , 3 , 4 , 5 , 6 , 0 , , , , , , and . If we assume the accuracy of the initial value equals to 10 16 , then the total keyspace is larger than 0 × 10 96 , which shows robustness to the brute force attack.

Key Sensitivity
Successful image encryption algorithms must show high sensitivity to the secrete keys, which results in a noticeable change in a decrypted image with minimal modifications in initial conditions of the utilized secrete key used in the encryption process. An experiment was performed to test the key sensitivity of the new algorithm. The original image of "Lena" encrypted using the initial conditions (0.1, 0.1, 0.1, 0.1, 0.1, and 0.1). Figure 4a  The key is modified with only one-bit difference (0.1, 0.1, 0.1, 0.1, 0.1, and 0.1000001). The decryption process with the modified key failed to restore the original image, as shown in Figure 4c. On the other side, decryption using the original secret key successfully recovered the original image, as displayed in Figure 4d. The key is modified with only one-bit difference (0.1, 0.1, 0.1, 0.1, 0.1, and 0.1000001). The decryption process with the modified key failed to restore the original image, as shown in Figure 4c. On the other side, decryption using the original secret key successfully recovered the original image, as displayed in Figure 4d.

NIST Statistical Test
A good encryption algorithm should produce an encrypted image with high randomness. The NIST statistical test suite provides statistical tests to respect the randomness of the sequence generated with the encryption algorithm. The significance level is set to 0.01 for all tests in NIST. In this experiment, we calculate p-values for encrypted peppers image of a size 512 × 512, which is being changed into a binary sequence. Then we record the results for different statistical tests in Table 10. The p-values ≥ 0.01 and indicates the randomness of the binary sequence. From the results, we can see that the sequence generated using the proposed algorithm passed all tests, which assures the randomness of the binary sequence.

Computational Complexity
The steps required to perform the encryption process are used to measure the computational complexity of the algorithm.