3C3R, an Image Encryption Algorithm Based on BBI, 2D-CA, and SM-DNA

Color image encryption has enticed a lot of attention in recent years. Many authors proposed a chaotic system-based encryption algorithms for that purpose. However, due to the shortcomings of the low dimensional chaotic systems, similar rule structure for RGB channels, and the small keyspace, many of those were cryptanalyzed by chosen-plaintext or other well-known attacks. A Security vulnerability exists because of the same method being applied over the RGB channels. This paper aims to introduce a new three-channel three rules (3C3R) image encryption algorithm along with two novel mathematical models for DNA rule generator and bit inversion. A different rule structure was applied in the different RGB-channels. In the R-channel, a novel Block-based Bit Inversion (BBI) is introduced, in the G-channel Von-Neumann (VN) and Rotated Von-Neumann (RVN)- based 2D-cellular structure is applied. In the B-channel, a novel bidirectional State Machine-based DNA rule generator (SM-DNA) is introduced. Simulations and results show that the proposed 3C3R encryption algorithm is robust against all well-known attacks particularly for the known-plaintext attacks, statistical attacks, brute-force attacks, differential attacks, and occlusion attacks, etc. Also, unlike earlier encryption algorithms, the 3C3R has no security vulnerability.

The chaos system possesses a ramification of traits, which includes high sensitivity to initial conditions, determinacy, and ergodicity. Sequences produced by chaotic maps are habitually pseudo-random sequences, and their structures are very complicated and tough to be analyzed and foretold [17][18][19]. The typical ciphers primarily based on a chaotic map may be partitioned into two degrees: diffusion and permutation. In exercise, researchers frequently combine permutation and diffusion to get more computational security.
Because of the sensitivity and pseudo-randomness of the chaos, the chaotic sequences generated with the help of chaotic systems are intermittent and complicated. Researchers mostly encrypt the image in an early stage through the chaotic structures obtained by the low dimensional chaotic system, such as the one introduced in [20]. An image encryption technique with a new 1D chaotic system was proposed.
In [21] the author introduced 2D Logistic-Sine chaotic map-based image encryption algorithm. However, these sequences generated through low dimensional chaotic structures, and due to the inadequacy of the small keyspace cannot withstand against brute force attacks and thus possess the low security.
Conversely, Hyper-chaotic systems own larger keyspace and extra complicated dynamic features. Thus, the hyper-chaotic-based system can compensate for the shortcomings of a small keyspace of the low dimensional chaotic system and are more appropriate for the image encryption. In [22,23] the authors proposed a hyper-chaotic systems and fuzzy cellular automata-based novel image encryption algorithm that has higher security.
Sajid et al. [24] introduced a hybrid image encryption algorithm based on FSM and cellular automata accompanying DNA sequence. The algorithm has good results and also the concept of a local rule is appreciable with regards to algorithm efficiency. However, the shortcomings of the particular algorithm is its aimed for use only for grayscale images.
Huang et al. [25] proposed 7 dimensional CNN hyper-chaos-based application of image encryption scheme. Based on the results, the authors claimed that the hyper-chaotic systems are better than the low dimensional chaotic systems that own small keyspace. Astonishing information density, and the massive parallelism characteristics of DNA sequences, pushed the researchers to introduce collective hyper-chaos and DNA methods. Such collective technology schemes can be proved to be highly efficient and secure multimedia encryption schemes [26][27][28].
A new encryption algorithm for the color image was proposed in [29] that employs the hash-256 function to amend the control parameters and initial values of the chaotic system. The red, green and the blue channels of the image arranged into vector array form of one-dimensional. Then by rendering to the chaotic sequence generated by Piecewise Linear Chaotic Map 1-D vector array get sorted.
Nonetheless, in the utmost chaotic-based image encryption schemes that were stated above, the permutation phase and diffusion phase are autonomous of the plain image. Because the cryptosystem is impervious to the plain images and secret keys, such structures have the security flaws and cannot resist chosen/known-plaintext attacks or differential attacks. Table 1, listed some well known encryption algorithms that get successfully Cryptanalysis by the enlisted attack approach.
Therefore, after the analysis of above-mentioned papers, we proposed a novel three channel three rule (3C3R) color image encryption algorithm. We made three contributions to this paper with each having corresponding merits.
Thirdly, for the blue channel: a novel mathematical model of bidirectional State Machine (SM)-based DNA rule generator (SM-DNA) was proposed. The proposed model efficiently generates a random rule for each block-matrix. In each block-matrix i th and j th bit used as an input for the rule selection of next block-matrix. That means the bit arrangement of every predecessor block-matrix is responsible for the rule selection of the next block-matrix. The remainder of the paper organized as comply with; in Section 2: Literature survey/Preliminary work, Section 3: Proposed Image encryption scheme. Section 4: Experimental parameters and discussion while Section 5: Security analysis with the following Section 6: Conclusion and future work.
As in any image, the pixel values of each channel are the non-negative decimal numbers between 0 and 255, thus every pixel can be denoted by the binary sequence of 1-byte or 8-bits. Similarly, the whole image can also be decomposed into binary 8-bit-planes [50]. In such case, the i th bit-plane will comprise of all the i th bits of the binary demonstration of every pixel. Among these 2 3 = 8 bit-planes, most left bit-plane contains the highest significant visual information of the plain image, while the right most bit-plane contains the least visual information.

Scrambling Method
Scrambling is an easy and effective technique to lessen the correlation between the neighboring pixels. This paper introduced a one-to-one mapping for scrambling. Due to simultaneous changes of pixels in columns and rows, the proficiency of the algorithm enhanced enormously concerning time. The proposed algorithm has a one-to-one ratio between the pixels of scrambled image and the plain image, as displayed in Figure 1.
The pseudo-code of the scrambling method for Encryption process is described in Algorithm 1, while in the decryption process the same procedure is applied but using reverse shifting, as described in Algorithm 2.

Algorithm 1 Scrambling
Encryption Process: Input: Generate S(i, j) matrix equal to the size of Plain image matrix P(M, N). Output: T(m, n) size Scrambled matrix.

Novel Block Bit Inversion (BBI)
In this paper, we propose a novel blocked-based bit inversion technique to alter the pixel values. The Figure 2 is the graphical illustration of the proposed BBI structure for the image sub-matrix of the size M × N. Firstly, it divides the particular block matrix into two equal column blocks; labelled as Left bit Columns Blocks (LCB) and Right bit Columns Blocks (RCB). The purpose is to change the bits in every row and columns but in the opposite manner. It changes the particular bit 1 or 0 into opposite i.e., 0 if it is 1 or else 1 if it is 0. For each pixel, the change in value occurs (either addition or subtraction) depending upon either its get converted into 1 from 0 or get converted to 0 from 1. As each bit has a unique value, so because of bit inversion following change occurs in pixels based on the particular bit location.
For example, we can see in Figure 2 that for each binary blocks the bit selection is in opposite direction means LCB bit RCB bit for left and right columns blocks. For the left columns block the selection of bit is from left to right LCB bit =⇒ RCB bit and for the right columns block the selection of bit is from right to left LCB bit ⇐= RCB bit . How its locate; is illustrated in Figure 3. Like in main diagram for the 1 st row, 3 rd bit is selected for the inversion in left columns block which is actually 6 th while counting from right to left. In same passion, for the right columns block, 3 rd bit is selected that is actually 6 th when counting from left to right. So selection is the same for 3 rd bit but direction is opposite as Le f t Right. Thus, to select the particular bit in the novel BBI model, the formula efficiently locate the right and left block bits by proceeding only by the left to the right direction. The starting bit selection for each 8 × 8 blocks is based on the following formula.
Here i = 1, 2, 3, . . . , 8, where P is the pixel value of particular pixel, n is the block number multiplier to change the 1 st bit for each block, B is the byte (8 bits), mod is the mod function that returns the remainder between 0 to 7 because of B is one byte (8-bits), and R i is the particular row number range from 1 to 8.  For better understanding, Let suppose the decimal value of P for the 1 st sub-matrix came 183, so the value of left columns block (LCB bit ) for the 1 st row i = 1 or R i = 1 can be gotten as follows.
LCB n bit = [(n 2 × PmodB + 1) + R i ]modB + 1 Likewise, for the 2 nd row of this 1 st sub-block matrix, i = 2 or R i = 2 the inverting bit will be; Similarly, for the 3 rd , 4 th , 5 th to up to 8 th rows for every LCB n th bit , desired inverting bit can be gotten through the formula. Alternatively, the formula of the bit selection for the right blocks is as follows.
As an example, in the above case after putting values.
Similarly, for the 2 nd row, the bit will be following.
First of all, an initial configuration matrix of 8 × 8 is generated by the hash value of the key. Based on the above-mentioned formula of RCB bit and LCB bit , bit inversion is done over the initial configuration matrix (ICM t i ) and later this updated initial configuration matrix (ICM t+1 i ) is XORed with the first plain matrix. The general equation of XORing the updated (ICM t+1 i ) with the plain image matrices is as follows.
where n = 1, 2, 3, . . . , N; where N is the entire number of sub-matrices of the red channel. While SM t+1 i is the particular updated matrix, SM t i is the plain image sub-matrix of the red channel, and ICM t+1 i is the updated initial configuration matrix. Similarly, for the 2 nd sub-matrix bit inversion is performed over the updated initial configuration matrix of 1 st block stage and then XORed with the second sub-matrix of the plain image as follows.
For the decryption phase, the reverse process to get back the plain image matrix is as follows.

Two-Dimensional Cellular Automata
In this paper, a 2D-CA with VN and RVN structure was implemented as shown in Figure 4. Also, in cellular matrix form, every cell can have one of the two possible states that is either 1 or 0. In cellular representation every cell has its neighboring cells. The cell with VN neighbors or a radius equivalent to 1 can be represented in equation form as follow: In this Equation (7), δ is the Boolean function or a state transition function that takes to the new state, where δ : C × ∑ → ρ(C). Like VN, the cell with Rotated VN neighbors can be represented as follow.
So, to get the combined structure of VN and RVN, We merged these two equations as follows.
We represent these 9 state variable with C NW : C N : C NE : C W : C 0 : C E : C SW : C S : C SE , as shown in Table 2. For the green channel as the bit depth or intensity is 2 8 so, we mapped the above mentioned 8 state variables with these eight bits as C NW ; C N ; C NE ; C W ; C E C SW ; C S ; C SE = [1; 1; 1; 1; 1; 1; 1; 1], while excluding the central state variable C t 0(0,0) represented as C 0 . Finally, the confined rule structure is based on the following equation.
In this updated form of Equation (10); C NW , C N , C NE , C W , C E , C SW , C S , and C SE are the state variables that can have the values either 1 or 0. Therefore, the particular state variable will contribute in the XOR operation or state update process only if its respective bit will be equivalent to 1, otherwise it will not take part in the state update process.
Thus, the structural combination of above direction variables based on the binary value of decimal number is employed to elect which and whom cells/cell will take part in the state update process. Hence different binary representation means different confined rule equation for the matrix update process of each succeeding matrix. The general formula of the confined rules is given below.
In this formula α = count 0 s × 48, β = count 1 s × 49, ICM t i is the initial configuration matrix for the green channel that we got from the reserved hash (SHA-512) values for the green channel. F is the highest value of pixel that is 255. Whereas, T is the total number of blocks. For clear demonstration, let suppose we have the initial configuration matrix C 0 with a size 4 × 8 as given in Table 3. From the ASCII table as the value of 1 is 49 and the value of 0 is 48, so the decimal value for the confined rule structure of the 1 st sub-matrix can be found as follows.
Now converting this 27 into the binary form [00011011] 2 . As in this binary representation only 4 bits are 1, So only these 4 cells will participate in the XOR operation of 1 st sub-matrix. To find those specific four cells we now put this binary value in Equation (10).
So Equation (12) will be simplified as follows.
This updated Equation (13) has four state variables that are C W = 1, C E = 1, C S = 1 and C SE = 1. So, only these four cells will contribute in the state update process of the 1 st sub-matrix. From Table 2 we can see C t i−1,j is actually C W , C t i+1,j is actually C E , C t i,j−1 is actually C S , while C t i+1,j−1 is actually C SE . Hence, by means of these confined rules structure, the processing power, computation time, efficiency and the security can be improved immensely.
The initial configuration matrix gets updated based on these confined rules mapping and then XORed with the particular plain image sub-matrix to acquire the updated matrix.
Here C t+1 k(i,j) is the updated matrix, C t+1 M(i,j) is the updated initial configuration based on confined rules, and C t k(i,j) is the plain image matrix. In decryption process the reverse equation to get back the original plain sub-matrix will be as follows.

DNA Sequence
DNA molecule contain the genetic information that is used for the purpose of reproduction, functioning and growth of all living organism. Any DNA sequence comprised of four nucleic acid bases: Adenine (A), Cytosine (C), Guanine (G), and Thymine (T). These bases follow the principle of Watson-Crick, that is A and T are complementary, so are C and G same as in the binary system, 1 and 0 are complementary.
Likewise, the case of two-bits binary 11 and 00 are also complementary. Usually in DNA sequence every base is represented by the two-bits as 11, 10, 01 and 00 to represent these four bases T, G, C, and A respectively. There are basically 24 different kinds of DNA coding schemes. Nonetheless, out of those, only eight kinds fulfill the Watson-Crick complementary principle [51], which are given in Table 4. Please note that, like DNA encoding, the DNA decoding rules are just the inverse process of the DNA encoding rule.
In this paper, we propose a new bidirectional mathematical model of DNA rule generator based on two bits of input as shown in Figure 5. The working principle of this model is based on Automaton state machine, so it is called the SM-DNA rule generator. SM-DNA generates random DNA rules faster than the chaotic serious-based rules selection method.
The pixel value of image matrix was converted into binary, then divided into sub-matrices form. We used i th and j th bits as an input. SM-DNA select random DNA rule for each block matrix. In our case, the first and last bit of every sub-block matrix was used as an input. The proposed SM-DNA model has eight states and each state represents one rule. Each state has 2 2 possible output states that take to next or previous state, so it means 8 4 = 4096 different rules combination, while rule transition from one to another depends solely on the following 4 combinations, either 11, 10, 01 or 00. For 00 it moves anti-clockwise direction and for 01, 10 and 11 it moves clockwise direction. For ease of implementation binary matrix of the image was converted into 4 × 8 sub-matrices. SM-DNA allocated random DNA conversion rule to each sub-matrix very efficiently and quickly. For more clear understanding, working principle illustration is given in Figure 6 with a total of N binary sub-block matrices termed as B 1 , B 2 , B 3 , . . . , B (n−1) , B n . So the general formula of SM-DNA described as follows. 16) where k th and n th are the two particular bits of own choice to serve as an input for the rule selection, that is f irst bit and last bit in our case. Suppose BM 1st is our first block matrix and also suppose the P 1 and P 2 value came out 109 and 207, respectively. So DNA starting rule for the 1st sub-block matrix can be gotten as follows.
So, Rule 5 will be the starting rule that will be used for binary to DNA conversion of 1 st sub-block matrix.
BM 1st :: 10 11 01 01 00 11 00 01 00 10 10 01 10 11 11 11 For the 2 nd sub-block matrix i th = f irst bit and j th = last bit bit of 1 st block matrix will be used that are 1,1. So, the Rule 8 is the conversion rule for 2 nd sub-block matrix.
Similarly, all the sub-block matrices were converted into DNA sequences based on rules generated by SM-DNA as shown in Figure 6. Remember that for the N th sub-block matrix the (N − 1) th sub-block matrix will decide the rule. From security prospective as rule selection based on two bits inputs so it is very difficult to predict that out of 32-bits, which two-bits are working as an input. Thus its difficult to guess the rule selection without getting adequate information about the working principle of SM-DNA.

Proposed Encryption Method
The general block diagram of the proposed image encryption method is shown in Figure 7. The proposed encryption method deal with the binary bit-planes of each channel. The detailed encryption steps are given below. Step 1: Get the double hash-value of the image by using SHA-512. Hexadecimal forms of the key string will be gotten. Split the key string into three parts i.e., K 1 = 21, K 2 = 21 and K 3 = 22 hexadecimal pairs to use in the formulas and initial configuration matrices of red, green and blue channels as follows.
Step 2: Take the color image (M, N, 3), where M and N denote the rows and columns of the image, respectively. Scramble as described in the scrambling portion, while the hexadecimal form of a key was used as a seed to generate array sequence by LSS − PRNG. For the two rounds of sequences, the seed values are set through the following equations.
The integer values for two round from the n bits of the stream gotten by the following formula.
For the two rounds of array sequence the initial state can be set by the following way. (21) where, i = (1, 2) termed as rounds and it will generate two initial values X 1 0 ,r 1 and X 2 0 ,r 2 respectively. Step 3: Split the scrambled color image T Scr.
(M,N,3) into respective three channels R, G and B channels and we can get the three components, T Scr. R , T Scr. G and T Scr.
B as given below.
T Scr.
Here T ri , T gi and T bi are the i th pixel values of the red, green and blue channels respectively, whereas T ri ; T gi ; T bi ∈ [0, 255]. Transformed the pixel values of each channel into the binary windows as given below.
Now split the window matrix into m × n size sub-blocks, where u × m = M and v × n = N.
Step 4: Take the 1 st block of T R(M,N) with a size 8 × 8 and split it into two equal columns block e.g., 8 × 4 and 8 × 4; termed as LCB and RCB. By using formula get the starting bit for the 1 st block-matrix and apply block bit inversion as described in Section 2.2.
Step 5: Take the green channel T G(M,N) and apply the Cellular Automata as described in Section 2.3.
Step 6: Take the blue channel T B(M,N) of size H × W divide it into the u × v size sub-blocks matrices as given below. While u × H = M and v × W = N, and apply DNA conversion as described in Section 2.4.
Get the universal DN A → binary rule through following formula.
Convert the whole DNA sequence matrix back into binary form through this universal rule.
Step 7: Add the random matrix of the scrambling part to the pixel values of each channel as described below.
Step 8: Rejoin all the channels to get the cipher image.

Experimental Results and Discussion
This section included the performance and simulation results along with the comparison of results with earlier proposed image encryption schemes. The experimental results were manipulated in Python 3.6.5 (Jupyter Notebook Environment) installed over a personal Laptop, CPU Intel Core I5 with 4GB memory and operating system Window 10.
The test image baboon, its cipher image and the decrypyted image are shown in Figure 8. The experimental parameters are given in Table 5. Whereas all the test images that we used for experiments are shown at the end of paper in Figure 9.

Security Keyspace
The keyspace represents the entire number of likely combinations of the security key. The most common attack is the Brute-force attack in which an attacker endeavors to predict the accurate security key by overly searching the keyspace of the encryption algorithm. Thus, in order to withstand against the Brute-force attack, an adequately huge keyspace is one of the main factor that can guarantee more security [52].
For resisting the best attack, secure hash algorithm (SHA-512) uses a keyspace of 2 256 . The comparison of keyspace and approach along with testing parameters of the proposed algorithm is given in Table 6. Moreover, the SM-DNA possible rules combination 8 4 can also be taken as keyspace. Except for the fact that the hash keys for generating initial configuration matrices for each channel and in their particular rule generating formulas are 2 22 , 2 22 , 2 21 , and 2 5 respectively. So, the overall keyspace of the proposed algorithm is 2 256 × 2 21 × 2 22 × 2 22 × 2 5 × 8 4 which is very large as compared to 2 128 . To calculate the computational load, let's the fastest computer computes 2 80 computations in 1 second and 2 80 × 365(days)×24(h)×60(min)×60(s) [57]. So, to compute 8 4 × 2 >310 computations, a total of following years required.
This huge computation load is sufficient enough to break the crypto-system. The computational load also proved that the 3C3R can effectively withstand against the brute-force attacks.

Histogram Analysis
The histogram of an image demonstrate the distribution of the pixel values. An intruders usually recover the meaningful information from the fluctuating histogram of the encrypted image. So, in order to prevent an intruder from recovering such information, it is important that the histogram of the cipher-image should have no statistical resemblance to the plain image and also should have uniform distribution. The histograms of the ciphered images of all the test images are shown in Figure 10. While Figure 11 shows the histogram of RGB channels of the plain image and its corresponding cipher image. The histogram of the each RGB channel of the cipher image is almost uniform. Moreover, by computing the variance of histogram, we evaluated the uniformity of our ciphered images. The lesser the variance means the higher is the uniformity of the encrypted images [58][59][60][61]. Table 7 listed the histogram variances of the plain images (R,G,B) and encrypted images along with a comparison with the other methods. From the table, we can see that in most of the test images the histogram variance of the proposed algorithm is less as than from Ref. [62] and Ref. [49]. This proved that the 3C3R has better security in comparison to those algorithms.

Pixel Correlation Analysis
Pixel correlation analysis is another test used to find the relationship of neighboring pixels in the plain image and the ciphered image. A good encryption algorithm aims to minimize the relationship among the neighboring pixels with regards to prevent the leakage of actual information.
The correlation coefficient C r(x,y) between the two neighboring pixels can be calculated by the following formulas.
In above equations (w, z) is the gray values of neighboring pixels, C ovariance (w,z) is the covariance, P is the total number of pixels selected from the image, while E(w) is the mean and D(w) is the variance. Figure 12 displays the pixels of the plain image and ciphered image of the proposed algorithm in horizontal (H), vertical (V) and diagonal (D) distribution. In Tables 8 and 9 the pixel correlation comparison was done with some previous algorithms. Table 8 shows a comparison of 8K pairs of neighboring pixels that are randomly selected from the plain image and the ciphered image in the H, V, and D directions to perform pixel correlation analysis. Whereas, Table 9 shows a correlation comparison of 1K random pixels of the Lena image. Whereas, Table 10 listed the pixel correlation values of the different test images.

Key Sensitivity Analysis
Because of the enhanced computational power, the current era's encryption algorithms should not have key length less than 100 bits or (2 100 ). Such key length can withstand against the exhaustive key search attack (brute force attack). The keyspace of the proposed encryption method is 2 (>312) , which has high ability to resist the brute-force attack. Except for the fact that the key should also be extremely sensitive to the bit change. If the secret key will not be subtle enough, then a slight change in the actual secret keys can also properly recover the original image. Also, the secret key may perverted and as a result the actual keyspace may less than the theoretical one [60,61,78].
So, to check the sensitivity of the proposed algorithm towards the key, experiment has performed by changing one bit in the key with respect to the actual key as shown below. Key o is the actual key while Key 1 , Key 2 are the one-bit changed keys from LSB (Right) and MSB (left) bit respectively. Figure 13a,b show the decrypted image by Key 1 and Key 2 respectively. Both Key 1 and Key 2 are one bit different from the actual key but the decrypted image is still like noise giving no useful information. The Figure 13c is the subtracted image of the actual cipher and the decrypted image of Key 1 . The histogram of particular three resultant images is given in Figure 13d-f respectively. The subsequent uniform histograms proved that the proposed 3C3R is very sensitive to key change even one-bit change leads towards totally different cipher image.

Differential Attack
Normally, hackers; to extract useful information create little modification in the plain image and then by using the encryption methodology they encrypt the identical images afore and afterwards these slight changes. Through this method, they attempt to find out the association among the plain images and the cipher images. Thus, we employed the number of pixel change rate (NPCR) and unified average changing intensity (UACI) to measure the robustness of the proposed algorithm against such attacks. The NPCR and UACI can be calculated by the following way.
Here U 1 , U 2 are two different ciphered images before and after one pixel of the plain image is changed, while H × M is the height and width of the test image. Whereas, I(r, c) can be defined as In the above equation, I depict the difference between U 1 and U 2 .  [28,58,59,79,80], while it is comparable to [81]. Similarly, UACI is also comparable with the Refs. [59,79,81]. Thus the proposed 3C3R has satisfactory security values.

Known and Chosen Plain Text Analysis
Most commonly, four kind of cryptanalsis attacks can be performed to crack the image encryption algorithms that are chosen-cipher-text attack, chosen-plaintext attack, cipher-text only attack, and known-plaintext attack [82]. Some famous image encryption algorithms given in Table 1 have already been broken with these attacks. The cryptanalysis model, where the attackers choose plaintext to obtain the corresponding cipher-text is called chosen-plain text attack. By examining the plaintext and the corresponding cipher-text, they try to presume some hidden useful information. Finally, by using that information they try to recover the original images [85,86].
The chosen-plaintext attack is the most powerful, and if the encryption may resist this attack, it has adequate security level to withstand the other three attacks. The proposed algorithm 3C3R has satisfactory security level against known and chosen plaintext attacks.
We can see the cumulative entropy (R,G,B) value is 8.00. In Table 15 comparison of the entropy values was also given, the value is higher from Refs. [82,[87][88][89]. The proposed algorithms give the ideal all channels entropy values for all white, full black image and is given in Table 16. The proof of ideal entropy value is visible in the histogram of the ciphered image generated by our 3C3R of all white and full black, and was given in Figure 14. The histogram of all white, full black and Playboy image is almost entirely flat. Furthermore, we created two special color images SP image1 and SP image2 respectively of size P × Q × 3. SP image1 is the color image with all pixels' values 0 except one pixel located at (252, 252) in R channel is 1. Similarly SP image2 is the color image with all pixels' values 1 except one pixel located at (252, 252) in R channel is 0. We made plaintext sensitivity analysis and the results are given in Table 12. The average values of NPCR and UACI are closed to the theoretical value. Thus on the bases of this test we can say that 3C3R is robust against such attacks and can keep the image more secure.

Robustness against Occlusion Attack
In image processing, PSNR and MSE are the most widely used parameters to test the encryption quality. The PSNR and MSE values can be calculated as follows.
where MSE R,G,B is the mean square error of red, blue and green channel, between the cipher image I c (r, c) and original image I p (r, c), while M and N is the height and width of the image respectively.
Another way is quality checking at the receiver side, such as after passing through a noisy medium cipher, an image may get blurred or lose some data. Therefore, a trustworthy encryption scheme should be able to recuperate the original image without losing too much substantial information. Figure 15a-f shows the different test images with different cropped portion. While Figure 15g-l are the retrieved images, we can see the retrieved images are easily recognizable and carry good information even after clipping 1/2. While the less clipping gave a much better result. Table 13 listed the PSNR and MSE comparison with [29] of test image Lena with different proportion of cropping. The values show that our algorithm performs better when increased the clipping portion while values are comparable for the less clipping. Measuring the difference between the cipher image and original image is another way to evaluate the quality of the color images. So, for this purpose the PSNR can be viewed as a security evaluation parameter. The encryption effect is consider better if the value of PSNR is lower. Table 14 listed the PSNR value between plain → decrypted and plain → ciphered images. The comparison was also made with some well-known algorithms and values are listed in the particular table. We can see from the table that the PSNR value for the different test images is PSNR ≤8.10 that is lower than Refs. [15,23,46,90,91] except the test image baboon in which Ref. [15] gave the lowest PSNR value between plain image and ciphered image. Thus, based on the PSNR value test, we can say that our 3C3R performs very well and can guaranty more security in comparison to other algorithms.   [92] O to C 9.0486 ----Ref. [90] O to C 8.3655 8.8532 ---Ref. [91] O to C 8.2522 8.8223 ---

Local and Shannon Information Entropy
The information entropy (IE) defines the degree of disorder or chaos in an encryption system through the gray value probability. IE for the image can be defined as follow: Let an information source be a τ, then IE can be computed as follows.
Here ρ(τ i ) depicts the probability of the symbol τ i . The ideal IE value for the image with gray intensity level of 2 8 is 8 [93]. So, it means the closer the IE value, the more is the randomness of an image, and as a result less information will be revealed by the particular encryption scheme. Tables 15  and 16 [82,[87][88][89].
In [94] a new image uncertainty test introduced by means of Shannon entropy over the native image-blocks. The (k, T P ) Shannon entropy measure concerning local image blocks can be calculated by the following method: Step 1: Select the non-overlapping image blocks randomly i.e., B 1 , B 2 , B 3 , . . . , B k with T P Pixels within the ciphered or test image I with intensity scales L.
Step 3: Calculate the Shannon entropy sample mean over these k image blocks B 1 , B 2 , B 3 , . . . , B k by the following equation.H The local Shannon entropy value was calculated for the ciphered images. Firstly, non-overlapping image blocks with k = 32 and T P = 1936 pixels are randomly selected from the ciphered images. As the experiential value of local Shannon entropy must fall within the confidence interval i.e., [7.9019, 7.9030], concerning the α-level sureness equal to the 0.05. Table 16 listed the Shannon entropy and global entropy values and also the comparison of Shannon entropy with Ref. [95]. The Shannon entropy value of the ciphered image of the proposed 3C3R fully falls within the desired range. Thus, based on the ideal IE values, we can say the ciphered image generated by the proposed 3C3R carries more haphazardness and as a result, assures more security.

Gray Value Degree (GVD) Analysis
The gray difference degree or GVD is another statistical test of haphazardness that can be found by comparing the plain image and the ciphered image. The ideal value is 1, so closer the value the better is the security. GVD can be computed by the following Equation; whereas G(r, c) symbolizes the gray score at position (r, c) and (r , c ) is as given below.
The average neighborhood gray difference of the whole image can be computed as follows.
In these equations, AN ' and AN, denotes the average neighborhood gray value; but the former represents after encrypting and the later represents before encryption. The final GVD value termed as gray value degree and it will be 1 if the two images are completely different or else it will be 0, if the two images are same. The GVD score of the plain and encrypted images of USC-SIPI database are shown in Table 17. The GVD score for most of the test images is GVD ≥ 0.907 for each R, G and B channel which shows that the plain and encrypted images are entirely different. The listed results also show that 3C3R ensures more security for images as compared to Refs. [29,69,97] except for the image 4.1.04 in which Ref. [29] has the higher value as compared to 3C3R.

Performance Comparison
Performance and encryption time are an important characteristic of any image encryption algorithm. Like in the Chaos-based encryption schemes, number of permutation and diffusion rounds have a direct impact over the encryption time. Similarly for color image rule processing scheme over the RGB channels has a direct relation with the encryption time. Because of the parallel processing characteristics of cellular automata and DNA sequence the proposed 3C3R takes less encryption time as compared to chaos-based schemes. Table 18 enlisted the time comparison of our 3C3R with the Refs. [79,81,98,99] that possess a satisfactory security level. The least encryption and decryption time was taken by the proposed 3C3R shows that our algorithm gives satisfactory results with minimum times. Except that Table 19 listed the comparison with the recently introduced algorithms. The table values in bold fonts clearly concludes that our 3C3R overall performing much better than Refs. [56,62,76,91]. Hence, our 3C3R assures better image security. Baboon O to C 8.8223

3C3R
Lena O to C 8.1020 Baboon O to C 8.011

Conclusions and Future Work
To conquer the issue of low sensitivity to the secret key or low security against known plain or cipher-text attacks, this paper introduced a 3C3R robust image encryption algorithm with adequate security level against well known attacks. Fully uniform histogram and ideal cumulative entropy 8.00 for some images are the proof of robustness and better security of an image by 3C3R. Unlike most encryption methodologies in which the same encryption method or rules structure followed for all channels, this paper introduced a novel encryption method comprising different encryption strategy for each channels. Block bit inversion (binary) for the red channel, VN and RVN (cellular) structure-based pixel alteration for the green channel, and state machine-based SM-DNA rule allocation for the blue channel. Experimental results proved that our 3C3R algorithm is highly subtle to the secret key along with better security. The proposed 3C3R can keep different types of images safe and secure from attackers. 3C3R outperforms state of the art algorithms in terms of encryption performance and image security. The experimental results also proved that the 3C3R is robust against well-known attacks such as brute-force attacks, occlusion attacks, chosen/known plaintext attacks, and differential attacks. Therefore, we can say that 3C3R is the algorithm of the current era requirement and hence it has potential applications in multimedia communication.