Image Encryption Technique based on the Entropy Value of a Random Block

The use of digital images in most fields of information technology systems makes these images usually contain confidential information. When these images transmitted via the Internet especially in the Cloud, it becomes necessary to protect these images in a way that ensure putting the confidential information that are contained far away from the attackers. A proposed image encryption technique has been presented in this work. This technique used a secret key that is extracted from the image content itself. Therefore, there is no need to find a secret channel to exchange any key where, sender and receiver authenticate each other with regards to a shared secret key extracted from the image. The technique constructs its secret key that is used to encrypt the image, based on the entropy values of a set of randomly selected blocks from the image itself. Vairous experiments have been conducted to evaluate the strength and performance of the technique. The experimental results shows that the proposed technique can be used effectively in the field of image security to protect and authenticate images. Keywords—Image security; image encryption; secret key; image authentication


INTRODUCTION
With the rapid expansion of modern network technology such as Cloud computing, many of current applications such as Facebook employed cloud storage services to store multimedia data (e.g., Images and videos).Due to the fact, that images may contain private information that may be related to personal interests or financial affairs, the deliberate disclosure of confidential content becomes a critical issue for people and organizations [1]- [4].
Images need to be accessed and shared over the cloud securely.Image encryption is an efficient mechanism to contribute security for these images.Encrypting image is defined as protecting visual image through the Internet from hacker attacks [5].In recent years, various image encryption algorithms have been proposed using cryptographic techniques by modifying their pixel values or locations [6]- [8].Cryptographic techniques are categorized into symmetric and asymmetric encryption.Symmetric key encryption algorithm [9] uses one key for encrypting and decrypting image respectively.Obviously, it requires keeping the key secret.If the hacker knows the key, image decryption can be done easily.In contrast, asymmetric key encryption algorithm [10] employed two keys: public and private key.Recent studies mentioned that asymmetric key encryption is slower than symmetric key encryption algorithms [11].Furthermore, asymmetric encryption algorithm has higher computational complexity which, are most of the time prohibitive for images and mathematical correlation between public and private keys may help attackers to hack the image [12].This might be solved by using secret keys for image encryption or longer sized keys which are difficult to violate by attackers.
Due to digital images have intrinsic characteristics such as redundancy of data, less sensitive, a correlation between pixels and data capacity, it is difficult to handle these issues by using asymmetric cryptographic techniques [13].They are not suitable for image encryption, while symmetric key image cryptograpphic algorithms appears to be a promising direction which takes profit from these characteristics to encrypt images [14].
The proposed method assumes that image is encrypted at rest with some secret key which, is not available to the attacker.To achieve this issue, the proposed method is developed based on entropy values of the image itself as secret key.The secret key will differ from one image to another.The fact that the attacker may have the historical secret key no longer matters because all the old keys are meaningless.The proposed method has the ability to resolve security problems caused by large data capacity and high correlation among pixels for color image encryption.
The rest of this paper is organized as follows: Related Works will be covered in Section 2. Section 3 describes the Proposed algorithm in detail.Section 4 presents Experimental results and performance analysis.In Section 5, Conclusions are drawn.

II. RELATED WORKS
The main goal of image encryption techniques is to convert source images into limited formats such as texture based or noise based format encrypted images.The pixel values of encrypted images have been changed to prduce a noise image, which arise the information leakage of image content and hide the visual meaning of these images over the cloud.From the security viewpoint, texture based or noise based format pixel features in the encrypted images would efficiently decrease the risk of an encrypted image being attacked and altered.This interesting issue motivates us to present a novel image encryption technique based on entropy features as secret keys www.ijacsa.thesai.orgfor transforming image into a nearly uniform distributed pixel values in the image to achieve privacy and confidentiality [15].
In recent years, image encryption techniques have been proposed to provide privacy preserving for digital images stored in cloud storage.Image encryption has become the hot topic of exhaustive research as its potential to transmit images more securely.Image encryption techniques can be categorized into: 1) Frequency based image encryption and 2) Spatial based image encryption.Hence, using secret key, the frequency based image encryption algorithms are developed to transform image content in the frequency domain such as the Discrete Cosine Transform (DCT) [16], Discrete fractional Fourier Transform (DFFRT) [17], [18], Quantum Fourier Transform (QFT) [19], Fresnel transform [20], Hartley Transform [21] and Gyrator Transform [22].
The spatial based image encryption techniques are based on two common operations: Substitution and Permutation, where substitution is used to change pixel values and a permutation process is used to shuffle pixel positions in the image.The permutation and substitution processes can be used in spatial based image encryption algorithms like Data Encryption Standard (DES) [15], Advanced Encryption Standard (AES) [23], Rivest, Shamir and Adleman (RSA) [24], P-Fibonacci transform [25], wave transmission [26], elliptic curve ElGamal [27], gray code [28], random grids [29], Latin squares [30] and chaotic mapping [31].
In the first category, the digital image is divided into blocks and transformed into the frequency domain to extract features.These features are disordered to make the original image is invisible.For instance, Phalavan et al. [16] proposed an image encryption method based on DCT coefficients, where the image is divided into 8  8 blocks and then extract high frequency DCT coefficients from these blocks.The main advantage of high frequencies DCT is representing more details in the image content.The secret key for their technique is generated based on cellular automata.Finally, the image blocks were encrypted using a secret key with XOR operation to disorder the values in each block.
Guo et al. [17] used Double Random Phased Encryption technique (DRPE) to encrypt the image where, binary image is used as secret key.Their method is robust of noise addition and the errors in the secret keys, which employed through decryption steps.Similarly, Lima et al. [18] divided grayscale image into blocks with size 8  8 pixels.The image blocks were encrypted with a secret key based on Galois Field Fractional Fourier Transform (GFFFT).The size of secret key is 140-bit, which makes their method has a large key space resist a brute force attack.
In [19], quantum gray level image representation and image encryption is proposed based on QFT.The correlation between adjacent pixels in the encrypted image and its original image is computed.Their method gives high level of security, where random relation exists in the encrypted image.
Singh et al. [20] proposed a scheme that transform an image into complex image subjected to Fresnel transform to extract frequency coefficients.The Devil's vortex toroidal lens phase mask is applied in the frequency domain to produce an encrypted image.The mean square error is computed for their method to show the robustness of encryption algorithm against Gaussian and speckle noise.
Lin et al. [21] proposed to use image scrambling in frequency domain based on Hartley transform.The input image is converted into Arnold cat map space plane and then, it is divided the image into 3  3 blocks.Later, blocks are encoded by H matrix of Heatley transform.
Liu et al. [22] proposed to use an iterative image encryption structure, in which Henon mapping is applied for the input image.Then, mapped image is transformed through gyrator transform to encode the image.
In the second category, Yun-Peng et al. [15] proposed a conventional encryption technique by combining DES algorithm with chaotic sequence to encode the image.The key size for encryption method is 264 bits, which is much larger than the traditional DES algorithm to resist against brute force attacks.
In [23], an image encryption algorithm with a framework of combining diffusion and permutation is proposed.The input image is divided into blocks with size 8  8 pixels.Each block is encoded based on pseudo random numbers which extracted from spatiotemporal chaos.Finally, the permutation of each block is computed using AES.Their method achieved a high speed by avoiding some time consuming operations.
Zhao et al. [24] used RSA encryption algorithm to scramble grayscale image.This algorithm is limited and not suitable for practical images due to large number of permutation rounds.It may not be the most desirable algorithms for digital image encryption, especially for real time systems.Zhou et al. [25] introduced a new method for encrypting images by combining bit plane decomposition and image permutation.They used Fibonacci P-code transformation to scramble image.Their method is robust to various common attacks like noise, data loss, brute force and plaintext attacks.
Chen et al. [31] developed an encryption method based on Henon chaotic function and Logistic map for encrypting image and the secret key respectively.
Both the frequency based and spatial based image encryption techniques have the ability to increase the level of security to protect images.They are evaluated based on four factors: Security, Speed, Key space analysis and Correlation.

III. PROPOSED MODEL
One most concern of the proposed method is how to generate a secret key from the image properties itself.The image is encrypted and shared through some secret means between sender and receiver.So, the attacker struggles to know the secret key unless he has the same image and the algorithm used for the decryption of the image.The strength of the proposed method comes from the key where it is not dependent on algorithm steps being secret.This leads that, it is difficult to obtain the secret key value out of the possible key space.Therefore, a set of main objectives has been established to be www.ijacsa.thesai.orgachieved within the proposed technique : A. No need to exchange any secret key via a secure channel between sender and receiver.

B.
A secret key used in encryption operation is extracted from the image itself.
C. The size of the secret key varied based on the nature of the image.

D.
Trying to use a secret key that contains as more as possible of random values.

E.
Apply substitution and transposition operations on the image within two different levels of implementation (on block of bytes and on a single byte).
The main stages that the proposed image encryption technique involves are depicted in Fig. 1.
To give readers a clear understanding of the implementation details of each stage of the proposed technique, we give below some necessary definitions and terminologies:  3) Secret Key (K) Consists of a set of 2D blocks, it is divided into two parts: Master Block MB and the Remaining Blocks RB.All blocks are of the same size.The size of each block (i.e., number of rows and columns) is based on the image size and is calculated using the equations ( 1) and (2).
) Entropy is simply the average (expected) amount of the information from the data [32].Information entropy is an important feature of randomness.Here, the entropy value is calculated by the equation (3).
Where number of different data values, is probability of occurring the data value .
The main stages that follow in the encryption phase of the proposed image encryption technique are given below: Stage 1: From the source image size (i.e., its Width and Height), calculate the dimensions of the secret key blocks (R and C) using the equations ( 1) and (2). .This part of the secret key K (i.e., MB) will be used later to construct the second part of the secret key K (i.e., RB).An example of the MB is shown in Fig. 2.   In the proposed image encryption technique, we can note that there is no need to exchange any key between sender and receiver.The key size used (i.e., number of RM blocks used) and the values of bytes in each block vary based on the image data itself.This makes the technique easy to use by the users and more difficult against the attackers.Furthermore, the proposed method leads to the uniformization of the histogram of the encrypted images, which makes it more secure against statistical hacks as shown in Section 4.

IV. EXPERIMENTAL RESULTS AND DISCUSSIONS
In order to evaluate the performance of the proposed technique, the necessary programming codes using C# language are written.Different images used in the experiments to test the technique.Some of these images are listed in Fig. 5.The encrypted images that are produced from the source images in figure 1 are depicted in Fig. 6.
To make a performance comparison between the proposed image encryption technique and the well-known encryption techniques such as Data Encryption Standard (DES) [15] and Advanced Encryption Standard (AES) [23].A set of measures (visually and numerically) has been used: Image histogram, Peak Signal to Noise Ratio (PSNR), encryption time, the key size, the complexity of the key and the sensitivity of the key.

1) Image histogram: good image encryption technique is
the one that is able to achieve a high distortion in the distribution of color values of the encrypted image compared with the distribution of color values of the source image.Fig. 7 shows the histogram of the source image (Beach) and its encrypted image using the proposed technique and the DES and AES techniques.2) Peak Signal to Noise Ratio (PSNR): a numerical measure that is used to calculate the ratio of noise that is occurring in the encrypted image and it is caused by the implementation of the encryption technique on the source image.Good image encryption technique is the one that is producing high ratio of noise in the encrypted image with a low PSNR value [33], [34].The PSNR is calculated using the equation ( 5) and (6), where MAX represents the maximum byte value in the image and I and E are the source image and the encrypted image respectively.Table 1 records the PSNR of the encrypted image in the proposed technique and DES and AES techniques.
3) Encryption time: the time needed to complete the encryption phase is one of the common factors that is used to evaluate the performance of the encryption technique.A good image encryption technique is the one that is conducting its encryption operations in a short time.4) Key size: the encryption technique becomes strong whenever it can be used a proportionally large key.The key used in the proposed technique is actually large because it consists of a set of blocks (i.e., RB) and each block consists of a number of bytes.This makes the bits that represent the secret key used by the proposed technique is large.To illustrate this, we assume that the block dimension is (R=4 and C=4).This means that each block of the RB has 16 bytes.And if there are 5 blocks in RB, this means that the number of bits that represent the key is 640, where it calculated using the equation (7).While the DES algorithm uses a key contains 64 bits and the AES algorithm uses a key contains 128 to 256 bits.

∑ [
]     5) Complexity of key: is the ratio of randomness and the composite use of the key in the implementation of the operations of the encryption technique.The proposed technique uses a key that is extracted from the image itself and it contains really random bytes.In addition, it uses key in two levels of implementation of the operations (block and byte level).
6) Sensitivity of key: it means that if we change only one bit in the key used, the technique produces, from the encrypted image, an image that is a completely different from the source image.This forces the attacker to know all the bits of the key to be able to recover the source image from the encrypted image.To prove that, in the proposed technique, we changed one bit in the key used to encrypt one of the images in Fig. 5 and try to decrypt the encrypted image.The produced image is completely different from the source image as shown in Fig. 8.
7) Correlation Analysis: is the value that depicts the relationship between the adjacent pixels values in the encrypted image.Whenever the correlation value is small this means that the encryption technique achieved high randomness between the adjacent pixels in the encrypted image.The calculated correlation values for the proposed technique and DES and AES techniques are listed in Table 3.

V. CONCLUSION
This paper introduced a novel image encryption scheme based on Entropy values of selected blocks and perform XOR permutation at the block level with the transposition operation at the byte level.The Entropy is computed from the selected block in the image whose size is based on the image size.The rest of blocks are selected which they have the same entropy to be as candidates used for generating large enough secret key space to encrypt the image later.High level of security is achieved by using a random secret key.This leads that different image should have a different random key for encryption.Experimental results show that the scrambled image has approximately uniform histogram pattern and can be considered as a nearly random image.The security analyses also demonstrate that the proposed method is sensitive to the nature of source image and the encryption key.Therefore, the proposed method has high security and can resist against most common attacks.However, we have found from the experimental results that the secret key values may be different from one image to another which adds more ambiguity at the side of attackers about the key itself.The future work is to investigate the common malicious attacks that can be applied to images such as copy move forgery and image splicing in the field of image forensics.

1 ) 2 )
Source Image (I) is a bitmap color image of size (WidthHeightPalette).Where: Width is the width of the image, Height is the height of the image and Palette equal 3 which represents the three colors (R: Red, G: Green and B: Blue).Encrypted Image (E) is a bitmap color image of size (WidthHeightPalette).Where: Width is the width of the image, Height is the height of the image and Palette equal 3 which represents the three colors (R: Red, G: Green and B: Blue).The image (E) is produced from the technique after encrypting the source image I.

Stage 2 :
Build the Master Block MB of the secret key K by using a pseudo random generator with a seed value  .Random values of bytes are filled in MB.The value of each byte is between

Stage 3 :
Calculate the entropy value of the MB EntropyMB using the equation (3).

Fig. 5 .
Fig. 5.Some of the images use in the experiments.

Fig. 6 .
Fig. 6.The encrypted image from the images in Fig. 5.

Fig. 8 .
Fig.8.The source image resulting from the encrypted image using the wrong key (Perta image in Fig.5).
Table 2 summarizes the encryption time of the proposed technique and DES and AES techniques.