Image Encryption using Curved Scrambling and Diffusion

- In the recent world, designing of a secure cryptosystem is prime focused area for the researchers. This paper emphasizes on the image encryption/decryption technique using a key derived from a plain image. In the proposed algorithm, encryption key is derived by applying new curved scrambling method to the RGB layers of a plain image. In next step, a temporary cipher image is obtained by modulo arithmetic using encryption key. To enhance security level, execute additional diffusion method to reset the pixel values within the given block and finally generate a cipher image. The described algorithm achieves a larger key space, good statistical property and effective resistance to the brute force attack thus provides highly secure cryptosystem for the real world applications.

make it secure from the differential attack. Author generate encryption key sequence by utilizing piecewise linear chaotic map and proposed a stream cipher algorithm for colour image encryption based on on-time keys and robust chaotic maps [12]. A symmetric key image encryption algorithm is proposed by the author [13] in which additive and affine encryption technique using six schemes of key sequence derived from random sequence of cyclic elliptic curve points is discussed. The result concluded that the proposed cryptosystem is secure from statistical, brute-force and cryptanalytic attacks. A combination of one-time key based on crossover operator, chaos and secure hash algorithm (SHA-2) is employed to design a cryptosystem for the colour image encryption [14]. In the paper [15], the proposed encryption method utilized the magic rectangle in addition to traditional public key cryptography algorithm such as RSA.
III. PROPOSED METHOD An algorithm is proposed to encrypt/decrypt a given image using another plain image. Before applying encryption function, images are converted into three matrices of red, green and blue color pixels respectively. The algorithm consists of two major steps to achieve higher level of security.

A. Curved Scrambling
Fig 1 displays that how curved scrambling process executes using eight bits' binary digits of each pixel value of image used to encrypt the given image. The process of scrambling is as follows: First convert the plain image into RGB intensity value, and then convertRGB matrix into R layer, B layer and G layer matrix separately.After that decode each element value of the matrix into binary number of eight bits. The process of curved scrambling executed on the bit value of each and every pixel of all three layers independently. Let's assume for R layer the current pixel value is X, the previous pixel (backward) value of the current pixel value is Y and the next pixel (forward) value of the current pixel value is Z. Add extra index having value zero(0) with the first and last index of the matrix for making calculation easy of forward and backward pixel values. R layer matrix-  The bit values of pixels X, Y, and Z in R layer are denoted by (X7 X6 X5 X4 X3 X2 X1 X0), (Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0) and (Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0) respectively. In the process, the odd bits of X are calculated through an AND operation with Y, and the even bits of X are calculated in the same way with Z. After completion, the bit values of pixel X in R layer are reset. The used function is: For example, let the current pixel value of X in R layer is 142 i.e. 10001110 in binary, Y is the backward pixel having value 178 i.e.10110010 in binary and Z is forward pixel having value 75i.e. 01001011 in binary. Now after applying Equation (1), we will get new value of X i.e.130 in decimal. Update the new value of X in the R layer with of current value of X. Similarly continue the process for each pixel value in R layer as well as for pixels of G layer and B layer matrices.

B. Encryption with Diffusion
After applying curved scrambling to the plain image, obtained image will be treated as encryption key to encrypt the given image. The following equation is used to encrypt the plain image with the scrambled encryption key and got the temporary cipher image = ( + ) Eq (2) where is the pixel value of (i,j) coordinate of given image, is pixel value of scrambled image and is pixel value of temporary cipher image which is obtained after encryption process. The color of used image in this experiment is 256-color i.e.l=256. Diffusion process is nothing but rearrangement of the pixels by performing some calculations within the block so that an unauthorized person could not be able to access the information in transit. The process starts with the RGB matrices of temporary cipher image obtained in the previous step. In this phase encrypted cells of previous and current matrices are XOR-ed with one-another according to given function. Encryption Function: Cell C' can be obtained from Cell C as, Start with the first pixel value of cell C i.e.1, so according to given function the value of cell C' will be same as cell C. Next pixel value from left to right in the cell C is 2, after calculation the value of cell C' will be 3 i.e. 00000010XOR00000001. Likewise, all values will be calculated for the given layer as well as for the other two layers according to given sequence.

C. Decryption
At the receiver end, decryption process is implemented just reverse of encryption process because of symmetric nature of algorithm. The decryption process starts with the anti-diffusion in the reverse direction and the function used is: Eq(4) After successfully applying the above function, Cell C is obtained from Cell C' which is the temporary cipher image. Next step is to execute reverse modulo operation to get the actual given image. The equation is as follows: = ( − ) Eq(5)

IV. ALGORITHM
The encryption and decryption process can be stated in the following steps: (1) Select a plain image which will be used to generate encryption key and a given image which is to be transmitted in encrypted form and then enlarge both images to the size of M*N. (2) Convert both images into three layer matrices i.e. red, green and blue and represent each pixel to its eight bits' form (binary). (3) Apply curved scrambling process to the plain image pixels and generate key used to encrypt the given image. (4) Encrypt the given image by modulo operation with the encryption key obtained from the previous step.  RESULT AND DISCUSSION The proposed algorithm is implemented using JAVA TM and used miscellaneous images to work upon. The thing is to be considered is that the both images i.e. plain image and given image must be of same size. The whole algorithm runs in one iteration and produced the desired output. Here fig 6 is the given image which is to be transmitted in encrypted form and the encryption key is derived using the plain image given in fig7.After performing curved scrambling and modulo operation, a cipher image is obtained as in fig8 and transmitted to the receiver.
At receiver end, convert this cipher image into RGB matrix and perform anti-diffusion process to get the temporary cipher image. Finally, as resultant original image in fig 9 is obtained after executing reverse modulo operation. CONCLUSION An image encryption algorithm has been proposed to provide a secure cryptosystem to transmit variety of images. A new curved scrambling method increased the complexity of key generation process, therefore difficult to decode by the hacker. Further diffusion process changes the corresponding pixel values thus avoiding repeated permutation. All these techniques help to design a more complex and secure cryptosystem to transmit the data over the insecure network. Being anintricate system, decryption process requires accurate information regarding anti-diffusion process to recover the given image.The proposed encryption method utilized larger key space hence increases the robustness and make it secure from brute force attack. We concluded that the described algorithm can be used for efficient and secure transmission of images over the unsecured network.
AUTHOR CONTRIBUTION Conceived and designed the experiment: Shafali Agarwal Performed and analyzed the experiment: Neha Dwivedi and Rishi Kumar Gupta Wrote the paper: Shafali Agarwal and Neha Dwivedi