An Efficient and Highly Secure Technique to Encrypt and Decrypt Color Images

—Digital color images are considered as the most widely used data. They are exchanged frequently on the internet and via email, so an efficient and highly secure method of color image encryption and decryption is needed. Different methods of encryption-decryption are used, but most of them suffer from low efficiency or low-security level or both. In this paper, an efficient and highly secure method of encryption-decryption will be proposed, tested, and implemented. The efficiency parameters will be calculated and compared with other methods’ parameters to prove the efficiency of the proposed method.


INTRODUCTION
Digital images are one of the most widely used data types, and they are exchanged widely through e-mail and web browsing.A digital image may be confidential or contain highly confidential information [1].In this case, it is necessary to encrypt it in order to make it difficult to identify or the information stored in it.The person authorized to view the image can decrypt it and return it to the original form without any errors.The digital image has a large size, so encoding it may take a lot of time, which leads us to build an effective method that reduces the encryption time as much as possible.

II. ENCRYPTION-DECRYPTION PARAMETERS
Regarding the effectiveness of the image encryption method, the following parameters must be taken into account: • Encryption time: the time needed to process the encryption method in order to convert the original image to an encrypted image.
• Decryption time: the time needed to process the decryption method in order to convert the encrypted image to the original image.Encryption and decryption times must be as reduced as possible.
• Throughput: the number of bits encrypted or decrypted per time unit.It is equal to the image size in bits divided by the encryption or decryption time.
• Speedup: the proposed technique enhancement, which is equal with the proposed technique throughput divided by the throughput of another method.
• Block: the number of bytes to be encrypted/decrypted at the same moment.
• Key size: the number of values (elements) for a secret key, which must be equal with the block size.
• Hacking time: the time needed by an unauthorized person to guess the original image.This time must be as large as possible.This time depends on the length of the key used for encryption-decryption.
• Mean square error (MSE) and peak signal-to-noise ratio (PSNR): MSE is a measure of the quality of an estimatorit is always non-negative, and values closer to zero are better.But for measuring it between the original image and the encrypted one, the value must be very large.PSNR is an engineering term for the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.For ideal encryption, the PSNR between the original image and the encrypted image must be very low, and between the original image and the decrypted one must be infinite (zero errors).These parameters can be calculated using the following formulas: where X and Y are color image matrices, r: rows, c: columns, p: number of colors.

III. RELATED WORK
Some authors take data encryption standard (DES) [2], or advanced encryption standard (AES) [3,4] as bases for encryption-decryption, but most of these works suffer from high encryption-decryption time, which makes these methods inefficient.Author in [5] suggested a method of encryptiondecryption by reshaping the 3D color matrix to a 2D matrix, squaring the matrix, generating a secret key with size equal to the image size, and applying matrix multiplication to get the decrypted image.This method provides a good throughput, but it is very difficult to remember the key, and thus the method requires storing and transferring the key.In [6] an efficient image encryption scheme using double logistic maps was proposed, in which the image matrix was confused from row and column.Confusion effect is carried out by the substitution stage and Chen's system is employed to diffuse the gray value distribution.In [7], a method of encryption-decryption was proposed, this method was based on matrix reordering and it has a medium throughput.In [8], a chaotic algorithm was presented applying encryption-decryption by using power and tangent functions instead of linear function.The process of encryption is one-time-one-password system and is more (but not enough) than the DES algorithm, also it has low efficient parameters with big encryption-decryption time and low throughput.In [9], an asymmetric image encryptiondecryption method was proposed, this method is based on matrix transformation, but it has high encryption-decryption time and thus low throughput.In [10] a method based on Rubik's cube principle was proposed with a good security level, but low throughput.In [11] a method of encryption-decryption was presented, this method is based on using chaos-controlled poker shuffle operation, both variants of this method (A-I and A-II) have a poor throughput.

IV. PROPOSED METHOD
The proposed technique of color image encryptiondecryption requires the following operations (Figure 1): • Dividing the original image matrix into equal size blocks (in our testing experiment the block size was equal to 8 bytes).
• Selecting several secret keys (in our testing experiment we selected 4 keys).
• Key size must equal block size.
• Key value must in the range from 0 to 255.The encryption phase can be implemented applying the following steps: • Get the original color image matrix.
• Reshape the color image matrix from 3D to 1D.
• Divide the 1D matrix into equal blocks with size equal to 8 bytes.
• Define 4 private keys with 8 elements each.
• Each data matrix block must be submitted to exclusive-OR operation with key1, key2, key3, and key4 consecutively.
• The obtained blocks are the encrypted blocks.
The decryption phase can be implemented applying the following steps: • Get the encrypted color image matrix.
• Reshape the color image matrix from 3D to 1D.
• Divide the 1D matrix into equal blocks with size equal to 8 bytes.
• Use the defined 4 private keys with 8 elements each.
• Each data block be submitted to exclusive-OR with key4, key3, key 2, and key1 consecutively.
• The obtained blocks are the decrypted blocks which must be reshaped back to get the decrypted image.
The proposed algorithm provides a high level of security, the number of combinations to guess the four keys is very high and equal to 256 ଼ ൈ 256 ଼ ൈ 256 ଼ ൈ 256 ଼ = 256 ଷଶ making the hacking process very difficult.Figure 2 shows an example of the keys, while Figures 3-5 show the original, encrypted and decrypted images obtained by applying the proposed method.From Figures 4 and 5 we can see that the original and decrypted images are the same.The proposed method can be used to encrypt-decrypt color images of any type or size.Several images were treated by the proposed technique, and Table I shows the results of the implementation.From Table I we can conclude the following: • Calculated encryption/decryption times are significantly small and grow linearly (as shown in Figure 6) when the image size grows.
• The proposed technique is accurate by keeping the decrypted image the same with the original image (zero MSE and infinite PSNR).
• The proposed technique distorts the encrypted image by maximizing MSE and minimizing PSNR between the original image and the encrypted one.
• The throughput of the proposed technique is always between 28 and 29 MBits per second, which is considered a high-performance index.To prove the correctness of the proposed technique, MSE and PSNR were calculated (Table II).The proposed technique was compared with other existing techniques and the results of the comparison are shown in Table III.From these results we can see that the proposed technique enhanced efficiency by minimizing encryption-decryption times, and maximizing throughput which speeds up the proposed technique.Note that increasing the block size will increase the technique efficiency by decreasing the encryption-decryption time and increasing the throughput.The proposed technique was implemented using the previous images with a block size equal to 16 pixels and with one 16 element key, the results of the implementation are shown in Tables IV-V.Here the technique efficiency was rapidly increased but with some negative effects by increasing the PSNR between the original and the encrypted image, which means that the encrypted image moves toward the original image.However, this level of PSNR is still acceptable.

VI. CONCLUSIONS
An efficient and highly secure technique for color image encryption-decryption was proposed.The proposed technique was implemented and tested, and the experimental results showed the following conclusions: • The proposed technique is very efficient by increasing the throughput and decreasing encryption-decryption times.
• The proposed technique is 100% accurate by achieving zero MSE and infinite PSNR between the original image and the decrypted one.
Corresponding author: Majed O. Al-Dwairi www.etasr.comAl-Dwairi et al.: An Efficient and Highly Secure Technique to Encrypt and Decrypt Color Images

Fig. 5 .
Fig. 5. Decrypted image and histograms V. RESULTS AND DISCUSSION

Fig. 6 .
Fig. 6.Relationship between image size and encryption time www.etasr.comAl-Dwairi et al.: An Efficient and Highly Secure Technique to Encrypt and Decrypt Color Images

TABLE II .
MSE AND PSNR CALCULATIONS

TABLE IV .
PARAMETERS FOR BLOCK SIZE =16, ONE KEY Table VI shows the efficiency speedup of increased block size.

TABLE V .
MSE AND PSNR FOR BLOCK SIZE =16 AND ONE KEY

TABLE VI .
SPEEDUP WITH INCREASED BLOCK SIZE