A Novel Based on Image Blocking Method to Encrypt-Decrypt Color

Encryption of digital color image is the process of conversion original digital color image into an encrypted one to protect the image from hacking or to prevent an authorized person to get the valuable information located in the color image. The process of color image encryption-decryption is very important issue in human activities and here in this paper we will introduce a new simple, efficient and highly secure method to be used for color image encryption-decryption. The proposed method will be tested and implemented, the efficiency parameters of the proposed method will be calculated and will be compared with other methods parameters to prove the efficiency issues of the proposed method. Keywords— Encryption Time, Decryption Time, Throughput, MSE, PSNR, Speedup


I. INTRODUCTION
Digital RGB color image can be represented by a 3D matrix, which is consisted of 3 2D matrixes, the first one as shown in figure refers to the red channel (component), and the second refers to the green channel, while the third refers to the blue channel [1][7] [8].Combining the three matrices to gather will give the appropriate color for each individual pixel.
Encryption of RGB color image [19] is the process of conversion original digital color image into an encrypted one to protect the image from hacking or to prevent an authorized person to get the valuable information located in the color image [2], [3].While, the decryption process is considered as the reverse of encryption process that includes of converting back the encrypted color image into its original image without losing any piece of information, which means that the error between the original image and the decrypted one must equal zero.In RGB color images, the encryption process should be carried out before transmitting the image over the internet securely and to ensure that no any unauthorized user can perform any decryption process for this image.The encryption process for image, video and other chaos based techniques have many applications in many areas like medical imaging, internet communication, transmission, military Communication, etc.The progress in encryption techniques is moving towards a future of endless possibilities and applications.The image data have special features such as a huge capability, high correlation between the pixels, and a high redundancy.Encryption techniques are very useful tools to protect private information [4].
Data encryption is the main technique that used to secure the data resources over the internet, intranets and extranets and to provide an authentication process for the users' data resources from integrity, accuracy and safety perspectives [5].
There are many ways to encrypt-decrypt digital color images, and when talking about the efficiency of a particular method, the following important factors must be taken into account: -Encryption time: time in seconds needed to implement the selected method to convert the original image to encrypted one, this time must be as small as possible.-Decryption time: time in seconds needed to implement the selected method to convert the encrypted image to the original one, this time must be as small as possible.-Throughput: number of bits encrypted or decrypted per a second, yjis parameter must be maximized.-Mean square error: mean square error (MSE) is the error between 2 images [6], it is calculated using the following equation: Where: X, Y are the color images; r: number of rows; c: number of columns; p: number of colors (p=3).
In the encryption process MSE between the original image and the encrypted one must be high, but in the decryption process, MSE between the decrypted image and the original one must be closed to zero.-Peak signal to noise ratio: peak signal to noise ratio (PSNR) is most commonly used to measure the quality of reconstruction of loss information, and it is calculated using the following formula: d= max (max(X), max(Y)) The value of PSNR between the original image and the encrypted one must be small, but between the decrypted image and the original one must by high, by these values we can measure the image quality.

II. RELATED WORKS
Recently, many methods have been used for data encryption and decryption.Many of these methods rely on the use of encryption standards like the data encryption standard Many works were done in image encryption decryption (DES) [9], these methods suffer from low throughput causes by a high time of encryption-decryption , which make these methods un efficient [10], [11].
In [12], the author proposed a method of encryptiondecryption by reshaping the 3D color matrix to 2D matrix, squaring the matrix, generating a secret key with size equal image size, then applying matrix multiplication to get the decrypted image.This method provides a good throughput but the size of the encryption-decryption key is very huge, and it must equal the original image size, so it is very difficult to remember the key, and thus the method require more memory space for storing and more time for transferring, thus negatively affecting the proposed here method efficiency.
In [13] an image encryption-decryption method was proposed, this method used a double logistic maps, in which the image matrix was confused from row and column respectively.This method is efficient but the confusion effect is carried out by the substitution stage and Chen's system is employed to diffuse the gray value distribution.In [14] a method of encryption-decryption was proposed, this method is based on matrix reordering and it has a medium throughput.
In [15] a method of image encryptiondecryption was suggested by a Chaotic Algorithm applying using the power and tangent functions instead of linear function.The process of encryption is one-time-onepassword system and is more secure (but not enough) than the DES algorithm, also it has low efficient parameters with big encryption-decryption time and low throughput.In [16], An Asymmetric image encryption-decryption method was introduced, this method is based on matrix transformation but it has high encryption-decryption time and thus low throughput.In [17] a method based on Rubik's Cube Principle was proposed it has a good security level but the throughput is low.In [18] a method of encryption-decryption was presented, this method is based on using Chaoscontrolled Poker Shuffle Operation, both variants of this method (A-I and A-II) have a poor throughput.

III. THE PROPOSED METHOD
The proposed method for encryption the color image can be implemented applying the following steps: 1) Get the original color image.The proposed method for decryption the color image can be implemented applying the following steps: 1) Get the encrypted color image.
2) Reshape the 3D color image matrix to 2D gray image.
3) Divide the 2D image matrix into blocks with equal sizes.4) Use the secret key.5) Get the decrypted block by applying XOR operation between the encrypted block and the key.6) Reshape back the decrypted 2D matrix to 3D matrix to get the encrypted original color image.

IV. IMPLEMENTATION AND EXPERIMENTAL RESULTS
The proposed method of color image encryption-decryption based on 2D matrix blocking was implemented and all the obtained results showed that MSE between the original image and the decrypted one was always zero (PSNR=infinite), which means that there is no loss of information and the decrypted image is the same as original image.Figures (4), ( 5), and ( 6) show some of the obtained results.2. The proposed method uses a key of at least 16 element (4 by 4 matrix with values from 0 to 255, this make it difficult to guess the key and will increase the number of combinations to 256 raised to the power 10, thus will extremely increase the security level of the proposed method. 3. The experimental results showed that increasing the block size will decrease the encryption-decryption times (increase the method throughput which is measured in M bits and obtained by dividing the image size in Mbits by the encryption time in seconds.Table (1) shows the experimental results of applying the method for an image with size equal 8.5876 Mbits using various block sizes, from this table we can see that selecting a 4 by 4 key will give an acceptable performance using a simple small key.From table (2) we can see that the average encryption time is significantly small, which means good performance for the proposed method, also we can see that MSE always has a high value, and PSNR has a small value, meaning that the image was really encrypted.
From table (2) we can see that increasing the image size will lead to increasing the encryption time and the relationship between the encryption (decryption) time and the image size is closed to linear relation as shown in figure (7).Color image matrix is consisted of three 2D matrices, the first one for the red color, the second for the green color, and the third one for the blue color, So we can extract the matrix of each color, then encrypt it and after that reconstruct again the encrypted three 2D matrices to get the encrypted color image.
The proposed method was implemented several times using various images, the two approaches were used and the experimental method showed that reshaping approach gave better results than the extraction-reconstructing approach as shown in table (3).For performance analysis the encryption-decryption methods listed in table (4) were implemented and compared with the proposed method results, these results showed that the proposed method has a better parameter and using the proposed method will enhance the encryption-decryption process and the proposed method always has the smallest value of encryption-decryption time and the biggest value of method throughput A novel method of color image encryption-decryption process was proposed, implemented and tested.The obtained experimental results proved the following facts: -The proposed method can be used to encrypt-decrypt any color image with any type and any size.-The proposed method has a higher efficiency parameters comparing with parameters of existing methods of color image encryption-decryption.-The proposed method is highly secure, and the high level of security can be achieved depending on the private key complicity.-The private key is not fixed in size, and the key size depends on the block size.-Reshaping the color image to be used in the proposed method will give better performance.

2 )
Reshape the 3D color image matrix to 2D gray image as shown in figure(2).3)Divide the 2D image matrix into blocks with equal sizes as shown in figure (3).4) Select a secret key with size equal block size (each element in the key matrix must be within the range 0 to 255).5) Save the secret key to be used in decryption phase.6) Get the encrypted block by applying XOR operation between the original block and the key.7) Reshape back the encrypted 2D matrix to 3D matrix to get the encrypted color image.

Fig 7 .
Fig 7. Relationship Between Encryption Time And Image Size

TABLE 1
The proposed method was implemented using various color images in type and size fixing the block size to 4 by 4 and the results of this experiment are shown in table2