Image encryption under spatial domain based on modify 2D LSCM chaotic map via dynamic substitution-permutation network

Received Sep 15, 2020 Revised Dec 25, 2020 Accepted Jan 13, 2021 Image encryption has become an important application aspect of information security. Most attempts are focused on increasing the security aspect, the quality of the resulting image, and the time consumed. On the other hand, dealing with the color image under the spatial domain in this filed is considered as another challenge added to the proposed method that make it sensitivity and difficulty. The proposed method aims to encode a color image by dealing with the main color components of the red (R), green (G), and blue (B) components of a color image to strengthen the dependence of each component by modifying a two dimensional logisticsine coupling map (2DLSCM). This is to satisfy the statistical features and reduce timeconsumption, and benefit from a mixing step of the second of advanced encryption standard (AES) candidates (serpent block cipher) and modified it to achieve in addition of confusion and diffusion processes. The experimental results showed that our proposed method had the ability to resist against statistical attacks and differential attacks. It also had a uniform histogram, a large key space, complex and faster, closer Shannon entropy to 8, and low correlation values between two adjacent pixels compared with other methods.


INTRODUCTION
In one hand, color image is popularly used in the world in different applications in (e.g., politics, economy, and education), on the other hand; because of the friendly programs/applications that simplified the work of different attacks continued its work to penetrate an encryption algorithm of a color image. Several encryption algorithms used 1D, 2D, 3D, and 4D; of a chaotic map depending on the need of encryption algorithm. Furthermore, chaotic systems are one of an important tool that are adopted to generate a secret key which is used on the encryption stage and this is what has been adopted in our proposed method which represents an important aspect of data security. On one hand; it deals with images directly in order to complete the encryption stage makes it within the interest of information security.
From this fact, our contribution to the security of both information and data is due to the methodology that is used to maintain the security of the proposed method that is developed to encrypt the color image. There are different researches about image encryption in spatial domain by using a chaotic

ADVANCED ENCRYPTION STANDARD (AES)
AES is a symmetric square code, which has capacity for encryption and unscrambling information in blocks as the states that changed over at each phase of encryption or unscrambling measure. Then again, the key is shown up as a square exhibit of a few bytes, where any key is comprehensive into a framework of keys that booked words. Each word has a size of four bytes, so; when utilizing 128˗bits, the entire key of timetable is 44 words with the size of (128) bits by utilizing a few key scopes of (128) bits, (192) bits or (256) bits separately. Which is demonstrated as: AES˗128, AES˗192 or AES˗256 as the key reach, AES tasks are done in two measurements exhibited with size of 4×4 bytes known as the states that changed over at each phase of encryption or unscrambling measure. Furthermore, the key is shown up as a square cluster of a few bytes, where any key is comprehensive into a grid of keys that booked words. Each word has a size of four bytes, so, when utilizing 128˗bits, the entire key timetable is 44 words [22].

THE PROPOSED METHOD 3.1. Statement of the problem
The problem that is encountered here is how to deal with the main color components (red, green and blue) separately due to the naturalness of each sub-bands and how this is done with the algorithms that are used in our proposed method. On the one hand, the process of mixing these main color components is very important and sensitive to any error in the mixing stage such as mathematical calculations or encryption stage or others. On the other hand, the consuming time during the mixing and encryption stage is possibly exploited by attackers through statistical attacks or clear text recognition attacks to capture information about the clear image.
From this standpoint, our contribution in the proposed method is to develop a method that has to have the ability to encrypt/ decrypt the color image based on chaotic system by using several encryption algorithms by mixing the main color components R, G, and B through dealing with each sub-color in parallel after dividing the original image into 4×4 blocks and then mixing the main color components R, G, and B in order to increase the chaotic aspect of the 2D LSCM function, which leads to an increase in the dependence of the color components on each other to increase the complexity in order to make it difficult to break the security aspect of the proposed method, as a result that will produce a substitution-permutation network to achieve the statistical characteristics and reduce the time consumed. The color mixing and modification enhance the strength of the serpent encryption algorithm, which is the second candidate of the algorithms that used in the block encryption stage after AES. All these contributions are suggested in the proposed method in addition to the encryption and decryption stages.

Random chaotic map
Our proposed method needs a 2D map in the proposed encryption method of color image. So, it modifies a 2D-LSCM that generates a sequence of random keys to improve a permutation and substitution for encryption a color image. The original 2D-LSCM is described in (1) as [28]: where: , , [0.1], where we modify of 2D-LSCM is described in (2) by applying a random variant generation (Uniform distribution) = + ( − ) on (1) and then computing a modulation of the average result random variant . Where is either +1 or +1 from (1): where: avx is average of result sequence of +1 in (2) and avy average of result sequence of +1 in (2). Figure 1, shows the difference of ( +1 , +1 ) values in the modified 2D-LSCM compared with the original map, for example "i=520, x (1) =0.8, y (1) =0.5, =0.99, a=10, b=50".  (2)) that indicates a random sequence of our modified LSCM map in (2) compared with its original in (1). Our proposed method used (2) to generate the two key sequences according to the following steps.

Dynamic permutation and substitution stages
The important process in the cryptography is a permutation and substitution stages that are used to investigate the confusion and diffusion according to Shannon theory. Diffusion means the relationship between the plain image and cipher image is complex, while the confusion means the relation between the cipher image and the key is complex and difficult to be understood. Even if an attacker somehow obtains one plaintext corresponding to one cipher text-a known-plaintext attack, a chosen plaintext or chosen-cipher text attack-the confusion and diffusion make it difficult for the attacker to recover the key. Even if an attacker somehow obtains one plaintext corresponding to one cipher text-a known-plaintext attack, a chosen plaintext or chosen-cipher text attack-the confusion and diffusion make it difficult for the attacker to recover the key. Figure 2 shows the sample permutation of 100 values of the image block. Figure 2

Mixing stage
The mixing stage in our proposed method is based on the AES, candidates (serpent block cipher) by using our proposed (2) to strengthen the dependence of each (R, G, and B) component on each other, satisfy the confusion-diffusion properties, and reduce time consumption. This step has other property that is simple, and it can be used in the modern processor with a minimum number of pipeline stalls [19]. Figure 4 shows a process of proposed mixing step, where it applies the following operations (XOR, round shift to left, and round to the nearest integer) with the generated key sequences and from (2).

Algorithm 3: The proposed mixing stage
Input : four blocks each with a same size. Output : new four blocks each with a same size. Begin 1. Apply round to left by one bit of 1st block. 2. Apply round to left by two bits of 3rd block. 3. Get a new 2nd block by doing XOR operation for old 2nd block with the resulted blocks from steps 1 and 2. 4. Generate a sequence of random key from x in (2). 5. Get a new 4th block by doing XOR operation for old 4th block with the resulted blocks from steps 2 and 4. 6. Apply round to left by three bits of resulted block from steps 3. 7. Apply round to left by four bits of resulted block from steps 5. 8. Get a new 1st block by doing XOR operation for blocks in steps 1, 5, and 7. 9. Generate a sequence of random key from y in (2). 10. Get a new 3rd block by doing XOR operation for blocks in steps 2, 7, and 9. 11. Apply round to left by five bits of resulted block from steps 8. 12. Apply round to left by six bits of resulted block from steps 10. End;

Encryption stage
The general diagram of our proposed encryption method illustrated in Figure 4 after an agreement between the sender and receiver about the initial values of the map, the sender generates the two key sequences by using (2). At first, read a color image size of (256×256) and divide it into four blocks each size of (64×64), then apply initial permuted and substituted of these blocks using algorithm 1 and 2, respectively to produce permuted and substituted blocks. After that, perform a proposed mixing step in algorithm 3 and also apply a final permuted in algorithm 1 to produce the encrypted image, as in the encryption stage illustrated in the following algorithm, while Figure 4 shows the block diagram of encryption stage:

Algorithm 4: Encryption Stage
Input : Color image with initial value of map (i, x (1), y (1), , a, b) Output : Cipher image. Begin 1. Read the plain image and padding it with zero to get a square image (n×n) size. 2. Divide the original image into four sub-images ( 1 , 2 , 3 , 4 ) each one with size of m×m. 3. Reshape these sub-images into 1D each one with a size of (m × m × 3). 4. Generate a sequence of the key with length (m × m ×3) from and of a modified LSCM chaotic map from (2). 5. Using algorithm 1 to initial Permute an odd sub-image ( 1 and 3 ) by sort a random sequence key and permute an even sub-images ( 2 and 4 ) by sort a random sequence key . 6. Using algorithm 2 to create four dynamic Substitution-Box (8 × 8 S-box) to substitute the resulted permuted sub-images ( 1 c. To create an even S-box ( 2 ) by permuting an index from (0 to 255) by using an ascending sort of a random sequence key to substitute the element of 2 ′ , d. Another side to create ( 4 ) by permuting an index from (0 to 255) by using a descending sort of a random sequence key to substitute the element of 4 ′ . 7. Using algorithm 3 to apply a proposed mixing step between the outputs from step 6 ( 1 ′′ , 2 ′′ , 3 ′′ , 4 ′′ ):

Decryption stage
On the other hand, the receiver generates the same two key sequences by using (2) that is generated by the sender that needed in decryption stage after reversing the processes in the encryption algorithm. At first, read an encrypted image (256×256) and divide it into (4×4) blocks each size of (64×64), then apply refinal permuted of these blocks by using the reverse of algorithm 1 to produce a re-permuted block. After that, perform a proposed mixing step by the reverse of algorithm 3, then apply the reverse of algorithm 2, and 1, respectively to produce re-initial permuted and re-substituted blocks to get an original image. The following algorithms that are described in Figure 4. Where the symbols ( 1 , 2 , 3 , 4 ) are the sub-images of a color image; the symbols ( 1 , 2 , 3 , 4 ) are sub-images of encrypted image; the symbol (1D m×m×3) means concatenate R, G, and B components into one dimension.

PERFORMANCE AND SECURITY ANALYSIS
This section shows the security and statistical analysis of the proposed method and comparison with other methods. This section uses R, G, and B histogram, entropy, correlation with adjacent pixel, NPCR with UACI for differential attack test, key sensitivity, key space size against brute force attack, and time complexity measurement. The results below show the results that are compared with other methods.

RGB histogram
A good encryption method has a histogram graph like a noise. So, our encryption algorithm tested with five different samples of color image (it takes into consideration image texture). These images are different in R, G, and B components as shown in Figure 5, it gives the R, G, and B histogram for the original image and its encrypted. The R, G, and B histogram of encrypted images in all experiments has a uniform form, as in Figure 6, however, this shows the confidence and strength of our proposed method and it can hide the original image information from the attacks.

Shannon entropy
The entropy test is a measure of information that closes to a random source. This test can be computed as (3).
Where M is the number of a symbol, ∈ s, p ( ) is the probability of occurrence of symbol , a log is denoting as base 2 logarithm. An ideal standard information entropy value is 8 [26]. From Table 1, note that our proposed method is close to 8 (range from 7.96823 to 7.99907) and it is secure against entropy attack, thus the entropy comparison assessed between our proposed method and the other methods is illustrated in Table 2.

Correlation analysis of two adjacent pixels
In the plain image, the pixel has high correlate with its adjacent pixel in the horizontal (H), vertical (V), and diagonal (D) location while in the encryption image the correlation is decreased. The correlation between adjacent pixels is measured according to (3), and the results are illustrated in Table 3.   Table 3, shows that the correlation of plain image is high while in the encryption image is decreased, also; Figure 7 shows this correlation for each of the five samples. While Figure 8 shows the correlation of encryption, image is similar of all samples that are used, and Table 4 shows the correlation analysis (H, V, and D) with other methods where the image sample is "Lena", because it is smoothed (standard). From Table 4, our proposed method has low correlation values (with sample Lena) that compared with other methods, while Table 5 shows the results of correlation analysis (x, y) between our proposed method and others, where image sample "Baboon" is used (high texture).   -0.0031 [18] 0.0315 Our Proposed Method -0.0044

Differential attack
This type of attack is one of the common attacks in the cryptography. It is the comparison between the encryption of plain image and the encryption of changing one pixel or more (even one bit) of the plain image. NPCR and UACI are the two standard methods to measure this property as (7) and (8), respectively [2].
The standard value of NPCR is ⋍99 and UACI⋍33, Table 6 shows that our proposed method is survived under different attacks, while Table 7 presents the comparative value of NPCR and UACI that test with the other method.

Key sensitivity
Encryption algorithm should be sensitive to a secret key that means that encrypted method cannot be decrypted correctly if there is only a slight change in the secret key. The proposed method has a key sensitivity when changing only one parameter of the secret keys and keeping all other keys unchanged. The secret keys in our modified (2) are (i, x (1), y (1), a, b, ). Figure 9 shows the sensitivity of x and y in the developed (2) with the change of one parameter (e.g., x (1)=0.7 or by (1)=0.6), since this property enables our proposed method to immune against the cipher text and plaintext attack.

Brute force attack
Key space size is the total number of different keys that can be used for the encryption algorithm; it should be large enough to resist the brute force attack. The precision of initial values and the parameter of the proposed method are (10 16 ). The key space size of secret keys is (10 16 ) . The number of initial values and parameters is k=8 (i, x (1), y (1), a, b, , avx, avy). Then the key space size is the sum of two sequences generated of (2) ( and ), respectively ((10 16 ) 8 +(10 16 ) 8 ), therefore; at least the key space size of our proposed method is (10 256 ), it is large enough against brute force attack.
Another calculation of key space size in binary; for the most used double-precision floating-point format which usually refers to binary64, the key space (as specified by the IEEE 754 standard) is 2 52 [25]. The number of initial values and parameters is k = 8 (i, x (1), y (1), a, b, , avx, avy), then the key space size is the sum of two sequences generated of equation 2 ( , ), respectively ((2 52 ) 8 +(2 52 ) 8 ) so that the at least key space size of our proposed is (2 832 ). The key space should be greater than the 2 200 ≈10 30 [7] to withstand or be resistant to the brute-force attack. From these calculations; our proposed method has larger key space that it is enough and resistant against brute force attack.

Time complexity
In our proposed method, the computational cost consists of generating 2D-LSCM key sequence, initial and final permutation, substitution and mixing steps in parallel. A two key sequences ( , ) with length M×N are generated. So, the computational cost is Θ (2×M×N). The cost of initial and final permutation processes is Θ (2×M×N). The cost of substitution process is Θ(M×N). The cost of mixing steps (XOR, <<< and round to nearest integer) is Θ (3×M×N). The total time complexity in our encryption and decryption stages is Θ (8×M×N). The time complexity of the proposed algorithm is lower. Hence the speed of our encryption scheme is faster compared with the related work [25] that has Θ (9×M×N).

CONCLUSION
In this paper, a color image encryption algorithm using a chaotic system based on modified 2D LSCM under the spatial domain has been proposed. Our proposed method deals with a set of main and important axes in addition to the proposed contributions to achieve the desired goal of the proposed method, as dealing with the color image is a major challenge in this area due to the variation and difference in the nature of the colored images, on the other hand, the encryption stage is subject to a set of standards of the task that is adopted, such as the security aspect, the time consumed, the quality of the resulting image, in addition to the fact of dealing with the chaotic system in this area requires us to achieve a set of determinants on the basis of which chaotic systems are built. All of this adds to the task of harnessing all the tools and algorithms and the proposed contributions for encryption the color image under spatial domain. The process of dealing with the contrast and difference in the nature of color images is exceeded in the proposed method of taking advantage of the characteristics of the color mixing algorithm and dealing with the main color components R, G, and B in parallel.
On the other hand, the benefit from the characteristics of the chaotic system is evident through the development of modified 2D LSCM chaotic map, which was tested and found to meet the criteria for chaotic systems of randomness, and complexity, in addition to using known and approved encryption algorithms in order to achieve the goal of the research. It is accomplished in parallel by using 2D LSCM to generate a random key sequence that are used to create a dynamic substitution-permutation network to satisfy the confusion-diffusion properties and to reduce the time consumption. From the map that is presented, a dynamic S-box (substitution stage) is proposed, and the mixing stage of the second AES candidates (serpent block cipher) is modified to strengthen the dependence of each R, G, and B component on another and achieved in addition confusion and diffusion stages.
The results that are arrived at show the success of the proposed method in encoding the color image while maintaining the confidentiality and security of the proposed method in addition to obtaining a highquality encrypted image. The time factor has been controlled, and sometimes the time taken has been reduced due to the image texture. It makes the process of mixing the main colors less complicated, such as standard image. As for high texture image or painted images, the time taken is more, but in general it is less than others, and it has been controlled by the proposed method, which is another contribution to us. Our proposed method is sensitive to any change in the initial value of chaotic map. Furthermore, it has a better statistical feature that immune against statistical and differential attacks, the large key space against brute-force attack is obtained with low correlation values between two adjacent pixels. Our proposed method has a uniform histogram against chosen-plaintext and cipher text attacks; it has complexity and it is faster after compared with other methods.
The proposed method dealt with an important aspect of information security in terms of dealing with the color image, and on the other hand, the development that was addressed in the mechanism with the use of the chaotic system and the mathematical equations that were modified and used are considered as a contribution to the aspect of data security, it has been tested under several well-known tests in this field, which is considered an important criterion in knowing the strength and success of the proposed method, and the results show the possibility of the proposed method to pass all tests and succeed in them, as detailed in the results of the section.