New Encryption Algorithm Using Bit-Level Permutation and Non-Invertible Chaotic Map

Recently, a little research into image encryption has been used on chaotic economic maps. The current paper suggests a bit-level permutation and a non-invertible chaotic economic map to encrypt an image. Firstly, the secret key generation is linked to the plain image. So, the suggested algorithm may resist both known-plaintext and chosen-plaintext attacks. Then a bit-level permutation is performed for all the binary bits of the plain image’s pixels, using the logistic map (permutation stage). It is used to improve the algorithm’s security. Then pixel diffusion is applied using the 2D non-invertible chaotic economic map and bit-wise XOR operations. It is used to change the pixels’ values and make them highly random. The results of the experiments and the security analyses show that the given image encryption algorithm is efficient with higher security. Some comparisons showed that the proposed algorithm outperformed many recent algorithms. Finally, the proposed algorithm may be able to withstand a variety of attacks.


I. INTRODUCTION
Multimedia communication has become increasingly useful as information technology and the internet have fast growth. Digital images are a major player in multimedia communication and are used in many fields, such as biology, medicine, the military, and social life. Since large amounts of data are carried in digital images and are widely disseminated on the internet, the protection of the data embedded in these images has become a significant and pressing issue. Digital images have certain inherent characteristics that text content does not, such as low entropy, high levels of redundancy, high correlation and large data capacities. Cryptography is one of the three methods which are used to protect digital images. The other two ways are steganography and watermarking. Steganography is the method of concealing a secret message (plain image) inside another message (cover image). Watermarking is the technique of embedding some identification information known as a watermark into the digital data by its owner. Cryptography is the process of encoding secret data via an algorithm that transforms data in such a way that unlicensed users can't read it [1]. Classical algorithms like The associate editor coordinating the review of this manuscript and approving it for publication was Jiafeng Xie. DES and AES are weak to carry out image encryption [2]. These methods are not suitable for digital images with a high degree of redundancy and correlation between adjacent pixels [3]. As a result, new algorithms must be proposed.
In [4], the authors presented a color image algorithm based on an enhanced evolutionary algorithm and the matrix semi-tensor product. A double color image encryption algorithm is suggested via combining 2D compressive sensing with an embedding technique [5]. In [6], the authors presented an image encryption algorithm using 2-D compressive sensing with a multi-embedding strategy. A color image compression and encryption algorithm is described based on compressive sensing and a double random encryption technique [7].
Chaotic systems are perfect for encryption of the image because of their sensitivity to initial values and control parameters, ergodicity, excellent pseudo-randomness, and determinism. As a consequence, several encryption techniques, methods and algorithms using chaotic maps have been proposed [8]- [12]. In [13], the authors proposed a new image encryption scheme via permutation-substitution networks and chaotic. Image encryption using new beta chaotic maps is described in [14]. In [15], the author presented an encryption algorithm using a cubic S-box and chaos. VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ A new image encryption using DNA approach and 2D Hénon-Sine map is given in [16]. The authors in [17] presented an image encryption via Henon chaotic map with nonlinear term. An algorithm via diffusion of Household and Tent-Dynamics coupled map lattices is given in [18]. In [19], an image encryption using compressive sensing and chaos systems is proposed. An image encryption scheme using double chaotic cyclic shift and Josephus problem is given in [20]. In [21], an algorithm via random dynamic mixing is proposed. All these algorithms used pixel permutations in which the position of the pixel is changed, but its value did not change. In bit-level permutation, the pixel position and value are both changed [22], [23]. In this paper, the permutation-diffusion model will be used. The bit-level permutation is applied during the permutation stage. For the diffusion stage, chaotic discrete dynamical systems possess some complicated characteristics such as bifurcations and chaos which have been reported in the literature. Indeed, such systems contain several parameters that are responsible for such characteristics. Any minor changes in the values of those parameters may result in distracting behavior in the future evolution of such systems. For these reasons, such chaotic systems have been adopted in the cryptographic process.
In the current paper, we recall a more chaotic economic map introduced in [26]. Recent research has revealed that such systems have poor bifurcation and chaos as complicated properties on which they rely. In such systems, many types of bifurcations, such as folds, transcritical, and Neimark-sacker bifurcations, have been described and studied. When compared to other maps, such as the logistic map, the number of open windows in chaotic economic systems is low. On the other hand, there are few studies in the literature that use such economic systems in the encryption process. These systems are capable of providing a secure cryptographic technique [27]. Our contributions to the current paper are: • calculated the secret key by the key mixing proportion factor based on the plain image [28], which is not fixed.
• applied the bit-level permutation on all bits of the plain image at once using a logistic map.
• used the Cournot Duopoly map, which is a competition game that exhibits a wide range of interesting phenomena, such as coexisting complex attractors and chaotic behaviors. The provided map is used to create random bits on the sender and legitimate receiver sides, which are then used in reliable data encryption.
• performed the analysis of the proposed algorithm for a secure and efficient image cipher.
• according to simulation and security analysis, the proposed algorithm provides a greater level of security than other image encryption algorithms.
The remainder of this paper is structured in the following manner. The 2D non-invertible chaotic economic map is presented in Section 2. In Section 3, the secret key generation is discussed in depth. The proposed algorithm is given in Section 4. In Section 5, we examine the proposed image ciphers' security and results using histogram analysis, histogram statistics, information entropy analysis, key space analysis, correlation analysis, key sensitivity analysis, and other analyses. Section 6 gives the conclusion.

II. THE 2D NON-INVERTIBLE CHAOTIC ECONOMIC MAP
In [26], the authors introduced the nonlinear discrete dynamic map which is utilized to represent the dynamics of Cournot Duopoly game. In the economic market, Cournot Duopoly games attract many researchers because of their dynamic characteristics. The Cournot Duopoly game consists of two competing firms (or players or companies) and the interaction between those firms gives rise to complex dynamic behaviors that support economic markets with important expectations. Such kinds of games are defined by a two-dimensional map that is used to study the dynamic characteristics of such games. The authors calculated the fixed points for the map. They also examined their stability conditions, which attracted some chaotic behaviors due to the complex dynamics of the map being studied. They came to the conclusion that the game's map is non-invertible of the type Z 4 − Z 2 . The map is given as follows: where x and y represent the quantities produced by the two companies.
The chaotic map (1) has six parameters, a, c, d, ω, ν 1 , and ν 2 . These parameters are economically significant; the maximum price represented by the constant a > 0 while the product differentiation represented by the constant d ∈ [−0.5, 1]. c > 0 denotes a fixed marginal cost parameter. The adjustment speed for the i th company is denoted by ν i , i = 1, 2 and the public ownership parameter is denoted by ω ∈

III. THE SECRET KEY GENERATION
The key mixing proportion factor can be used to calculate the secret key as follows [28]: The initial condition 0 is then modified using the equation: where 0 = x 0 , x 1 , y 1 . Then, choose three initial values, x 0 , x 1 , y 1 . On the other hand, the parameters µ, a, c, d, ω, ν 1 , ν 2 for the logistic map and map (1) are computed as follows: In the current section, when the parameters fall into these periodic windows, the chaos is lost. So, all parameters are chosen to avoid the periodic windows in the chaotic ranges of the used chaotic economic map (1).

IV. THE PROPOSED ALGORITHM
Our proposed algorithm depends on the bit-level permutation diffusion model. The primary advantage of bit-level permutation is that it changes the position and value of the pixels at the same time. The first stage is applying the bit-level permutation to the plain image. Then, the second stage is to diffuse the result values of the first stage into the chaotic map sequence using bit-wise XOR.

A. THE BIT-LEVEL PERMUTATION
In the current stage, let A be the plain image of size M × N . The logistic map is defined by the following formula: It's used to make a permutation of integers that's random. The aim of this stage is to shuffle the bits of the plain image according to the generated random integers. The bit-level permutation algorithm may be processed as in Algorithm. 1 The aim of this stage is to use the chaotic map (1) to generate a sequence of random bits of length 8MN . The algorithm for generating this sequence may be processed as in Algorithm. 2.

C. THE ENCRYPTION ALGORITHM
The proposed encryption algorithm will employ two sequences of random bits, B and C, via Algorithm 1 and VOLUME 9, 2021

Algorithm 1 Bit-Level Permutation Algorithm
Input: x 0 , µ and the plain image, A, with size M × N . Output: Sequence of random bits, S of size MN × 8.
Step 1: Reshape A M×N to A 1×MN .
Algorithm 2, respectively. The aim of this stage is to diffuse the pixels by making a bit-wise XOR between the bits of the shuffled image and the sequence of random bits which are generated by Algorithm. 2. The encryption algorithm may be processed as in Algorithm. 3. The flowchart of the proposed algorithm is shown in Figure 2. The proposed algorithm can work with binary images too. A binary image is one that is made up of pixels that can only have one of two colors: black or white. This means that there is only one bit for each pixel, 0 or 1. Our algorithm can be modified to convert the plain image to a single sequence of length MN instead of 8 MN , and the generated chaotic map sequence must also be of length MN . Also, the proposed algorithm can work with color images. Each pixel in a color image has three values (or channels).
Step 6: Reshape E 1×MN to E M×N , the cipher image.
One can apply our algorithm to each channel and combine all the three results to get the encrypted image.

D. THE DECRYPTION ALGORITHM
The decryption algorithm is the opposite procedure of the encryption algorithm. First, the sequence produced by the chaotic map (1) should be obtained. Then, the bit-wise XOR between the sequence and the cipher image is performed. Finally, the plain image is obtained by the bit-level permutation inversion operation. The decryption algorithm may be processed as follows:

V. EXPERIMENTAL RESULTS AND SECURITY ANALYSES
The proposed algorithm's results are presented and its performance using the most famous measurements, like histogram analysis, correlation coefficients, key space analysis, key sensitivity analysis, and differential analysis, is analyzed in the current section.

A. EXPERIMENTAL RESULTS
Algorithm. 3 Figure 3(b, e, h, k) displays the encryption results of four tested images. After applying the decryption algorithm, the original images can be exactly obtained as in Figure 3(c, f, i, l).

B. KEY SPACE ANALYSIS
One of the most important characteristics of a good encryption/decryption algorithm is a large key space, which is must be greater than 2 100 [29]. The space of secret key for the proposed algorithm is consists of three initial values, x 0 , x 1 , y 1 , one parameter for the logistic map, µ, and six parameters for map (1), a, c, d, ω, ν 1 , ν 2 . If the precision accuracy is 10 −15 then the secret key space is 10 15×10 = 10 150 which is greater than 2 100 . Therefore, the current algorithm can withstand brute force attacks.

C. KEY SENSITIVITY ANALYSIS
An effective and accurate algorithm must be sensitive to even minor changes in the secret key. The wrong plain image will be restored when the tiniest modifications of the secret key to decrypt the cipher image are used. The cipher image is decrypted using three different test keys chosen at random to test its sensitivity. The results shown in Figure 4 illustrate how minor changes to key parameters can yield incorrect images.

D. INFORMATION ENTROPY ANALYSIS
The gray value distribution of an image is expressed by information entropy, which is an important index of randomness.
The image's information entropy increases as the gray value distribution becomes more uniform. The information entropy (IE) is calculated as follows: where p(θ i ) denotes the probability of θ i . For the grayscale image, the exact theoretical value of information entropy is 8. Therefore, if it close to 8 then the attackers will have a difficult time decoding the cipher images. Table 1 presents the information entropies of plain and cipher images of all tested images. All cipher images in Table 1 have information entropies which are close to 8. The estimated local and global entropies for individual bit planes of the Lena image at size 256 × 256 are presented in Table 2. Table 3 compares the proposed algorithm to some recently published algorithms based on the information entropy of a Lena's cipher image of size 256 × 256.

E. HISTOGRAM ANALYSIS
The cipher image's histogram is a crucial property that shows whether the algorithm can withstand statistical analysis. It shows how an image's pixel values are distributed. An attacker can get a particular amount of information via statistical analysis if the distribution isn't uniform. As a result, a good image encryption must has a cipher image with uniform histogram distribution. The histograms for four tested images (Airplane, Cameraman, Moon Surface, and Peppers) are shown in Figure 5 before and after encryption. Before encryption, the histogram for each of the plain images wasn't uniform, but after encryption, the corresponding histogram for the cipher image was uniform. As a result, the proposed algorithm may complicate statistical analysis.

F. HISTOGRAM STATISTICS
To backing the results of visual examination in histograms, the variance and its standard deviation are used. The standard deviation is the square root of the variance. The lower the histogram variance, the more uniform the histogram is, which is evaluated via the following formula: where f i : The frequency for each intensity value in the histogram.
Also, the standard deviation is calculated by the following formula:   Table 4 shows VAR and S of the histogram for plain and cipher images. Based on the result of Table 4, the cipher images obtained by our algorithm have pixel values which are more uniform.

G. CORRELATION ANALYSIS BETWEEN ADJACENT PIXELS
In the horizontal, vertical, and diagonal directions, adjacent pixels in the plain image have a high correlation. The correlation coefficients of adjacent pixels in the cipher images should have a low enough correlation to withstand statistical attacks, according to an optimal algorithm. We randomly select 5,000 pairs of adjacent pixels from the plain image and its cipher image in each of the three directions to investigate and compare the two images based on the correlation coefficient. The correlation coefficient ρ xy for each pair is calculated using the formula: where x and y: the values of two adjacent pixels in the image, n: the total number of the selected pixels. Figure 6 shows the correlation coefficients of two adjacent pixels for the plain and cipher images of Lena's image via the proposed algorithm. On the other hand, the results are presented in Table 5 along with a comparison to some recent algorithms. The correlation coefficient of the plain image is close to 1 in all directions and is close to 0 in all directions for cipher image. Table 5 shows that the cipher image's adjacent pixels have a very low correlation. As a result, our algorithm can successfully withstand a statistical attack.

H. DIFFERENTIAL ANALYSIS
The algorithm's performance against differential attacks improves as the cipher image becomes more sensitive to  the plain image. A good image encryption algorithm should ensure that any small modification in the plain image causes a large difference in the cipher image to resist a differential attack. For differential attack analysis, the number of pixels change rate (NPCR) and the unified average changing intensity (UACI) are commonly used. These measurements have optimal values of NPCR = 99.6094% and UACI = 33.4635% [35]. They are computed as follows: (15) where: where C 1 and C 2 are two cipher images of the plain image and the modified plain image, with a, with a one-pixel difference. From each plain image, one pixel is selected randomly. The value of this pixel is changed to create a modified plain image, and apply Algorithm. 3 to obtain the two cipher images via the same secret key. For each image tested, 100 trials are run to determine the average NPCR and UACI values and the results are shown in Table 6. In addition, the average NPCR and UACI values for all tested images are recorded in Table 6. Table 7 compares the proposed algorithm to some recent published algorithms. The NPCR and UACI values, using the proposed algorithm, were a little higher than optimal values, showing that minor changes in the plain images resulted in entirely different generated cipher images. Also, the tested cipher images are random-like based on the critical values of NPCR and UACI [36].

I. CHOSEN/KNOWN-PLAINTEXT ATTACK ANALYSIS
It is well understood that an encryption algorithm that is resistant to chosen-plaintext attacks is also resistant to ciphertext-only and known-plaintext attacks [37]. The secret key of our algorithm is created based on a plain image. As a consequence, the secret key obtained from one chosen-plaintext attack cannot be utilized to decrypt other cipher images, meaning that chosen-plaintext attacks will fail. Assume the attacker has the cipher image and the proposed algorithm running for a limited period of time. The algorithm in [39] will be used to put our algorithm to the test against a chosen-plaintext attack. The following notations will be used in this algorithm: P: plain image, E P : cipher image of P, The plain image P is generated by performing XOR operations between the pixels of E P and E Z . Figure 7 shows that the decrypted image is entirely different from the plain image. As a consequence, our encryption algorithm is immune to chosen-plaintext attacks.

J. ROBUSTNESS ANALYSIS 1) QUALITY METRICS ANALYSIS
The Mean Squared Error (MSE) and Peak Signal-to-Noise Ratio (PSNR) can be used to assess the accuracy of digital images [40], [41]. The MSE is a metric to determining how different two images are. It is defined as follows: where P and D represent the plain image and the decrypted image, respectively. The size of the original image is M × N . The better the encryption efficiency, the lower the MSE value. On the other hand, the PSNR is the ratio of a signal's maximal potential power to the power of distorting noise, which influences the accuracy of the signal's representation. It is evaluated by: The smaller the MSE value, the higher the PSNR value, indicating that the images being compared are very similar.  The MSE between the plain Lena image with size (256×256) and the decrypted image using our algorithm is 0, and the PSNR is ∞. The results indicate that the image examined has high quality metrics.

2) OCCLUSION ATTACK ANALYSIS
To put the occlusion attack to the test, we chose 12.5%, 25%, and 50% occlusion in the Lena cipher image with a size of 256×256. The occlusion attack results are shown in Figure 8. Table 8 gives the MSE and PSNR between the cipher image with occlusion and its corresponding decrypted image. Also, the comparison between our algorithm and the recent algorithm in [37] is given in Table 8. The results conclude that the proposed algorithm can withstand an occlusion attack effectively.

3) NOISE ATTACK ANALYSIS
To test the proposed algorithm's anti-noise efficiency, the cipher image is corrupted by salt and pepper noise of various intensities. As a result, Lena's cipher image is altered by adding salt and pepper noise with intensities of 0.1, 0.15, and 0.20. Then, the modified cipher image is decrypted. Figure 9 shows the results. The MSE and PSNR between the plain image and the decrypted image are given in Table 8. Also, the comparison between our proposed algorithm and the recent algorithm in [37] is given in Table 9. It can be shown that after the noise image is decrypted, the original image can be restored in its entirety. As a result, the proposed algorithm has some anti-noise attack potential.

K. COMPUTATIONAL TIME ANALYSIS
The computational time was computed on a laptop with the following characteristics: a 2.40GHz processor, 12GB of RAM, and Windows 10. Table 10 shows the time of encryption and the time of decryption for the image of Lena.

L. NIST STATISTICAL TESTS
The NIST statistical tests are used to test the random characteristics of cipher images. The proposed algorithm generates one hundred cipher images of Lena 256 × 256 using different   secret keys. This paper chooses 15 statistical tests from NIST to check the random characteristics of 100 cipher images. Table 11 shows the results of the 15 tests. It concludes that the cipher images using the proposed algorithm passed all 15 tests. Therefore, our algorithm has a high degree of randomness. Statistical result of NIST test for 100 cipher images at x 0 = 0.001, a = 0.5, c = 0.2, d = 0.35, ω = 0.45, ν 1 = 5.9, ν 2 = 4.2 and random values for x 1 and y 1 between 0 and 1.

VI. CONCLUSION
In this paper, a new image encryption algorithm based on bit-level permutation and a 2D non-invertible chaotic economic map has been proposed. Since it is built on two chaotic maps and a bit-level permutation, it can overcome the common weaknesses of low-dimensional chaotic map and pixel permutation algorithms. The bit-level permutation and XOR coding strengthen the security of the algorithm. Experimental results for key space, key sensitivity, information entropy, histogram, and correlation between adjacent pixels analyses confirmed that our image encryption algorithm can be used to encrypt images efficiently. Based on differential attack, chosen/known-plaintext attack and robustness analyses, the proposed algorithm can be avoid different attacks. Also, the NIST statistical tests support that the proposed algorithm has a high degree of randomness. Therefore, the proposed algorithm can applied to image encryption. Since the logistic map depends on only one parameter, we can examine other maps like the Henon map, the Skew tent map, and the Gauss map. In future work, the authors should use quantum image encryption to increase the security of the algorithm.