Professional Documents
Culture Documents
Avinash Ray 1, Anjali Potnis2, Prashant Dwivedy3, Shahbaz Soofi 4, Uday Bhade5
Department of Electrical & Electronics Engineering
National Institute of Technical Teachers’ Training & Research Bhopal (Madhya Pradesh) INDIA.
atulasn03@outlook.com 1, apotnis@nitttrbpl.ac.in2, dwivedyfamily@gmail.com3, shahbaz_261@yahoo.com4,
udaybhade1991@gmail.com5
Abstract— In present scenario whole world is moving towards the use of one- way functions that are easy to compute in one
digital communication for fast and better communication. But in direction but very difficult to compute in reverse. This is what
this a problem arises with security i.e. when we have to transmit allows you to publish your public key, which is derived from
information (either data or image) over internet or to store your private key e.g.:- RSA algorithm
information at any random location then its security is very
important. To protect our information from hackers we use a In this paper we take an image as our information and try to
technique i.e. Encryption. In this paper we use image as encrypt it with different image encryption technique. After
information and use different types of encryption techniques to encryption we use parameters such as PSNR, MSE,
encrypt it and protect it from hackers. After that we find various Normalized Absolute Error, Average Difference, Structural
parameters from each image encryption technique and then
content, Maximum Difference to check which one technique is
compare each technique's parameters from one another. After
that we search for the best result and then proceed forward with best for image encryption.
that technique for future scope.
Keywords:- Image encryption; AES encryption algorithm; RSA II. THEORY BEHIND THE PROPOSED IMAGE
encryption algorithm; Affine Transform with XOR; Image ENCRYPTION TECHNIQUES
decryption; PSNR; MSE; NAE; AD;
A. AES Algorithm
274
Mix Columns, a mixing operation which 1) Encryption: Take an image as input. Calculate its
operates on the columns of the state, Height (H) and Width (W) of the input image. Find (H mod 8)
combining the four bytes in each column. and (W mod 8), if they are equal to zero then go to next step.
Add Round Key
H = H + (8 - (H mod 8)) (3)
c) Final Round: Sub Bytes, Shift Rows, Add Round
Key W = W + (8 - (W mod 8)) (4)
2) Decryption: Inverse sub bytes, inverse shift rows and Divide input image in two blocks, each block size is of
inverse mix columns are used in reverse order instead of sub (8x8). Perform crossover operation. Perform mutation
bytes, shift rows, and mix columns. The key expansion remains operation get an encrypted block. Repeat last two steps for
the same. Fig 1 shows the original, encrypted and decrypted each block to get an encrypted image.
image in Matlab. Table 1 is a comparison of different quality 2) Decryption: Take encrypted image as input. Go to
parameters using AES algorithm. encrypted block. Perform mutation operation followed by
crossover operation to get decrypted block. Repeat last two
B. RSA Algorithm steps for each block to get decrypted image. Fig 3 shows the
original, encrypted and decrypted image in Matlab. Table 3 is
RSA is an algorithm developed in 1977 by Ron Rivest, Adi a comparison of different quality parameters using genetic
Shamir, and Leonard Adleman[4]. In such a cryptosystem, the algorithm
encryption key is a public one and the decryption key which is
different from the encryption key is kept private. As two D. Affine Transform with XOR operation
different keys are being used in encryption and decryption the Affine Transformation is a technique in which we can
RSA algorithm is also called as an asymmetric cryptographic
change the original pixel value to a different location with the
algorithm.
help of an 8 bit key. Then the image which is to be
The RSA algorithm consists of three major steps in encryption
transmitted is divided into 2x2 pixel blocks and then each
and decryption. The steps are as following
block is encrypted with the XOR Operation by four 8 bit keys
1) Key Generation: The RSA involves a public key and a [11]. The total key size used in this algorithm is 64 bits. The
private key. Of these two keys the public key is used for relationship between plain text (P) and cipher text (C) is
encrypting messages and can be known to everyone. The given by
messages encrypted with the public key are decrypted using
the private key. The process for key generation is as follows.
First choose two distinct prime numbers p and q and then C = (K0 + K1 x P) mod N (5)
compute n=pxq where n is the modulus for the public key and P = (C + (-K0) x 1/K) mod N (6)
the private keys. Next compute φ(n) = (p − 1)(q − 1). Choose
an integer e such that 1 < e < φ(n) and GCD (e, φ(n)) = 1. The 1/K is the multiplicative inverse of K1 and (-K0) = additive
pair (n, e) is the public key. The private key is a unique integer inverse of K0. The HCF of (K1, N) = 1.
d obtained by solving the equation d⋅e ≡ 1 (mod φ(n)).
1) Encryption: Take an image S of size M x N and a secret
2) Encryption: The RSA algorithm is used here for key of 64 bits. Break 64 bits key into eight equal parts i.e. (K0,
encrypting an image. So the message text (m) is in the form of K1, K2, K3, K4, K5, K6, and K7). The four sub keys (K0, K1,
pixels lying in the range 0 to 255. The pixels are stored and K2 and K3) are used for location change of pixel value and next
operated upon in an array format. The text is encrypted using four keys (K4, K5, K6 and K7) are used for encryption using
the public key (n, e) from the equation XOR Operation. For every pixel P x, y changes the location (X,
Y) in S to (X', Y') in C by formula
c=me mod (n) (1)
275
269
into M/2 x N/2 number of 2 x 2 blocks. Then XOR Operation is
performed for each block
Decrypt P’1, 1 as P1, 1 = P'1, 1 XOR K4 (13)
Decrypt P'1, 2 as P1, 2 = P'1, 2 XOR K5 (14)
Decrypt P'2, 1 as P2, 1 = P'2, 1 XOR K6 (15)
Decrypt P'2, 2 as P2, 2 = P'2, 2 XOR K7 (16)
For every pixel P x', y' changes the location (X', Y') in C to (X,
Y) in S by formula [10]
X = (X' + (-K0)) x 1/K1) mod (17) Fig 1.Encrypted and decrypted image using AES algorithm
Y = Y' + (- K2)) x 1/K3) mod N (18)
Fig 4 shows the original, encrypted and decrypted image in
Matlab. Table 4 is a comparison of different quality parameters
using affine with XOR algorithm.
E) Watermarking Technique
Watermarking [11] is a technique which is used to
provide authenticity by using signature, stamp etc. A message
usually a logo, stamp, or a signature is superimposed onto an
image with a great deal of transparencies e.g.:- Money Fig 2.Encrypted and decrypted image using RSA algorithm.
watermark
Normally in watermarking the duplicate image is
superimposed over an original image and after that we get a
new image that is called as watermarked image [12].
For doing encryption however in this paper we use the
watermark as our original information say w which can be
watermarked on any image here say i. Thus our watermark
image will not be visible after superimposing it on another
image. So we say our image in encrypted. At the decryption
Fig 3. Encrypted and decrypted image using genetic algorithm
end this watermark w can be separated from the image i to
get the original information back.
1) Encryption:
Watermarked image = (1 – q) × i + (q × w) (19)
2) Decryption:
I = Watermarked image – (q × w)) / (1 – q) (20)
W = Watermarked image – (1 – q) × i) / q (21)
Fig 5 shows the original, watermarked and extracted image in
Matlab. Fig 6 shows the extracted watermark. Table 5 is a
comparison of different quality parameters using watermarking
technique.
III. EXPERIMENTAL RESULTS Fig 4. Encrypted and decrypted image using Affine with XOR algorithm.
276
270
TABLE 2. PERFORMANCE MEASUREMENT PARAMETERS FOR RSA
ALGORITHM.
109.222 0
x Mean Square Error (MSE)
Structural Content 56.1716 1
x Peak signal to Noise Ratio (PSNR) Maximum Difference
x Normalized Absolute Error (NAE) 248 0
277
271
Mean Square Error parameters. Mean Square Error (MSE) for AES is obtained
11664 0 maximum that is it has the highest difference between original
image and encrypted image providing more security. PSNR for
Peak Signal to Noise watermarking is maximum but it has the least MSE proving it
Ratio
7.4623 99
to be a less secure technique. In future these all techniques can
be applied in a hybrid manner so as to make more complicated
Normalized Absolute and secure algorithm for image encryption.
Error
0.7562 0 REFERENCES
Normalized cross
correlation 1 Federal Information Processing Standards Publications (FIPS 197),
"Advanced Encryption Standard (AES) ", 26 Nov. 2001.
0.9753 1
2 J.J. Amador, R. W.Green “Symmetric-Key Block Cipher for Image and
Text Cryptography”: International Journal of Imaging Systems and
Average Difference Technology, No. 3, 2005, pp. 178-188.
-31.6142 0 3 H. Cheng, L. Xiaobo, Partial encryption of compressed images and
videos. IEEE Trans. Signal Process. 48 (8), 2439–2451, 2000.
Structural Content 0.6253 1 4 J.C. Yen, J.I. Guo, An efficient hierarchical chaotic image encryption
algorithm and its VLSI realization, IEEE Proc. Vis. Image Process. 147
(2000) 167–175.
Maximum Difference 5 H H. Cheng, X.B. Li, Partial encryption of compressed image and
251 0 videos, IEEE Trans. Signal Process. 48 (8) (2000) 2439–2451.
6 S. Li, X. Zheng, Cryptanalysis of a chaotic image encryption method, in:
Proceedings of the IEEE International. symposium on circuits and
systems, Scottsdale, AZ, USA, 2002.
7 Chin-Chen Chang, Min-Shian Hwang, Tung-Shou Chen, "A new
encription algorithm for image cryptosystems", The Journal of Systems
TABLE 5. PERFORMANCE MEASUREMENT PARAMETERS FOR and Software 58 (200 I), 83-9 I.
WATERMARKING TECHNIQUE.
8 Sandeep Bhowmik, Sriyankar Acharyya, “Image cryptography: the
Genetic algorithm approach”, IEEE, vol. 3, pp. 223-227, 2011.
9 Mohammed A.F. Al-Husainy, “Image encryption using Genetic
Comparison between Comparison algorithm”, Information Technology Journal, vol. 3, pp. 516-519. 2006.
Quality Parameters Original Image and between Original 10 Anil Kumar, M. K. Ghose, “Overview of information security using
Encrypted Image Image and Genetic algorithm and Chaos”, Information Security Journal: A Global
Decrypted Image Perspective, vol. 18, pp. 306-315, 2012.
11 Amol R. Madane, K.T Talele,M.M Shah, “Watermark Logo in Digital
Mean Square Error Image using DWT, Proceedings of SPIT-IEEE Colloquium and
714.5421 0 International Conference,Vol.1.
12 Akhil Pratap Singh, Agya Mishra, “Wavelet Based Watermarking On
Peak Signal to Noise Digital Image”, Indian Journal of Computer Science and Engineering,
Ratio Vol.1, No.2, 86-91.
19.5905 329.76 13 Amol R. Madane, K.T Talele,M.M Shah, “Watermark Logo in Digital
Image using DWT, Proceedings of SPIT-IEEE Colloquium and
Normalized Absolute International Conference,Vol.1.
Error
0.1992 0
Normalized cross
correlation
23.6450 1
Average Difference
23.6450 0
Structural Content 1.5599 1
Maximum Difference
50.4029 0
V. CONCLUSION
278
272