Robust Color Image Encryption Using 3D Chaotic Maps and S-Box Algorithms

Chaos' key qualities, such as initial state sensitivity and unpredictability, make it an ideal contender for cryptography applications. This study presents an encryption scheme for efficient and secure image encryption. The encryption scheme includes two ciphering stages and a substitution stage. In this work, an algorithm for key generation has been proposed. The design of a Pseudo-random number generator that used for key generation is based on chaotic algorithms. The chaotic map will be utilised in encryption systems due to its high security. To evaluate the proposed PRNG randomness, NIST tests are used for these sequences. In the following subsection, security analysis of the proposed image encryption technique has been made to know the efficiency of the proposed technique. The statistical analysis now reaffirms that the technique is secure and efficient for and encrypting simple or complex images, be it in shades of black and white or, colorful. By a comparison with past chaotic investigations, demonstrating that our algorithm is competitive with earlier work.


INTRODUCTION
Thus, since the present approach is based on the image processing and the data transmission, the improvement is observable in recent years.Securing important data while transferring it in real-time from one point to another in wired and wireless networks is a requirement that has gained much significance [1].Technology has risen impacting and changing all fronts through the application of multimedia and objects of visual communication such as the military and medical fields that use data transfer.Earlier methods of encryption that were applied for image encryption have failed to cope with large database images [2].Therefore, the focus has been placed on advancing image encryption algorithms, with attention being given to algorithms using chaos as the main encryption basis [3,4].
Chaotic systems and cryptology are closely linked [5,6], as the features of chaotic systems, such as randomness, control sensitivity, ergodicity, and deterministic yet highly unpredictable values, align well with the requirements of encryption [7].These advantageous characteristics have led to further exploration of chaos-based encryption through additional experiments [8].Random number sequences play an important part in encryption, and the unpredictability of these produced numbers strongly correlates with encryption strength.To achieve this, PRNG based on chaos have become a common application of chaotic systems in encryption [9].The S-Box is a vital component in block encryption methods, as it performs confusion to improve encryption security.The design of a robust S-Box structure is crucial, as it must possess high cryptographic features, be resistant to attacks, and withstand differential cryptanalysis to be effective in encryption [10].

RELATED WORKS
The complex structures of modern encryption algorithms, which require a great deal of computing power, have a negative impact on the efficiency of image encryption operations.As for the usage of chaotic systems in encryption methods, it is crucial to notice that although these approaches are actively investigated in academia, it has been shown that none of the encryption methods that solely uses chaotic systems can provide satisfactory security.
In reference [11], a chaotic sequence was generated using a sine map.To improve system security, an elliptic curve point and dynamic permutation table were used.The study in [12] reduced the number of iterations of the hyperchaotic system from WH/4 to 2W, a significant reduction for an image with dimensions W×H.A novel post-processing technique for generating a key matrix enabled this improvement.A new approach was presented in [13], offering a low time order, high output complexity, and a simple algorithm using 3D logistic maps.Reference [14] described a new approach of encrypting medical pictures using a 2D Logistic-Gaussian hyperchaotic map.In [15], image encryption was accomplished with the aid of 3D and 4D Arnold Cat maps, and the model incorporated the secure Elliptic Curve.In [16], a unique picture encryption technique using a combination of three modified and augmented chaotic one-dimensional maps was suggested.In [17], an encryption method for 3D models was proposed using a 2D chaotic system constructed by coupling the logistic map with infinite collapse (2D-LAIC) and the semi-tensor product (STP) theory.Reference [18] introduced a bit-level permutation and hyper-chaotic system as the foundation for an encryption scheme, while [19] proposed intra bitplane scrambling for parallel image encryption.In [20], a new four-dimensional and multi-scroll hyperchaotic system was developed.In [21], a visually secure image encryption scheme was proposed by combining the adaptive-threshold sparsification compression sensing model with a novel design memristive chaotic map.In [22], a chaotic oscillator was generated using a second-order differential equation.
Novel suggestions for a key generation were proposed in [23].The study in [24] described a collection of one-dimensional quadratic chaotic maps based on topological conjugate theory.In [25], a new framework utilising finite precision was introduced for generating chaotic signals to improve image encryption is presented.The encryption process was enhanced using S-BOX, an algorithm based on chaotic processes, which provided a high level of security and efficiency.In [26], the encrypted data consisting of S-Boxes generated from a chaotic logistic map was compressed before encryption.The authors in [27] suggested a 3D chaotic map using highly nonlinear S boxes for encryption, followed by a data concealing strategy based on the Lah transform.A low-dimensional chaotic scheme was employed in [28] to create an S-box with dimensions of 10 by 26.In [29] the efficacy of encryption was increased, and secure transmission was promoted they used a 3D chaotic map-based symmetric technique.In [30], the combination of various chaotic map types with an S-box was hypothesised to achieve a fast method for scrambling and encrypting colour images.In [31], the Henon map was utilized to propose new image cryptosystem key-dependent bijective S-Boxes.In [32], Combining quantum walks with the generation of ciphertexts with visual meaning, a new approach of image encryption has been introduced.This research seeks to design an efficient and secure image encryption system through simple procedures and a robust strong key.The study proposes method for encrypting images using chaotic maps and S-box algorithm.To enhance the confusion, the presented encryption method uses an S-box appended to the chaotic maps and ensures improved security while maintaining the favourable statistical characteristics of the approach.
The contribution of this work is proposing new method for key generation based on multi-stage 3D chaotic maps.
The remaining parts of this work are structured as described below.Section 2 contains the existing chaotic maps used in this work.In section three, the key generation method and S-box construction are introduced, and also, we will discuss the image encryption algorithms that have been suggested.The results of the experiments and an appraisal of their effectiveness are presented in Section 4. In the end, the conclusions are discussed in the final section.

CHAOTIC MAPS
The most famous 3D chaotic system, maps are Logistic and 3D Henon map, has been considered for key generation in the proposed systems.The mathematical models of the chaotic systems used in this study are defined in Table 1.

THE PROPOSED IMAGE ENCRYPTION SCHEME
In this section, we provide a chaotic method for random number generator and investigate the ensuing chaotic system.After it is determined that the chaotic system has sufficient dynamic features, a random number generator can be developed.In tests administered by the National Institute of Standards and Technology (NIST), random numbers generated using a random number generator are employed.Then S-box is generated to improve the performance of the proposed encryption schemes.

1-Key Generation
The originality of the proposed method is based on an efficient PRBG method for the key.Given the nature of the previous studies, both the level of security and the feasibility of the cryptosystem must be optimized.As for this work, a specific generation methodology is proposed as follows: two forward waves, that is, a 3D chaotic map, and a 3D chaotic map of the feedback part called the Proposal with FeedBack method (P1FB) shown in figure 1. Figure 2 demonstrates a block diagram of 3D-Quantization and Decimal-to-binary converter which is used to convert the output of chaotic map in to 8bit binary form.The key generation proposal P1FB employed chaotic maps of three types, for the 3D-FCM the first initial value is set to be xf0, yf0, and zf0 while the 3D-CM employs initial value xc0=Xf, yc0=Yf, and zc0=Zf, the output of the former supplies the next map.The output of this stage includes both the feedback streams and ciphering key, where the latter is used for encrypting the color image in a binary format.In this case, the ciphering key as, K_P1_R for the red vector of the image, K_P1_G for the green vector of the image and K_P1_B for the blue vector of the image.The feedback streams become the initial values in the third stage, 3D-HM, with xh0 = Xc, yh0 = Yc, and zh0 = Zc.In the next iteration, the 3D-HM outcomes are internalized to the 3D-FCM with reinforcement of the clustering by setting xf1=Xh, yf1=Yh, and zf1=Zh until all pixels in the image are encrypted.NIST is a regularly utilized test suite when evaluating the stochastic performance of a time series [34,37].The NIST requires multiple sequences and largely relies on two key performance metrics: P-value and pass rate, to measure the random performance of time series [38].The pseudo-random properties of the new chaotic signals were demonstrated using NIST testing.The standard procedure was used to assess the randomness of the x, y, and z sequences.The NIST test results for 15 tests are presented in table 2, showing that all values are consistently below 0.01 in each trial.The results of all the tests for randomness suggest that the sequences generated by the key are suitably unpredictable for the purpose of image encryption.

2-The S-Box construction
Substitution-Box is primarily made up of a variety of mathematical procedures.This encryption algorithm takes the plaintext block and a key as the inputs to produce an encrypted block as the output.This is followed by S-box transformations to produce the ciphertext and then multiple rounds of S-box transformations.Decryption is, therefore, done by using the inverse of the S-box transformations in the reverse order using the same key [39].
The operation that is performed on a pixel value p using an S-box matrix s is called a nonlinear transformation and is suggested mathematically using the substitution function sb(s, p).The output of this function provides the transformed ciphertext pixel value.A strategy for creating some reliable S-boxes based on the chaotic maps (3D-CM, 3D-HM, 3D-FCM), and the proposed scheme (P1FB) has been developed.The resulting 3D chaotic sequences are ordered by rising values, and the ordered values' indices are recorded in one-dimensional arrays.It is necessary for the production of the Sbox from the preceding sorting phase.The sorted indices are then placed into a 16x16 matrix, with each column representing the identity of the values in the sorted sequence and each row representing an S-box, known as the Sbox_matrix.This transformation applies to each pixel in the provided image, with the pixel's value serving as the index of the S-box.This retrieved value is the new pixel value in the altered picture known as Sbox_Imag depicting the cipher text pixel value.
The building of an S-box comprises three phases: Step 1: To generate a chaotic sequence, use one of the chaotic maps using the methods described above.
Step 2: Randomise the sequence of indices.
Step It is also needed that all of the elements of S be integers and fall inside the interval [0, 255], thus S(i, j) [0, 255].S(i, j) should not have any duplicates, and all entries should be between 0 and 255, so it falls inside the range [0, 255].The study used a heuristic method to develop S_box using Henon map, Cat map, Factorial map, and the proposed scheme.More specifically, the x sequence was coded with blue vector of the image, the y sequence was coded with red vector of the image and the z sequence was linked with green vector of the image.
To decrypt, define the S-box inverse transform function, sb Inverse(s, q).As previously stated, s is the current state of the stream cypher, and q represents the first q bits of the cypher text block.The second method covers the technique for S-Box Inverse.

3-Theproposed image encryption scheme
The image encryption scheme involves three stages: two stages of ciphering with the help of chaotic maps using PRNG and one stage of substitution by means of an S-box.The block diagram of entire image encryption scheme is depicted in the Figure 3.Then, the original color image is decomposed into the RGB channels, and then the ciphering process takes place.Following that, a diffusion operation is carried out using three of the S-box techniques for the RGB channels separately.The final data processing operation of ciphering is then done with respect to the RGB channels after the diffusion operation is performed.Last of all the three channels are combined to give the final color ciphertext image.The specific encryption steps are as follows:

EXPERIMENTAL RESULTS
A detailed investigation was done with respect to the results and vulnerability of the suggested algorithms.These were histogram evaluation results, correlation coefficients, information entropy, keysRpace, and resistance against differential attacks.All experiments were very carefully performed and afterwards signal analysis was done with the help of Matlab.The first requirement for designing a good image encryption technique is that it must counter a number of threats.Some statistical analysis was done, for instance; differential attack analysis (change intensity and change rates where both are average and uniform), key analysis (key-space and key-sensitivity).Besides, correlation coefficients, information entropy, and histograms were as well considered.As in many cases, a particular emphasis is placed on the comparison of the proposed technique with the other approaches to the same problem.In this study, compound arrangements of chaotic maps were used to create a key for the type of application we used in the study.These arrangements were identified using abbreviations: These are Factorial chaotic map (F), Henon chaotic map (H), Cat chaotic map (C), Proposal algorithm with feedback algorithm (P1), and S-box (S).For instance, H_SP1_F implies that the authors have employed Henon chaotic map for the first key, S-box for the subsequent key based on proposal 1 with selection algorithm inherent to the system besides the generation of the third key through 3DFCM.

Analyzing a Histogram
Histograms displays the number of the pixels in an image at a specific shade of gray.This analysis provides cryptanalysts with a lot of information on the image.

NPCR and UACI test
The robustness of this method to the differential attacks is established using two of the most common measures.One of these is NPCR, which gives the number of pixels with differences in two images divided by the total number of pixels.Two different encrypted images are described as I_1(a,b) and I_2(a,b) where a varies from 0 to M-1 and b from 0 to N-1.Importantly, each of these images is one-pixel different from its corresponding plaintext image.The NPCR percentage is calculated using the following formula: where  . is a (0, 1) matrix calculated by  1 (, ) and  2 (, ).If  1 (, )= 2 (, ), then  . = 0; otherwise,  . = 1, and  . ∈ Β × .The other parameter was therefore UACI which essentially measures the mean intensity of differences between two images most especially when the variations between images are negligible and the images consequently are close to plaintext images.The UACI is computed using the following formula: A suitable level of performers for image encryption confidence is the adequate values of UACI that, according to the established calculations should be around 33. Multiple Filter sizes are to be tested using the performance measures of NPCR and UACI, the value 99.604 is the ideal NPCR.[23].The encryption scheme applied for the encrypted grey images are and the respective UACI and NPCR are mentioned below in Table 3.The methods shown, illustrate NPCR values which are either greater or comparable to the standard values and hence better or equivalent security is established with higher values.The issued NPCR and UACI will accordingly fluctuate depending on the applied format and size of the image.The values calculated by these methods are provided in the table and compared to previous methods using the Lena test image, which is shown in table 4. Comparing the result, it is concluded that the NPCR and UACI of the proposed systems are higher than those of previous research, which means that the procedures have better protection against various attacks and transmission security and efficiency of images in addition to safety.

Entropy
in the case of statistical tests, information entropy is one of the parameters, which assesses the degree of image's randomness.In a grayscale image with size of 256 by 256, the total no of shades would be 256 I/p levels.If the probability at each level is considered to be the same then the entropy value is 8 bits.The mathematical expression for entropy is: where X is the original image, Pr(  ) is the probability of X =   ,   is j-th possible value in X, K indicates the number of levels present in an image, and S stands for "intensity sequence number," which is related to the format of the image.The entropy values of encrypted test images through the encryption schemes are shown in Table 5.The entropy values here derived are slightly higher than the theoretical values that would have been expected.As presented in Table 6, this approach experienced an entropy increment compared to Lena grey image in the prior work.

Correlation Coefficient analysis(CC)
A correlation coefficient is an essential parameter for examining the relationship between pixels in three-dimension horizontal, vertical, and diagonal.The pixels that comprise the plain text image have a solid association in all directions.In a secure system, the data are uncorrelated and random; thus, the value tends toward zero, and the encrypted plaintext image preserves all of its original features.If Q random pairings of the surrounding pixels of an image with the values (  ,   ), where j might vary from 1 to Q, are chosen.The equation of CC is: √∑ (  −()) Where E(.) is the mean value function, ( ,  ) are two neighboring pixels.The performance of the proposed system on the three-directional encrypted images for the correlation coefficient is shown in the Table 7.In Table 8, which includes previous work, the proposed methods documented have CC values higher than the one shown in Table 6.Barbara plaintext images and their corresponding encrypted images are shown in figure 5, it shows the three correlation directions.Reference Horizontal Vertical Diagonal [29] 0 -0.004 0.00030 [36] −0.001 −0.001 −0.00030 [37] 0.001 0.001 0.00051 [16] 0.0028 −0.001 0.0021 [25] 0.00070 0.00060 0.00031 [15] 0.001 0.001 0.001 [38] 0.002 0.001 0.00081 [39] 0.002 0.006 0.00051 [40] 0.00162 0.00027 0.00062 [41] 0.00006 0.00001 -0.00002 [42] 0.005 0.001 0.006

Key Analysis
A secure encryption system is one that cannot succumb to any comprehensive key attack hence the need to implement key sensitivity.When it becomes impossible to recover the original data if a slight difference occurs between the encryption, decryption keys then the technique is said to be "keys sensitive", that too even if the difference between the keys is in the order of 10⁻¹⁵ then the resulting sequence would be entirely different [47].
The key space is the number of keys that can be possibly used in a particular cryptographic method.This is why to counter brute-force attacks, it is encouraged that the total key search space is greater than 2¹⁰⁰ [47].Here, the mentioned 3D FCM applied to produce key-dependent S-Boxes.Table 9 represents the key space of the 3DFCM and the proposed scheme used in this paper.The parameters of the 3DFCM include x₀, y₀, z₀, L, M and N, which makes the key space measuring up to a level that will bar any attempt at a brute force.P1 consists of three chaotic maps, each with six parameters.These maps can be used as key1 or key2 and are also useful in constructing the S-Boxes while completing the procedure of the encryption.As for the F_SF_F pattern, the determined size of the key will be (10 15 ) 6 ×(10 15 ) 6 ×(10 15 ) 6 .Our method defines a key space big enough that resume all types of brutal force attacks.Comparisons of the sizes of keys have been presented in table 10 and it is revealed that the proposed image encryption has a key space bigger and more invincible than other researches done.In this part, two proposed arrangements had chosen (H-Sf_C and H-Sf_F); for evaluation purposes, color images are submitted for security checks.The described method properly hides the pixel distributions across all channels H-Sf_F, indicating the results of their testing using colored images.To test the performance of the algorithm on real life image processing, entropy, NPCR, UACI and correlation analysis were carried out on the color images.The results presented in the Table 11 as well as the comparison data on the Lena image in the Table 12, prove the efficiency of the method.In all cases, the results demonstrate that the proposed image encryption is secure and fast for colour as well as grayscale pictures; also revealing a vast enhancement compared to prior approaches.

CONCLUSION
Simple and secure 3D chaotic maps have been proposed for encryption images with S-box.Aiming to reduce the complexity and increase the efficiency of the encryption system, a novel system has been proposed to encrypt gray and color images; moreover, a novel chaotic map is proposed for key generation.Using a multi-stage Chaos-based key generator and utilizing Sbox, we have devised a fast and secure algorithm for image encryption.During the key matrix generation step, many chaotic maps have been used in different arrangements, which can increase the randomness and unpredictability inside the key matrix.Firstly, we apply a ciphering stage to encrypt the image with different keys.Furthermore, by using an Sbox, It is feasible for both pixel and key information to be distributed throughout the entire cipher image, then we used a second ciphering stage.Experiments indicate that the proposed encryption method can contain many keys, with key space >10 180 ; it depends on the arrangements used in the encryption system.Robust resistance to statistical, brute-force, differential, and other prevalent assaults; high plaintext sensitivity; information entropy performance is superior to 7.999, NPCR close to 99.6, UACI close to 33.8.In addition, the results of tests done on color photographs indicate that this algorithm has a vast array of potential applications.The suggested picture encryption technique meets the security, efficiency, and resilience requirements for the vast majority of daily image-confidential communications.

Algorithm2: 1 . 2 .
Inverse S-Box Input: Substituted image Sbox_Imag of size × and a 16×16 S-Box matrix.Output: × image InvSBox_Imag.For each i from 1 to 256: For each  from 1 to 256: If the index x equals : Assign the value of  to the index y.For each column 1 from 1 to n: For each row 2 from 1 to : Retrieve the image pixel value from the index and subtract 1, storing it in InvSBox_Imag.The following steps are listed in the encryption algorithm: 1-Take the original image I and enter it into the program and find the dimensions to be [m,n]×3=size(I).2-Split the color plaintext image I to its RGB channels with dimensions M×N.Transform the RGB channel matrices into one dimensional binary streams and these are referred to as; B_R, B_G, B_B.3-Define the parameters to be used in a chaotic map and obtain three chaotic matrices to form the first stage ciphering key.4-XOR the obtained vectors in step 2 with the chaotic matrices x, y, z. 5-Transform the obtained ciphered binary vectors into matrices of the dimensions [m,n] for the second encryption stage.6-It is important to carry out the S-box process as the last diffusion step for permuting the ciphered image on the basis of the index value to reach the second encryption stage image referred as to imagesb.7-Perform step 2 for the encrypted imagesb obtained from the S-box output of the selected image.Note that for the next ciphering stage, replace the sine logistic map with a logistic chaotic map.8-Convert the obtained binary vectors into the final encrypted image E_I, which will be in the form of [m,n]×3 decimal matrices.The decryption algorithm essentially reverses the operations of the encryption algorithm.

Fig . 5 .
Fig . 5. Pixels correlation in all directions of Lena color image and encrypted image respectively; (a,d)red, (e,b) green, (c,f) blue.

TABLE I .
CHAOTIC MAPS

TABLE II
3: Convert the indices to decimal and produce the last S-box with a dimension of 16 × 16.Algorithm 1 illustrates the precise procedure for constructing an S-box and chaotic sequences.Algorithm1: Substitution box construction Input: the chaotic sequences (,,), and × image.Output: The substituted image Sbox_Imag.1.Sort the chaotic sequence  by its indices to get [].2.Generate a 16×16 substitution matrix Sbox_matrix using the index vector from the sorted sequence.3.For each column 1 from 1 to : 4. For each row 2 from 1 to : 5. Substitute the pixel value in the image by the corresponding index in the substitution matrix and store it in Sbox_Imag.
The S-box (S) must satisfy the following conditions: It is 16×16 and can hold up to 256 items.

TABLE III .
UACL AND NPCR TESTS

TABLE IV .
COMPARISON FOR UACL AND NPCR TESTS WITH PREVIOUS WORKS FOR LENA IMAGE.

TABLE V .
ENTROPY TEST.

TABLE VII .
CORRELATION COEFFICIENT TEST.

TABLE IX .
KEY SIZE OF THE PROPOSED SCHEMES.

TABLE X .
A COMPARISON OF KEY-SIZE WITH PREVIOUS STUDIES.

TABLE XI .
TESTS FOR 256X256 COLOR IMAGES.

TABLE XII .
COMPARISON FOR 256 X 256 LENA COLOR IMAGE WITH PREVIOUS STUDIES.