A Color Image Encryption Algorithm Based on One Time Key, Chaos Theory, and Concept of Rotor Machine

An innovative method proposed for encrypting color images is comprised of one-time keys and chaos theory using a distinctive concept of rotor machine. The novelty of this scheme is that the rows and columns of 2-dimensional images are converted into circular object called rotor and can be rotated at 360 degrees in clockwise or anti clockwise direction. The rotation will change the existing rotor into new one and can be used in substitution process of plain image. This process can be repeated $\beta $ times and each time a new rotor is created just by a simple rotation. The rotation is performed in terms of pixels so degree of angle is converted into number of pixels. Using this method, same object with new face (after rotation) is used for encryption. The pixels of color image are permuted using the sorted index of logistic sequence. Then, three pseudo-random images are created from Piecewise Linear Chaotic Map (PWLCM). For substitution, both the permuted color channels and pseudo-random images are transformed into rotors. The angle is obtained from Chen chaotic system. The one-time keys are for chaotic maps are generated by using 512-bits hash of plain image. The simulated outcomes demonstrate that the proposed system has high quality of results and requires only single round of encryption to achieve high encryption along with high robustness against the transmission noises.


I. INTRODUCTION
Information security is an active research area from decades. Even in the old era, the transmission of information required security and can be accessed by unauthorized eavesdroppers. Since, the issue gave rise to construction of techniques and algorithms, like steganography and cryptography which could effectively encrypt and decrypt the target information. With the start of digital era, digital cryptography heavily utilized and adopted different forms of information hiding, as medical images, grayscale images, color images and binary images. This type of information hiding requires a different track of research and development and ciphering techniques to cope the associated issues and challenges [1], [2].
The associate editor coordinating the review of this manuscript and approving it for publication was Sun Junwei .
The charming evolution of networked multimedia, transmission over the past decade has heavily increased the online data traffic comprised of video, audio and image contents. The security concerns associated legality and unauthorized access of data and its movement on internet are gaining interest in research. The image security techniques are indifferent to text and other secured information, as strong correlation between neighboring pixels do exist in an image. The indifference caused conventional encryption techniques as Advanced Encryption Standard (AES), Data Encryption Standard (DES), International Data Encryption Standard (IDES) and Linear Feedback Shift Register (LFSR), [3], [4] inefficient. These techniques are primarily built for small sized text information, on contrary images and videos contain large data volumes, strong correlation among data pixels which makes these techniques quite slow and inefficient VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ computationally. Few newer techniques were coined to handle image cryptography like wavelet transform [5], Fibonacci transform [6], vector quantization [7], gray code [8], hash [9], DNA computing [8]- [14], compression techniques [15] and chaos [16]- [25] and [84]. The chaos has a wide variety of applications in various fields such as [79]- [82] and [83]. Among all above techniques, chaos acquired a lot of attention due to its simple structure and high sensitivity of its initial conditions [26]. Mathews became the first scientist to use chaos in an image encryption [27]. Chaotic image encryption techniques can be classified in two categories i). One-dimension (1D) and ii) Multi-dimension (MD). The MD chaotic maps have proven its worth in image security [52]- [54] because of its inherent complex structures and multiple parameters. But MD chaotic maps are complex in nature and time consuming [55]. On the contrary, 1D chaotic systems have less complex structure and are easy to implement in hardware/software [56]. The ID chaotic maps have also weaknesses of short chaotic periods, non-uniform distribution of chaotic output and vulnerable to cryptanalyzed using correlation functions and low computational analysis [57].
Gan et al. [16] used the SHA-256 hash function and the bit planes of images are encrypted in 3-dimension. The Galois field of order 256 is used to construct substitution boxes through Linear Fractional Transformation [17]. In substitution, Forward Substitution Process (FSP) and Reverses Substitution Process (RSP) are applied on of the pixels of image. Yang and Liao [18] used finite field to generalize the Logistic map and then find an auto morphic mapping between two Logistic maps to device the parameters over finite field ZN. Liu and Jin [19] has utilized the coupling of the 2D logistic map and quantum chaotic map by nearest-neighboring coupled-map lattices at the higher complexity and giving better randomness this is applied to build an image cipher. Li et al. [20] generated the dynamic modular curve and its relationship with a logistic map for image encryption scheme. Although few weaknesses have been revealed after cryptanalysis of chaos-based image encryption algorithms and limited image encryption techniques as these are unable to withstand the attacks [23], [25], [50], [58], [59]- [61]. One such attack is the chosen plaintext attacks on the cryptosystems, which is independent of secret keys on the plaintext. Wang et al. [62] crypt-analyzed the Chanil Pak scheme [23] using a chosen plaintext attack [63]. Fan et al. [64] exploited the weakness in the encryption scheme proposed by Hsiao and Lee [25] using the chosen-plaintext attack while Rhouma et al. [65] break the cipher presented by Patidar et al. [58] using the same technique to recover the original image without knowing the secret key. Similarly, Zhang et al. [66] cryptanalyzed the Liu et al. [59] designed technique using a chosen plaintext attack. In the suggested scheme the secret keys are modified without user intervene with the very slight changes in the plaintext. This dependency is spawned by SHA-512 hash function for the plaintext to survive against chosen plaintext attack. In the proposed framework, the chaotic maps are used for higher sensitivity with respect to initial conditions and system parameter for simple and basic structure.
The rotor machines are an electro-mechanical device used for poly-alphabetic substitution. A number of inventors gave the concept of using rotor machines in cryptography. Two Dutch naval officers, Theo A. Van Hengel, and R. P. C. Spengler are considered the inventors of the first rotor cipher machine in 1915. Later, Edward Hebern, Arvid Damm, Hugo Koch and Arthur Scherbius also created their own cryptographic rotor machines. The quite famous rotor machine is Enigma developed by Germans during WWII [67]- [69]. A Rotor Machine consists of multiple independent rotatable cylindrical plates called rotors. Rotor is a device which is electro-mechanical in nature to cipher and deciphers plaintext for which security is required. The electrical pulses can flow through rotors and each rotor contains' input pins and 'n' output pins, internal wiring is done in a way that each input pin is connected to a unique output pin usually with a letter of the alphabet. On each input event, 1 st rotor maps input value to some fixed output value and rotate one step ahead. This mapping is actually a monotype substitution mechanism. The output of 1 st rotor is again mapped to another fixed value by the 2 nd rotor and 2 nd rotor move one step ahead after 1 st rotor completes a cycle. On completion of a cycle, the 2 nd rotor rotates one-step ahead and this process continues and the output of the last rotor is the encrypted value of the input. Hence, all rotors of a cipher machine work like the odometer of an auto vehicle and multiple mono-substitutions behave in poly substitution manner. After encryption of a letter, rotors advance one-step to enhance the security by changing the substitution pattern.
Based upon the concept of a rotating cylinder, a color image encryption technique is proposed which uses multiple chaotic maps and rotating behavior. The one-time pad is used to modify the common initial conditions of chaotic maps by 512-bits hash of plain image to survive against chosen plaintext attack. To break the correlations among pixels, three channels of a plain image are arranged into one-dimensional array and the pixels are permuted using logistic sequence. This one dimensional permuted vector is split into three 2-dimensional matrices. Further, three pseudo-random images are such as made from the Piecewise Linear Chaotic map (PWLCM). The rows and columns of permuted channels and the pseudo-random images are transformed into rotors. The substitution phase is actually based on the concept of rotor cipher in which each alphabet is mapped to some fixed alphabet and rotors rotate one step. In this technique, a rotor of a plain image is added under the modulus 2 operation with a pseudo-rotor generated from the random image. Like the rotational behavior of rotor cipher, the pseudo-rotor is rotated around an angle +θ or −θ and again added with the previously substituted rotor of the plain image. In this way, each rotation to a pseudo-rotor creates another pseudo-rotor like an electromechanical cylinder for substitution. This process continues for a random number of times to complete the substitution of a rotor. The angle is obtained from Chen chaotic system. The rotors of all three channels are treated in a similar fashion to achieve the encryption.
In this paper, section II discusses the preliminaries of chaotic components like Logistic, PWLCM, Chen chaotic systems and formation of rotors from a digital image. In the third section, the detailed methodology is provided, fourth section contains the comprehensive results, section V discusses the robustness against common attacks and last section comprises of the efficient version of the proposed cipher.

II. PRELIMINARY OF PROPOSED SYSTEM A. LOGISTIC SYSTEM
The logistic map is very [18] simple however extensively applied dynamic method for image encryption. Here is the explanation of conventional logistic map by, In the above Equation (1), µ controls the behavior and it can have values in range 0 < µ < 4 and s i ∈ (0, 1), i = 0, 1, · · · , n. The above system has chaotic behavior for µ > 3.568945672 and generates a random number for pixel permutation of plain image.

B. PIECEWISE LINEAR CHAOTIC MAPS (PWLCM)
The widely studied one-dimensional non-linear system is PWLCM, which has high invariant natural density [9]. It is widely adopted by researchers in their proposed work [70], [71] due to its efficiency and ease of implementation as shown in Equation (2). The PWLCM is highly sensitive for seeds, which are set to be precision of 10 (−14) for new and proposed system.
The hyper-chaotic system devised by Chen is significantly sensitive for initial values and the control parameters; which is defined as follows, In Equation (3), a, b, c, d, and k are the system parameters, when a = 36, b = 3, c = 28, d = 16 and −0.7 ≤ k ≤ 0.7, the system of equation is chaotic state and can be utilized to generate pseudo-random numbers. In this paper, k = 0.2, initial conditions (0.3, −0.5, 1.2, 1.0) for Chen chaotic [12] system is used to generate sequence. The fourth-order Runge-Kutta method is used to explain and solve the Equations and to obtain the sequences W , X , Y and Z , and all these four sequences are combined in from one array.

D. ROTOR CIPHER/MACHINE
A rotor machine is electromechanical devices that consist of several rotors in series connection. For each input letter, the rotors move in unique ways, some by one position and some only several steps. The cryptographic security depends upon the number of rotors and other intrinsic settings. The idea of rotor cipher is much fascinating and widely used to build many secure ciphers during mid-70ś and 80ś [67]- [69].
The proposed system uses the idea of rotor substitution cipher to achieve image encryption using chaotic maps. A digital image consists of rows and column, first row, last column, last row, and first column are considered rotors of the image.
To encrypt this rotor, one pseudo-rotor is generated from the chaotic map. This pseudo-rotor will serve as the multi-rotors machine to perform encryption using addition operation in modulus 2. The rotor of pseudo-image is rotated around some angle to create another rotor and then added in modulus 2 again with the rotor of the simple plain image. This mechanism is repeated for multiple times depending upon the user input.

E. ROTOR FORMATION
If a 24-bit color image of size N 2 is given as input is shown in Figure 1(a), the system will generate rotors using layers of rows and columns. The first rotor r will form by combining Row 1, Column 1, Row N and Column N of the input image as displayed in Figure 1(b). Later the size of input matrix will be reduced to (N − 2) × (N − 2) and this new matrix is treated as an input for the next rotor. This process continues till all the rows and columns are converted into Rotors. Finally, it yields N /2 numbers of rotors and at each step, the size of a rotor can be calculated as, where i = 1, 2, · · · , N /2 An example image of size 8 × 8 is shown in Figure 1(a), which is used as input to form rotors shown in Figure 2(b). A total of 8/2 possible rotors can be formed according to the algorithm. The first rotor consists of 28 pixels, 2 nd consists of 20, 3 rd consists of 12 and the last rotor comprises of four pixels. Figure 2 demonstrates the rotation of rotor r 1 around 255, 75 and -287 degree to build three rotors.

III. PROPOSED SCHEME A. SEED/KEY GENERATION
The concept of the seed/key generation process is taken from the established research [71].
where i = 1, 2, · · · , 7 The logistic map shown in Equation (1) needs initial seed s 0 to generate random numbers, new seed value is calculated as follows, One Dimensional PWLCM shown in Equation (2) requires two values, initial seed t 0 and control parameter p 0 which are modified as follows, If seed values for Chen chaotic system are u 0 , v 0 , x 0 and x 0 then these can be modified as follows, The CK is the common key used in all the above Equations, which is generated as follows, The last 44 hexadecimal digits of H are used as follows, The idxR, idxG and idxB serve as the staring index value among the array of angles θ.
In the above equation, β is number of rotational angles to perform circular rotation on each rotor of pseudo-image. The VAL is a decimal value that provides the modulus operation to select angles θ up to Total_Rotors × β.

1) DIFFUSION
The method of diffusion employed for the proposed system using 24-bit image is simple. Firstly, 24-bit image I is transformed into a 1D array of size 1 × 3N 2 . The Equation (1) is used to yield chaotic sequence S up to 3 × N 2 times using modified initial condition s 0 . The S is sorted to record its index using Equation (13) and the pixels of plain image I are re-arranged using the sorted index of S as follows, To create three channels independently, the permuted image is separated into three arrays of size 1 × N 2 called R , G , and B as follows, The R , G and B are transformed into 2D matrices.

2) CONFUSION / SUBSTITUTION
The 2D matrices R , G and B are used in (4) to create Rotors r ed, Rotors r een, and Rotors b lue shown in Equation (15).
An array T is generated by iterating PWLCM 3 × N 2 and transformed into (0 − 255). After that, split T into 2-Dimensional matrices called T 1 , T 2 , and T 3 , each of size N 2 .
The matrices T 1 , T 2 and T 3 are transformed into rotors and called as pseudo r ed, pseudo g reen and pseudo b lue where each rotor has a variable size that can be calculated using the Equation (4), To begin with confusion phase, besides image rotors and pseudo rotors, the algorithm requires angles about which pseudo-rotors are rotated before performing addition in modulus 2 operation. For this, Chen chaotic system is iterated N 2 + 2000 times with new common keys calculated by Equation (9). The obtained four sequences U , V , W and X are merged into the one-dimensional array called C as follows: The values of C are transformed into (−360 0 -360 0 ) called angles θ by applying modulus operation as follows, where i = 1, 2, 3, . . . , N 2 The array C consists of N 2 angles and the proposed system requires only a few of these to rotate the rotors created from pseudo images. The Equation (11) compute the beginning of random selection of angles from C. The total numbers of angles required for a color channel depends upon the number of rotations β to each rotor and total number of rotors are N /2 of an image.
Then angles_red, angles_green, angles_blue are transformed into 2-Dimensional matrix of size of Total_rotors×β in which all β values of a row are used to rotate single pseudo rotor. The ALGORITHM 1 depicts the operations involved in applying the confusion operation on rotors of Rotors_red. The flow diagram of the complete encryption procedure is illustrated in Figure 3 and substitution process is elaborated in Figure 4.

3) SUMMARY OF METHODOLOGY
The plain image I is used in system, has size of N 2 × 3 and encryption is achieved using following steps: Input: The I is a 24-bit color image,s 0 , t 0 , p 0 , w 0 , x 0 , y 0 , and β are the seeds for different chaotic systems.
Output: A ciphered image i.e., E VOLUME 8, 2020 Algorithm Compute the size of ith rotor 4: Pixels_Per_Degree ← size/360 compute the number of pixels used in rotation for 1 degree 5: Add plain and pseudo rotor 6: for j ← 1 to β do 7: θ ←− round(Pixels_Per_Degree × angles_red(i, j)) 8: Rotate pseudo rotor around angle θ 9: Add confused rotor and pseudo rotor 10: end for 11: end for 12: end procedure  3) Create rotors from plain image using Equation (15) called Rotors_red, Rotors_green and Rotors_blue from 2D matrices R , G and B . 4) Get an array T of random numbers by iterating PWLCM map up to 3N 2 times, converted into T and then transform into 2D matrices called T 1 , T 2 and T 3 , each of size N 2 using Equation (16) and (17). 5) Create rotors from T 1 , T 2 and T 3 and called pseudo_red, pseudo_green and pseudo_blue shown in Equation (18). 6) Iterate Chen system chaotic and merge W , X , Y and Z into 1-D array named as C shown in Equation (19) and create rotational angles from C using Equation (20). 7) The angles_red, angles_green and angles_blue are separated randomly from C using sIdxR, sIdxG and sIdxB. The arrays created from C are transformed into 2D matrices of size Total_rotors × β.

8) Perform substitution operation on rotors in pairs,
Rotors_red and pseudo_red, Rotors_green and pseudo_green, Rotors_blue and pseudo_blue rotors. The pseudo-code of substitution of Rotors_red and pseudo_red is represented as ALGORITHM 1 and can also be applied for Rotors_green and Rotors_blue. The simplest addition in modulus 2 operation is applied for substitution. 9) Rearrange the encrypted rotors into rows and columns, then create a matrix of size 3 × N 2 called color encrypted image E. The result is shown in Figure 4.

B. DECRYPTION PROCESS
The proposed system uses symmetric encryption method so that decryption procedure is applied from bottom to top step (9) to step (1) to retrieve back the plain image. The cipher image is split into three channels and then transformed into rotors, three pseudo-random images are generated through PWLCM and then transformed into pseudo-rotors. To decrypt single rotor of cipher image; firstly a pseudo_rotor is rotated around angle θ up to β times and new rotors are saved as Rotors_computed. After that, addition of modulus 2 is applied between rotors_computed and rotors of the ciphered image in reverse order to obtain the rotor of plain image. The pseudo-code is described as ALGORITHM 2 shown as follows.

IV. EXPERIMENTS AND RESULTS
The trials have been applied on PC of Corei5 clocked at 2.8GHz with 8GB RAM using images of size 256 × 256 × 3). All the above initial seeds used for chaotic maps can be called a key set named as γ 0 . By changing one of the initial seed in γ 0 , a new key set produce called γ 1 . So there are total eight common keys used in the proposed system so one can produce eight different key sets as γ 1 , γ 2 , γ 2 , γ 4 , γ 5 , γ 6 , γ 7 , γ 8 . There are different images used in simulations known as Lena, Pepper and Panda are demonstrated in Figure 5(a) to 5(c) and the results of encryption of these images are illustrated in Figure 5(d) to 5(f) distinctly. Pixels_Per_Degree ← size/360 compute the number of pixels used in rotation for 1 degree 5:

A. KEY SPACE ANALYSIS
The secret keys in the proposed system have different floating-point precision ranging from 10 10 to 10 14 . The initial seed s 0 for the Logistic map key space K Logistic = K S 0 = 10 14 ∼ = 2 46.50 . The key space for PWCLM is K p 0 × K t 0 = 10 24 ∼ = 2 79.23 with the precision of 10 12 and Chen system, which uses four inputs (0.3, -4, 1.2 and 1.0) with each having floating point precision of 10 10 . The last but most important is that common keys are modified using SHA-512 hash function which has better security feature compared to SHA-1 shown in Table 1. The total key space for proposed system is K Total = K Logistic × K PWLCM × K Chen × K SHA−512 = 10 232 ∼ = 2 717 . This key space is extremely high and larger than the existing systems shown in Table 2.

B. KEY SENSITIVITY AND DIFFERENTIAL ANALYSIS
The key sensitivity is the measure for analyzing the strength of the encryption technique against the brute-force attack. The cryptographic algorithm must be resilient against insignificant modification in secret key so that it must absolutely change the output to provide the full sense of key space. In the proposed system, three chaotic systems are utilized, the Logistic, PWLCM and the Chen system that is very sensitive to a minor change in initial conditions. In order to make the crypto-system more robust, a new common key is generated by adding all the initial conditions, which make sure that change in a single key will spread to all common keys. For this, Figure 6(a) is the plain image of Panda and Figure 6(b) shows the Ciphered image using the set of secret key called γ 0 . The initial condition for the Logistic system is altered as s 0 = 0.123456789011 while others keys are kept same, this new key set is calledγ 1 , and it is used to encrypt Panda image;  the results are shown in Figure 6(c). The key set γ 1 is used to decrypt the image of Figure 6(b), which resulted in failure as shown in Figure 6(d). In a similar way, key set γ is used to decrypt image of Figure 6(c) and it failed as well, but when γ 0 is used for decryption of Figure 6(b), the result is a success, which is shown in Figure 6(e) that proved the robustness proposed system. The difference in the encrypted image obtained through slight modification in keys is shown in Table 3 and the results are better than schemes shown in Refs. [10] and [14]. Further, the proposed system is put into another test to measure the difference between encrypted images generated from keys sets γ 0 , γ 1 , γ 2 , γ 3 , γ 4 , γ 5 , γ 6 , γ 7 , γ 8 . The average difference is greater than 99.60%.
In the next phase, the sensitivity of the secret keys are measured for decryption. The purpose of this measurement is that if one of the key is different in a keyset then decrypted image must be 100% different from the original image. This 100% difference makes sure that attacker will not able to get any clue between the key and original image. The Table 5 represents this phenomenon and average difference generated by any key is greater than 99%.

C. STATISTICAL ANALYSIS 1) HISTOGRAM ANALYSIS
A histogram represents frequency distribution of an image. If the distribution is uniform it means that encryption quality is better. In the plain image, some of the gray levels do not exist (or contain zero frequency) and some gray levels have the very high frequency. However, in the histogram of an encrypted image, frequency of all gray levels should be equal. For an RGB color image, there will be three histograms and all three should have good uniform distribution for the encrypted image to stand again the statistical attack. The histograms for Red, Green and Blue channels of plain image Lena and its decrypted image are displayed in Figure 7. The plain image is represented in Figure 7(a) to 7(c) and the Figure 7(d) to 7(f) represent ciphered image. It is very clear from the figures that histograms for all channels of cipher image are fairly uniformed. The quantitative analysis which is mentioned in Refs. [10], [14] are used to produce the results of Tables 6 and 7. The consistency of ciphered image is tested through calculating the variance of histograms. The evenness of histograms is displayed through the closeness of variance values of two encrypted images produced by a little different key sets. This concept is illustrated in Table 6 for ciphered images of Lena, Vegetables, and Panda. In Table 6, variances for first column are prepared with the help of initial secret key sets, whereas variances in other columns are achieved via simply changing one of the secret key of γ 0 , correspondingly. The variance VOLUME 8, 2020    of histogram are listed in Table 6 while the percentage of variances is mentioned in Table 7. The average change of variance for the proposed system is 0.21%, which is lower than the scheme in Refs. [10], [14] which were 0.30% and 0.26% respectively.

2) CHI-SQUARE TEST
The histogram of a digital image depicts the frequency for every gray level which shows the level of uniform distribution. This can also measured by Chi-square test and defined as follows, In Equation (22), v k are the observed frequencies of each gray level (0 − 255). The lower value of the chi-square shows the enhanced uniformity. The chi-square values are computed for Lena, Panda and Vegetables and are lower than Ref. [10] shown in Table 8. The proposed system has passed the test successfully for critical level α = 0.05, Chi-square reported the values for all the channels of different plain/cipher images, should not be greater than 295.25.
Our proposed system has better χ 2 and on an average only 3.5 images have χ 2 greater than 295.25 depicted results in Table 9.

3) CORRELATION COEFFICIENT
The color digital image contains a stronger correlation not only in adjacent pixels but also it has a strong correlation between the three channels. Moreover, images are composed of different regions to depict visual information. The pixels of a region have the similar gray intensity and the objective of the cryptography is to break this correlation to dismantle such regions. To measure the correlation in adjacent pixels, the Equation 23 is used, here ρ xy is the correlation coefficient and its value varies from +1 to −1. The correlation is considered strong if the coefficient score is closer to +1 and weak if the coefficient score is closer to −1. The results for  correlation in three directions known as Horizontal, Vertical, and diagonal are measured by randomly selecting 3000 pairs in all directions. In Table 10 the results are given. So, it can be observed that the proposed scheme has better correlation coefficient for encrypted images than that of given in Refs.
[10]- [12], [14], [16]- [20]. The correlations for plain and ciphered images are shown in Figure 8 Cov(x, y) In Equation (23); x, y, and D(x), cov(x, y) represent gray values, mean and variance values of two adjacent pixels respectively. The correlation between these two color channels are measured and shown in Table 11 and one can observe that correlations between Red-Green, Red-Blue and Green-Blue are close to 0 for different images.

4) PEAK SIGNAL TO NOISE RATIO (PSNR)
The following Equation is used to compute the PSNR score between plain and ciphered image, PSNR(P, C) = 10 × log 10 dB (27) where M and N are the size of an image, P and C represent plain and cipher images respectively. The PSNR results of proposed system are shown in Table 12 and proposed scheme VOLUME 8, 2020  is comparatively better than the schemes given in Refs. [11] and [12].

5) INFORMATION ENTROPY
The objective of cryptography is to transform meaningful information into noise or randomness. The entropy is used to compute the noisy condition of a message. As each color channel is 8-bit image independently, the ideal entropy score of the encrypted channel should be closed to 8, and a higher score is better. The uniform distribution and cryptosystem will be stronger against statistical attack if entropy is higher. The Entropy is defined as: In Equation (28), L and p demonstrate gray level and probability of occurrence of any intensity L in image. The entropy score for non-identical images of size 256 × 256 are calculated and shown in Table 13. The average scores for each color channel of all images (plain and encrypted) are shown in bold characters and by value inspection proposed cipher has shown better performance than given in schemes [10], [12] and [14]. The information entropies for color Lena image of size 512 × 512 are in Table 14 which is comparably better than the scheme in Refs. [10] and [11].
The Equation (29) is used to measure the local distribution/randomness of encrypted image. The I and E are plain and encrypted images with L intensities. These images are split into k blocks that must be non-overlapped in which E 1 , · · · , E k are splitted blocks with T number of pixels in each block. The Equation (29) is used to compute the mean of local entropy of randomly selected k blocks. For the experiment, K = 32 and T = 1936 are used. As seen from Table 15, the average local Shannon entropy values of Red, Green and Blue components of the cipher image are more than 7.90 which is far better than Ref. [14]. Hence, the proposed system passed the local entropy test. The Ref. [14] has failed to pass the test.

D. DIFFERENTIAL ANALYSIS
Two famous researchers Biham and Shamir [73], [74] devised two metrics called Number of Changing Pixel Rate (NPCR) and Unified Averaged Changed Intensity (UACI) to evaluate the ciphers against differential attacks. The given Equations (30) and (31) provide the computational scores of NPCR and UACI among two encrypted images generated    from two plain images differ in one bit only.
where M × N represents the dimension of input/output images, E 1 (i, j) and E 2 (i, j) are the pixel values in the ith row and the jth column of two evaluated images and D(i, j) is defined as follows, The NPCR and UACI results of three channels of Lena and Baboon are computed and recorded in Tables 16 and 17. The average NPCR scores of Lena and Baboon are NPCR>0.9961, NPCR>0.9964 respectively which is good enough to resist the differential attack. Similarly, the average UACI score of Lena and Baboon are UACI>0.3356 and UACI>0.3350. To assess the sensitivity of the plaintext in depth, one hundred and fifty encrypted images are produced for different plain images by changing one pixel by 1 bit only at a time using same secret key set γ 0 . The results are compiled in Tables 18 and 19 for 150 encrypted images and boldface scores represents average values of 150 images. In the next step, an image with zero information is shown in Figure 9(a) and its encrypted result is displayed in Figure 9(c). To measure the NPCR and UACI scores, a single VOLUME 8, 2020   pixel is changed from zero to 255 represented in Figure 9(b) and its encrypted result is shown in Figure 9(d). The scores for NPCR, UACI, Variance, and Chi-Square are computed for the black and white images shown in Table 20. The proposed scheme has comparatively better results than that Ref. [16]. The difference in Figure 9(c) and 9(d) is displayed in Figure 9(e).
At last, we have estimated the critical value test for NPCR and UACI. For this purpose, Lena image is used to generate 100 encrypted images by supplying 1-bit different plain image to the proposed algorithm. The critical NPCR value of α 0.001 , α 0.01 and α 0.05 are 99.5341, 99.5527 and 99.5693, respectively. In our test, not a single encrypted image out of 100 has NPCR score lower than 99.5341(%), 99.5527(%) or 99.5693(%). This fact is shown in Figure 10

V. ROBUSTNESS AGAINST NOISE ATTACKS
This section discusses the robustness of common noises caused by the physical communication channel. A significant change in the encrypted image can result in failure to decrypt the image [75], which states that an error even in a single pixel and the original image is lost. The preferred way to test robustness is to compute the loss in encrypted image, Gaussian noise, Salt & Pepper noise, Histogram Equalization, and Contrast enhancement to confirm the strength and robustness of the proposed system.

A. CROPPING
During the internet communication, any part of image can be vanished. For this kind of serious threat the proposed cipher must be capable enough to the deciphering of lossy image in a proper way. For such validation an encrypted Lena image of size 512 × 512 × 3 is used, 64 × 64 × 3 or 1.65%, 128×128×3 or 6.25%, 256×256×3 or 25% and 256×512×3 or 50% of image data have been removed which displayed in Figure 11(a) to 11(d) respectively. These lossy images are deciphered using the scheme given in Ref. [16], results are displayed in Figure 11(e) to 11(h). The results of deciphering by the proposed scheme are displayed in Figure 11(i) to Figure 11(l). The recovered images still have plain image information. This proves the toughness of the proposed cipher against the lossy attacks.

B. HISTOGRAM ATTACK
The histogram attack means that Equalization process is applied on the histogram on an image. The histogram  Equalization change the intensity of each pixel and new image contains different gray levels with almost equal frequency. In this article, histogram Equalization is applied on Figure 5(f) that is displayed in Figure 12(a) and recovered image is presented in Figure 12(b). This technique is also applied to encrypted images of Lena, Panda, and   Table 21 with the average value for each image. The PSNR value in Figure 5(c) and 12(b) of Panda under β = 3 is 36.81dB as shown in Table 21 which is far better than Ref. [14]. The average PSNR of the image is 33.65 which is also better than Ref. [14]. Therefore, the result declare that the offered scheme can defend the histogram equalization attack.

C. NOISE ADDITION
In the real and the digital world scenario noise accumulation definitely occurs. This noise lowers the image quality and affect the visual information of digital images. In the simulation, the assumption is made that ciphered Panda image shown in Figure 5(f) is contaminated with the Gaussian noise    Figure 14(a) to 14(c). In Table 22, the PSNR results are listed that proves the robustness of proposed scheme as compared to Refs. [10], [14] for the Gaussian noise in terms of value comparison.
After this, Gaussian noise with mean=0 and variances 0.00001, lower 0.00003, 0.00005 and 0.0001 are added to image given in Figure 5(d). The visual results are displayed in Figure 15(a) to Figure 15(d). The corresponding deciphered images in comparison to Ref. [16] are shown in Figure 15(e) to Figure15(h). The deciphered images of the proposed scheme are displayed in Figure 15(i) to Figure 15(l).     It is obvious from the results that the recovered images using the proposed scheme are far better in visual quality than that of the previous scheme in Ref. [16]. In Table 23, the MSE, PSNR, NPCR, UACI are computed between plain Lena and recovered image with Gaussian noises for densities 0.0001, 0.0003 and 0.0005. The proposed scheme is also better in NPCR and UACI as compared to other schemes [10], [29], [76] but it is lower in PSNR than that of Ref. [76].

D. CONTRAST ADJUSTMENT
The contrast adjustment is a basic image processing term to improve the level of viewing an image. This contrast enhancement is employed to the encrypted image of Panda shown in Figure 16(f) of two different levels, 70% and 30% where the substandard value shows the higher contrasts. These enhanced and encrypted images are displayed in Figure 16(a) and Figure 16(c) and corresponding decrypted images are shown in Figure 16(b) and Figure 16(d). After that the Peak Signal to Noise (PSNR) is also calculated for decrypted and original Panda images are 14.95dB and 12.42dB. For PSNR the proposed scheme is better than other the schemes in Refs. [10], [14], the comparison is given in Table 22. Therefore, the proposed system is robust against contrast adjustment attacks as well.

VI. EFFICIENT VERSION
A new chaotic map called Sine-Sine system proposed by C. Pak in [22] that is x n+1 = F chaos (µ, x n ) × 2 k − floor (F chaos (µ, x n )) in which F chaos (µ, x n ) is the 1D logistic map. The new system is chaotic for µ ∈ (0, 10) and k ∈ (8, 20) which produced the pseudo-random sequence x n ∈ (0 − 1). This chaotic map is highly efficient as compared to Chen system to generate values for the rotation of rotors. It has improved the efficiency greatly without compromising the results but to get angles between −360 0 to 360 0 . A little modification is required to incorporate this in the proposed scheme. This modification is mentioned below, results are given in Table 24 with Chen and SSS system applied to Lena image. The comparison of results proves that the new system is better.

VII. CONCLUSION
An innovative image encryption algorithm is proposed using the concept of rotor machines and chaotic maps. The rows and columns are combined to form rotors for each matrix of the color image and PWLCM used to build 2-dimensional matrices of pseudo-random numbers. These matrices are also transformed into rotors called pseudo rotors. A pseudo-rotor is rotated around an angle +θ or −θ and added to the rotor of plaintext. This process continue up to β times for the substitution of single rotor. The angle θ is obtained by Chen hyper chaotic system and one-time keys are generated using SHA-512 of the plain image that enables cryptosystem, to resist chosen plaintext attack. The experimental results show that the system is very strong against common attacks and quite better than some existing ciphers. It has higher NPCR, UACI,entropy and low Chi-Square scores. It has shown extreme resilient resistance against transmission impairments such as Gaussian, Salt & Pepper, clipping and histogram equalization that lacks in many existing systems. The replacement of Chen system with a 1-dimensional chaotic map called SSS which highly improves the efficiency without compromising the performance and security. The proposed scheme is also suitable for grey scale images.