International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012)26
Secure Image encryption through key hashing and
wavelet transform techniques
Tapas Bandyopadhyay
1, B Bandyopadhyay
2, B N Chatterji
31
Scientist F, STQC, Kolkata-91, [email protected]
2Professor, C.U. , [email protected]
3Ex Prof IIT,Kharagpur,[email protected]
Abstract:- To provide security of the images in the multimedia environment encryption plays an important role. The traditional cryptographic algorithm such as AES, DES, TDES, RSA, IDEA, etc. are not so effective for image encryption because of their slow processing speed, inherent features of image data like bulk data capacity, high redundancy and ineffectiveness in removing the correlations of the adjacent pixels of the image[1],[2]. In order to cope with this problem a noble technique of digital image encryption is proposed. In this technique the symmetric key is used for image encryption
.
The hash value (SHA1) of the key file is generated and stored as text file [4],[5]. The SHA test is converted to binary string. The key hash value is now expanded to match with the image dimension. For creating confusion the image to be encrypted is wavelet transform is first calculated and then converted into binary string and the hash of the secret key value (SHA1) is finally bitxored to create the encrypted image. The experimental results, correlation analysis of adjacent pixels of encrypted image in the horizontally, vertically and diagonally spaced pixels, histogram analysis and Structural Similarity Index Measure (SSIM), tests have been carried out and results are found to be quite satisfactory in terms of security and performance.Keywords-Cipher text, Encryption, Decryption, SHA, symmetric key, image histogram, Correlation coefficient, Structural Similarity Index Measure (SSIM)
I. INTRODUCTION
In the multimedia internet system the security of digital images has become more vital need since web attacks are more frequent and serious in nature [5],[6]. The context of image encryption is somehow different from the text encryption due to the fact that images have inherent features such as huge data capacity and high correlation among the pixels, which makes the image encryption system time consuming, cumbersome and difficult to handle. Inthe recent past many image encryption algorithm have been proposed and are in use.
Image encryption has applications in inter-net communication, multimedia Systems, medical imaging, telemedicine, and military communication to name a few [10],[11]. There already exist several image encryption techniques being used in the industry and scientific community. Although there are many cryptosystems, such as RSA, DES, AES, which can be used to encrypt images, these are not ideal for two reasons [12]. One is that the image size is generally much greater than that of text. This results in conventional cryptosystems taking much more time to encrypt images directly [13,[20]]. The other reason is that image data has high correlation among adjacent pixels. Consequently, it is rather difficult for these cryptosystems to shuffle and diffuse image data effectively. Chaos-based cryptosystems usually have higher speeds and lower costs. Moreover, these systems are sensitive to initial conditions and control parameters. These optimistic characters make them suitable for image encryption. In this respect, during the past decade a great number of chaotic systems have been proposed. For example, Chen et al. used a 3D baker map [13] and a 3D cat map [14] in the permutationprocess. Guan et al.employed a 2D cat map for substitution and the diffusion of Chen’s chaotic system for masking the pixel values [11]. Jiri Giesl et al. used the chaotic maps of Peter de Jong’s attractor to improve the chaos image encryption speed [16].
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012)27
II. BACKGROUND
Due to the property of human perception (HVS model), a decrypted image containing small distortion or aberration is usually acceptable [7], [8], [9]. This property of human vision limitation may be exploited for image encryption purpose. Different image encryption algorithms or techniques try to convert an image to one unintelligent format that is hard to understand. While during image decryption, the algorithms retrieve the original image from the encrypted one. There are various image encryption systems to encrypt and decrypt data, and there is no single encryption algorithm satisfies the different image types. In most of the natural images, the values of the neighboring pixels are strongly correlated. This means that the value of any given pixel can be reasonably predicted from the values of its neighbors [10],[11]. There are two major groups of image encryption algorithms: (a) no chaos selective methods and (b) Chaos-based selective or non-selective methods. Most of these algorithms are designed for a specific image format compressed or uncompressed, and some of them are even format compliant. There are methods that offer light encryption (degradation), while others offer strong form of encryption. In the proposed encryption process, for creating confusion the image wavelet transform is first calculated and then converted into binary string and the hash of the secret key value (SHA1) is finally bitxored to create the encrypted image.
III. PROPOSED IMAGE ENCRYPTION SCHEME
The proposed image encryption scheme exploit the security behavior of the hash function and wavelet transform of the image. The hash value (SHA1) of the key file is generated and stored as text file. The secure one way functions are very important tool for checking checking integrity, privacy and authentication in cryptographic application. Figure 1 depicts the encryption scheme for image encryption.
1. The secret key value is fed into the openssl tool to generate the SHA1 hash of the key value.
2. The SHA1 hash value is then concerted to binary string.
3. Load the image to be encrypted.
4.
Calculate the wavelet transform of the
image. 5. Convert the binary string of the wavelet components 6. Expand the key to match with the image size.7. Bitxoring the key and binary string of the wavelet coefficient.
[image:2.612.378.542.162.426.2]The decryption process is just the reverse of steps to extract the original image.
Fig 1: Proposed Image Encryption scheme:
IV. EXPERIMENTAL RESULTS
The SHA hash value is generated using OpenSSL tool. The encryption and decryption algorithm is developed using Matlab programme. The test images are used for the experimental purpose.
A good encryption scheme should be robust against all kinds of cryptanalytic, statistical and brute force attacks. Some experimental results are given in this section to demonstrate the efficiency of our Scheme. All the experiments are performed on a PC with Intel Core 2.3GHz CPU, 1GB RAM with Windows XP professional Edition. The compiling environment MATLAB 7 is used for programme development.
4.1 Histogram Analysis
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012) [image:3.612.364.522.156.283.2]28
The histogram of original image contains large sharp rises followed by sharp declines as shown in Fig. 3(c) and the histogram of the encrypted image as shown in Fig.3 (d) has uniform distribution which is significantly different from original image and has no statistical similarity in appearance. Therefore, the proposed algorithm does not provide any clue for statistical attack. The encrypted image histogram, approximated by a uniform distribution, is quite different from plain image histogram. The uniformity caused by the proposed encryption scheme is justified by the chi-square Histograms may reflect the distribution information of the pixel values of an image. An attacker can analyze the histograms of an encrypted image by using some attacking algorithms to get some useful information of the original image. The figure 2 depicts the screenshot of the SHA1 hash value of the key file. The SHA1 text file of key is used for further processing.Fig 2: Screenshot of opnessl for SHA1 of key
Fig 3(a) : Test image
Fig 3 (b) Histogram of plain test image(leena)
Fig 3 (C)Encrypted image
[image:3.612.385.503.317.447.2] [image:3.612.51.278.378.510.2] [image:3.612.374.511.501.663.2] [image:3.612.111.225.583.699.2]International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012)29
Fig 3(e) : Decrypted image
Fig 3(f) Histogram of decrypted image
Figure 3: Histogram Analysis of Plain-image (a, b) and Cipher-image (c, d) and their histograms (e, f) decrypted image and histogram.
It is observed that the histograms of the encrypted image are smooth and evenly distributed as possible, and are very different from that of the plaintexts which has a specific pattern.
4.2 Correlation Coefficient Analysis:
Correlation coefficient analysis is carried for adjacent pixel of the encrypted images of different test images between horizontally, vertically and diagonally adjacent pixels. Experiment shows that image scrambling effect is inversed to the correlation coefficient function of the adjacent pixels. Correlation coefficient function is used as follows.
cov(x,y) =1/n summation _i =1 to N [ E(x_i-E(x))(y_i-E(y))] ---(1)
r_xy= cov(x, y) / (sqrt(D(x)* D(y) )) ---(2)
where r_xy is the correlation coefficients between two horizontally, vertically and diagonally adjacent pixels of the image.
D(x) = 1/n summation _i=1 to n square [(x_i - E(x))] ---(3)
E(x) = 1/n summation i=1 to n (x_i) ---(4)
The table1 summarizes the correlation coefficients between the two adjacent pixels of image in horizontally, vertically, diagonally and anti-diagonally spaced positions of pixels.
Table I
Correlation coefficient for encrypted image between the adjacent pixels of horizontally, vertically and diagonallyand antidiagonally placed pixels.
Encryp tion of the referen ce test image
Corr. coefficient s bet. two adjacent horizontall y spaced pixel of the image
Corr. coeffici ents bet. two adjacent verticall y spaced pixel of the image
Corr. coeffici ents bet. two adjacent diagona lly spaced pixel of the image
Corr. Coefficien ts bet. two adjacent anti diagonally spaced pixel of the image
Lena 0.0059 0.0071 0.0034 0.0017
Crowd 0.0043 0.0055 0.0034 0.0056
Clown 0.0035 0.0062 0.0160 0.0161
Boats 0.0096 0.0065 0.0022 0.005
Camer aman
0.0034 0.0061 0.005 0.002
[image:4.612.111.229.142.261.2] [image:4.612.322.566.384.646.2]International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012)30
[image:5.612.61.255.141.285.2]Intensity at location(x, y)
Fig 4: Plot of intensity of horizontally spaced adjacent pixel of plain image, Correlation coefficient =0.9825
[image:5.612.358.520.150.268.2]
Intensity at location(x, y)
Fig 5 : Plot of intensity of horizontally spaced adjacent pixel of plain image, Correlation coefficient =0.0059
Intensity at location(x, y)
Fig 6 : Plot of intensity of verttically spaced adjacent pixel of plain image, Correlation coefficient =0.9873
Intensity at location(x, y)
Fig(7) Plot of intensity of horizontally spaced adjacent pixel of plain image, Correlation coefficient =0.0071
Figures 4 ,5,6 and 7 depict the plot of intensity value of the adjacent pixel value of horizontallyand vertically spaced pixel. In case of plain text image the graph shows a specific pattern and strong correlation between adjacent pixels but in case of encrypted image there is no correlation between adjacent pixel and they are haphazardly placed in the plot.
4.3 SSIM analysis:
The Structural Similarity Index Measure (SSIM), is a well-known quality metric used to measure the similarity between two images. It was developed by Wang et al. [9], and is considered to be correlated with the quality perception of the human visual system (HVS). Instead of using traditional error summation methods, the SSIM is designed by modeling any image distortion as a combination of three factors that are loss of correlation, luminance distortion and contrast distortion. The SSIM is
SSIM (f g) = l (f g) c (f g) s (f g) ---(6)
[image:5.612.53.220.517.640.2]International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 2, February 2012) [image:6.612.47.296.175.334.2]31
Table IISSIM values of original plain vs reference standard test image
Reference test image
SSIM of original plain image vs reference test image
SSIM of encrypted image vs reference test image
Lena 1 0.032
Crowd 1 0.031
Clown 1 0.028
Boats 1 0.036
Cameraman 1 0.035
V.
C
ONCLUSIONIn this paper, a new way of image encryption scheme has been proposed which utilizes the hash value of the secret key. In the proposed encryption process, for creating confusion the image wavelet transform is first calculated and then converted into binary string and the hash of the secret key value (SHA1) is finally bitxored to create the encrypted image. The experimental results have been obtained, correlation analysis of adjacent pixels of encrypted image in the horizontally, vertically and diagonally spaced pixels, histogram analysis and Structural Similarity analysis have been carried out. Finally, we conclude with the remark that the proposed method is expected to be useful for real time image encryption and transmission applications.
References:
[1] E.Biham and A.Shmir; “Differential C for Cryptanalysis of the Encryption Standard”; Springer- Verilag,1993
[2] Bruce Schneir: Applied Cryptography, 2nd edition, John Wiley & Sons, 1996
[3] Piper,F “Encryption”. Security and Detection, Ecos 97. European Conference;
[4] Abrams, M., and Podell, H. “Cryptography” Potentials, IEEE Page No 36-38. Issue:1,Volume: 20, Feb-Mar,2001 [5] Eskiciogiu,A. Litwin,L “ Cryptography and Network
Security” LOS Alamitos,CA: IEEE computer society press,1987
[6] Garfinkel, S.L; “Public Key Cryptography” , Computer, IEEE, Volume: 29, Issue:6, June 1996.
[7] W.Diffie; M.E.Hell man, “ New Directions in Cryptography” IEEE Transactions Information Theory, Nov, pp 644-654
[8] Bidjos,J; “Threats to Private and Public Key Protection” , Compcon Spring ’91. Digest of Papers, 25 Feb-1 March 1991
[9] 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
[10] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli,“Image quality assessment: from error visibility to structural similarity”, IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, 2004.
[11] J.C. Yen, J.I. Guo, A new chaotic key based design for image encryption and decryption, Proceedings of the IEEE International Symposium Circuits and Systems, vol. 4, 2000, pp. 49–52
[12] C.C. Chang, M.S. Hwang, T.S. Chen, A new encryption algorithm for image cryptosystems, J. Syst. Software 58 (2001) 83–91.
[13] G. Chen, Y. Mao, C.K. Chui, A symmetric image encryption based on 3D chaotic maps, Chaos Solitons Fractals 21 (2004) 749–761.Öztürk, I. and I. Sogukpınar (2005). [14] Zhang, L., X. Liao, et al. (2005). "An image encrypton
approach based on chaotic maps." Chaos, Solitions and Fractals 24: 759-765.
[15] Fridrich, J. (1998). "Symmetric ciphers based on two-dimensional chaotic maps." International Journal of Bifurcation and Chaos 8(6): 1259-1284.
[16] Giesl, J., L. Behal, et al. (2009). "Improving Chaos Image Encryption Speed." International Journal of Future Communication and Networking 2(3): 23-36.
[17] Miao, Y., G. Chen, et al. (2004). "A novel fast image encryption scheme based on 3D chaotic baker maps." International Journal of Bifurcation and Chaos 14(10): 3613-3624.
[18] S. Han, and S. Yang, "An Asymmet ric Image Encrypt ion Based on Mat r ix Trans format ion," e c t I transactions on computer and informa t i on technology vol . 1, no. 2 , 2005 [191]Yang, H., K. Wong, et al. (2010). "A fast image encryption and authentication scheme based on chaotic maps." Communications in Nonlinear Science and Numerical Simulation 15(11): 3507- 3517.