A Modified Advanced Encryption Standard for Color Images

The widespread use of images, especially color images and rapid advancement of computer science, have led to an emphasis on securing these images and defending them against intruders. One of the most popular ways to protect images is to use encryption algorithms that convert data in a way that is not recognized by someone other than the intended user. The Advanced Encryption Standard algorithm (AES) is one of the most protected encryption algorithms. However, due to various types of theoretical and practical assaults, like a statistical attack, differential analysis, and brute force attack, its security is under attack. In this paper, a modified AES coined as (M-AES) is proposed to improve the efficiency of the AES algorithm by increasing the algorithm's security to make the algorithm more suitable for color image encryption, and make it more resistant to many attacks. The modification is conducted on ShiftRows transformation of the original AES algorithm. To test the efficiency of the proposed M-AES algorithm, several images are drawn from the Signal and Image Processing Institute's (SIPI) image dataset. Moreover, the Mean Square Error (MSE), Peak Signal-to-Noise Ratio (PSNR), Entropy (H), Correlation Coefficient (CC), visual evaluation of histogram, Number of Pixels Change Rate (NPCR) and Unified Average Changing Intensity (UACI) are used as an evaluation metric. The results show that proposed modification to the AES algorithm makes the algorithm more appropriate to image and surpasses the original AES.


Introduction
The widespread usage of images on the Internet requires a fast, reliable, and robust security to store and transmit them over the network [1], and Image Security has become a critical issue [2]. One of emerging challenges in image processing especially color images is that encryption techniques need an additional requirement because image data have properties like high redundancy, bulk capacity, and high correlation between the pixels. Therefore, having an efficient cryptographic algorithm is considered to be imperative, to provide higher security in images, and to protect the images from any attacker [1].
Advanced Encryption Standard (AES) is one of the most commonly and widely symmetric block cipher algorithms used for protecting multimedia data such as images [3]. Attacks considered during design of AES includes statistical attacks, differential cryptanalysis, square attacks, and related key attacks. At the moment AES algorithm has not been broken. However, cryptanalysis of AES has not stopped [4]. But, since standardization of AES in NIST FIPS-197 and its adoption for use in a wide range of high-security applications has resulted in wide examination of vulnerabilities in AES and has also given rise to extended forms of attacks [5], so main focus of this paper is to supplement the standard AES and propose a new modification on AES design to enhance its security by increasing randomness and level of security of AES algorithm to make it more suitable for encrypting color image. The rest of the paper is structured as follows. Section 2 presents related works. Original AES algorithm is explained in section 3. The proposed modification to AES algorithm for color image encryption is discussed in Section 4. Results and conclusions are provided in sections 5 and 6, respectively.

Related works
In the last years, various approaches and techniques have been introduced for modifying Advanced Encryption Standard (AES) algorithm [6]. Wadi & Zainal in 2014 proposed a modification on standard AES by conducting three modifications, first by using MixColumns transformation in five rounds rather than ten rounds in the original AES-128. The second modification is changing the key schedule operation by adding MixColumns transformation to the operation. The third modification is a simple S-box used for encryption and decryption instead of S-box in the original AES [7]. Kaur & Mehla in 2014 proposed a revised version of AES algorithm. The alteration is made on various transformation steps in AES algorithm. Basically, the modification is focused on ShiftRows transformation, MixColumns transformation, and key expansion modification. The modified algorithm takes less time than the original, and it is secured against brute force attack [8]. In 2015, Vaidehi & Rabi made modifications to AES algorithm for reducing hardware complexity and energy consumption of AES Encryption to strengthen AES encryption using Common Subexpression Elimination (CSE) technique to develop the Enhanced MixColumns transformation for AES encryption. Enhanced MixColumns transformation results showed a 10.93% decrease in Slices, a 13.6 % decrease in LUTs, and a 1.19% decrease in delay consumption compared to conventional MixColumns [3]. In 2015, Abdulgader et al. suggested modifications to enhance the AES algorithm's performance and make it more suitable for secured image storage and transmission. The modification includes a circular shift and a round key to make S-box depends on secret keys and the MixColumns is replaced by chaotic maps. The comparison shows that the proposed method offers strong encryption efficiency and takes less time to encrypt images [9]. In 2015, Alabaichi & Salih proposed an update to AES algorithm, which included AES dynamic S-box generation. The produced S-box is more dynamic and keydependent, making it more challenging for differential and linear cryptanalysis. Compared to the original AES, result of that enhancement showed that it provided more security [2]. In 2016, Hoomod & Zewayr suggested a new chaotic method for improving AES by removing the transformation of MixColumns to decrease the time needed for this process. Compared to traditional MixColumns operation, result of the new method showed the enhancement of protection by providing more entropy and better correlation [10]. Riyaldhi & Kurniawan in 2017 proposed a modification that has been made by reducing ShiftRows circular process and S-box modification for MixColumns transformation. Result showed that the percentage improvement in the encryption process is 86.143% and the decryption process is 13.085%, and the method needs to consume a bigger memory to store two modified S-box map and Array ShiftRows map [11]. D'Souza & Panchal in 2017, proposed AES for the message transmission algorithm using a hybrid method to dynamic key generation and dynamic S-box generation. Results showed that the proposed change offers high security and increases the uncertainty of the ciphertext. In addition, it defends the message from brute-force, algebraic, linear, and differential attacks [12]. In 2018, Felicisimo & Wenceslao proposed a modified AES algorithm using many substitution boxes (S-boxes), Where the Rijndael S-box is the first S-box and the second S-box is built via an XOR operation and affine transformation, the MixColumns operation is replaced within the cipher's internal rounds. Results of simulation testing showed that a substantial difference in speed efficiency has been found between the two versions that favor the proposed AES algorithm using multiple S-boxes. The results also revealed that AES-2S-box performed more efficiently compared to the original AES [1]. A modified AES algorithm that addresses necessity image encryption was proposed by Gamido et al. in 2018. The modified algorithm used bit permutation instead of Mixcolumn to reduce the algorithm's computational requirement for encrypting images. The result showed that an entirely different encrypted image was generated by the modified algorithm and that whenever there is a slight change in the plaintext image, there is a major difference in the encrypted image. The result also revealed that the proposed algorithm is faster than AES and is amenable to statistical and differential attacks, causing it more suitable for image encryption [4]. In 2019, Thinn & Thwin suggested AES modification by including an extra or second key. As well as another change to the original SubBytes operation is done by using transportation operation. The proposed algorithm gave a good performance, high security and it can be applied to applications that share sensitive data via an insecure network [13]. Singh et al. in 2019 proposed modification on AES algorithm by using a new Dynamic AES algorithm developed that done by generates dynamic key-dependent S-boxes with dynamic irreducible polynomial and affine constant. Singh et al, in 2019, proposed a modification on AES algorithm by generating dynamic key-dependent S-boxes with dynamic irreducible polynomial and affine constant. Modified AES and standard AES algorithms are used for encrypting a color and grayscale image. It observed that both algorithms did well [14]. Kumar & Karthigaikumar in 2020, proposed to change the AES algorithm by using dynamic ShiftRows, SubBytes, and MixColumns operations in 2020. The security of the AES algorithm has been improved by achieving a larger avalanche effect than that of the traditional AES [5]. In 2020, Lavanya & Karpagam suggested a change to AES algorithm through a change in cipher processing and key expansion. The modified AES key schedule algorithm with an active key added sub-function has shown a gradual increase in unpredictability and distribution features. The modified AES produced an improved performance in terms of balance and hamming distance and reduces the ciphertext's statistical cryptanalysis when compared with the original AES. It also raises the algorithm's complexity.

Advanced encryption standard
AES is a cipher algorithm for symmetric-key blocks. It has been selected as a standard among symmetric cipher algorithms because of its high performance [4]. In AES, rounds consist of four encryption transformations. SubBytes, ShiftRows, MixColumns, and AddRoundKey. The cipher rounds are shown in the following four transformations. 1.
The SubBytes transformation is a non-linear byte substitution that applies to each byte of the State independently [12]. This transformation includes substituting different values for the bytes of the state matrix. Using a substitution table called S-box. The AES S-box is a permutation of 8-bit values with a total of 256 entries constructed as a 16 x 16 lookup table. For the 16-byte state array, substitution is performed byte-by-byte. The left half of the selected byte selects the rows in the s-box, and the right half of the selected byte selects the sbox column. The corresponding row and column crossing point on the s-box table is the byte that substitutes the corresponding byte. In order to substitute all the contents of the state array, this step is repeated in the same way [5].

2.
The transformation of ShiftRows is a simple byte transposition [12]. Based on their row location, every row of the state matrix except the first row is cyclically left-shifted [5]. The second row is shifted by one byte, the third row is shifted by 2 bytes, and the fourth row by three bytes [11].

3.
The MixColumns transformation is done by combining each state column by carrying out matrix multiplication with a fixed square matrix, and it operates on the state column by column [15]. 4.
AddRoundKey transformation, the round key is XORed with the state array after SubBytes, ShiftRows, and MixColumns transformation to generate the intermediate cipher results [5]. Reverse operations of the encryption method are the decryption of the AES. Every round consists of four processes carried out in reverse order during decryption: InvAddRoundKey, InvMixColumns, InvShiftRows, and InvSubBytes [4]. In all rounds, the four transformations are present. Inverse MixColumns will no longer perform in the final round [12]. Figure 1 illustrates the structure of AES algorithm.

The proposed modified AES (
) for color image The proposed image encryption aim is to get a cipher image from a plain image by modifying the original AES. The following subsections present the proposed AES and how it is used to encrypt an image.

Modified AES (
The characteristics of the proposed modified AES ( ) concentrate on increasing level of security of AES algorithm. Core of the proposed method is to replace ShiftRows transformation of original AES by another one coined as mShiftRows. Structure of the algorithm is like the original AES completely except replacement of ShiftRows step by (mShiftRows) step, which will be explained in next subsection. Figure 2 illustrates overall structure of the proposed modified AES ( ) algorithm.

Figure 2-
The overall structure of the proposed modified AES ( ) algorithm.

Modified ShiftRows (mShiftRows)
The proposed mShiftRows transformation tries to make statistical relationship between both plaintext and ciphertext as complicated as possible to impede the key from being inferred. This can be done by performing the following two steps: 1.
Re-arrange the column transformation is used to re-arrange the columns of the state array by replacing the first column with the fourth. The fourth column takes the first position, the third column is replaced by the second column, and the second column takes its place (see Figure 3). In this scenario, the diffusion property will be improved by the permutation process on the value of a state array. Figure 4 provides an example illustration of the proposed idea of this transformation.  Figure 6 gives an example illustration of the proposed idea of this transformation.  For the decryption process, the proposed InvShiftRows transformation is adopted. In which same structure of mShiftRows with reverse process is applied. That means Inverse zigzag process is applied to the state array. Then Inverse of the re-arranged the column is performed.

2 Encryption color image by using algorithm
For Encrypting color image using algorithm, first A color image of size is disintegrated into three components and Then, each component is encrypted independently using with a secret key of 256 bits to produce three encrypted components and . Finally, the three encrypted components are merged to produce a ciphered image . Figure 9 depicts the whole encryption process of the proposed method.

Experimental results
The proposed has been tested for various 24-bit color images of size ( pixels. These images are available at the USC-SIPI image database in bmp format. The evaluation of the encrypted image is based on histogram analysis, correlation coefficient, information entropy, NPCR, UACI, PSNR, and MSE. The experiments are conducted on a computer with Intel Core i5 CPU @ 2.70 MHZ with Windows 10 using MATLAB software. All the experiments encrypt the original images with a key of length 256 bits.

Evaluation concerning statistical attack
In the statistical attack, the attacker utilizes statistical weaknesses in a cryptographic scheme to identify data that is confidential. The is evaluated regarding entropy (H), histogram analysis, and correlation coefficient to illustrate its ability to withstand statistical attacks. Information entropy is one of the quantitative measurement kinds that evince how random a signal source. It can be defined as in Equation 1.
( ∑ ( ( (1) In which P (m i) and log refer to the probability of occurrence of symbol m i and the base 2 logarithm, respectively [16]. Correlation coefficient (CC) is calculated as in Equation 2 which measures the correlation of adjacent pixels [17].   Table 2 quantifies the average correlation coefficient in horizontal (H), vertical (V), and diagonal (D) directions for cipher image of . The results indicate that are better than the AES to resist the statistical attack. Figure 12 and 13 show the distribution of two adjacent pixels in V, H, and D of plain and encrypted images respectively. The figures obviously reveal that correlation coefficients between pixels in three components of the plain image and its corresponding encrypted image are very small which clarify that the encrypted image presents the properties of a random image and the M-AES surpasses the original AES in correlation which provides a high random image.

Evaluation concerning the differential attack
NPCR and UACI metrics are applied to analyze the impact of altering one pixel in the plain image on the cipher image that are calculated as in Equations 3 and 4 respectively [3]. Where: and are image width and height respectively, and and are encrypted images of the plain image and the modified one [18].
[∑ ( ( ] (4) Detailed results reported in Tables 3 and 4 clarify that is very sensitive to a slight change of LSB of key and able to resist the differential attack.

Evaluation concerning MSE and PSNR
Mean Square Error (MSE) is used to assess the performance of using . MSE is denoted by Equation 5 [19].
∑ ∑ ( ( ( (5) Where C (i, j) original image pixel, C′ (i, j) is encrypted image pixel and M and N are the size of the original or encrypted image. Peak Signal-To-Noise Ratio (PSNR) is one of the metrics used to estimate encryption quality in the image encryption system [3]. PSNR is defined in Equation 6 The results from Table 5 point out that the MSE value between the cipher image and the plain image is large. This means is more immunity to attacks than the original AES. The PSNR value between the original image and the encrypted one is listed in Table 6. Results reveal that values between the original and encrypted images via are small and better than the original algorithm which means that the attacker unable to recognize the image.

Evaluation concerning the key sensitivity analysis
Key sensitivity is a significant influence on the security of the cryptosystem. The changes of one bit in the secret key have to be followed by the generation of a completely different encrypted result [18]. A good encryption algorithm should be highly sensitive to change in the secret key [20]. proves the high sensitivity of the encryption key as shown in Figure  14 that depicts the key sensitivity of regarding of encryption and decryption respectively, where the keys are differed in one bit. The figure shows that decryption process is not capable of recovering the original image when a slightly change was performed to the secret key. ).

Conclusions
This paper proposed a modification to the AES algorithm for color image encryption, which is called a Modified Advanced Encryption Standard ( ) to improve the security level of the encryption process. The modification is conducting on the ShiftRows step of the original AES algorithm by replacing it with two steps. First step is done by re-arranging columns of the state array, and second step is done by conducting zigzag transformation on the state array. Through the evaluation of , the results clearly showed that the proposed method exhibits the lowest correlation coefficients among pixels in the encrypted image of the original AES algorithm ,and the results of some metrics, such as entropy, histogram distribution, proved that the is strong against Statistical attacks. The results show that method provides good encryption quality compared with the AES algorithm. The is sensitive to any changes that occur in the secret key, thus making the method robust against any attack. Differential analysis shows that the is robust, and that it prevents differential attacks. Through the evaluation of , the results show that it provides a better security level when a comparison was made with AES. Therefore, is highly secure and is suitable for color image encryption.