American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) ISSN (Print) 2313-4410, ISSN (Online) 2313-4402 Β© Global Society of Scientific Research and Researchers http://asrjetsjournal.org/ Efficient Selective Image Encryption Using Pseudo Random Number Sequences and AES Technique Ahmed M. Ayoupa*, Amr H. Husseinb, Mahmoud A. Attiac a,b,c Electronics and Electrical Communications Engineering Dept., Faculty of Engineering, Tanta University, Tanta 3111, Egypt. aEmail: Ayoup.2012@hotmail.com bEmail:amrvips@yahoo.com cEmail:mahmoudahmedattia@yahoo.com Abstract Selective image encryption has a significant importance in many applications as it offers significant savings in computations, cost, and time. Many attempts are exerted for this purpose as the traditional full image encryption/decryption algorithms may be too massive. In this paper, a new technique for selective image encryption is developed. The algorithm is based on a combination between the pseudo random number sequences, Arnold permutation, and the advanced encryption standard technique. The proposed technique is intended to reduce the execution time of the encryption process and increase the robustness of the encrypted image. Keywords: Pseudo random number (PRN); Advanced Encryption Standard (AES); Arnold Transformation; Linear Feedback Shift Register (LFSR). 1. Introduction The selective image encryption has a significant importance in time-critical applications wherein security is also a concern in internet banking transactions , military image database and communication, medical imaging security, satellite image security, pay-TV, confidential video conferencing, corporate communications and military, etc. ------------------------------------------------------------------------ * Corresponding author. E-mail address: Ayoup.2012@hotmail.com. 187 http://asrjetsjournal.org/ mailto:mahmoudahmedattia@yahoo.com American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 To protect the images from unauthorized access, secure image transfer is required and this can be achieved by using strong encryption techniques like triple Data Encryption Standard (3-DES) and Advanced Encryption Standard (AES) [1]. But the encryption of whole image using these techniques is time consuming. One way to reduce the implementation time of encryption process, improve the robustness of the encrypted image, and achieve inexpensive security is to use partial encryption (PE) or selective encryption (SE), which is the process of encrypting only carefully selected portions of the original image. Many attempts are exerted for this purpose. A novel symmetric encryption technique for medical images is presented in [2]. It uses the genetic algorithm which makes it highly adaptive. The images are segmented into a number of regions and the sensitive regions are selected on the basis of pixel intensity and entropy measurements. In addition, it uses several encryption algorithms with variable key lengths to control the execution time required for the encryption process. But, this algorithm provides lower entropy and correlation measurements than the traditional AES. Furthermore, increasing the number of regions should increase the side information which can be considered a main drawback of the algorithm. A selective encryption technique based on a combination between Arnold’s cat map, image hiding, and modified international data encryption algorithm (IDEA) technique was introduced in [3]. The selective encryption is performed by applying the IDEA to the body of the image. In this case, the body of the image is considered as the sensitive area without any rules which is considered the main drawback of this algorithm as the sensitive information may be concentrated in any region rather than the body of the image. In addition, the IDEA has low security compared to 3-DES and AES. A region based selective image encryption technique was introduced in [4].The image is segmented into a number of regions and the sensitive areas are simply identified by user, not based on any rules. Most existing selective image encryption techniques utilize image compression [5]. The original image is first encoded by a certain kind of encoder. After that, the encoded data are classified into significant part and insignificant part according to their strength of impact or error diffusion in the decoding process. But errors in the significant part will cause substantial change in decoded output or make it unrecognizable. In this paper, an efficient selective image encryption technique is presented. The proposed technique is based on a combination between the pseudo random number sequences, Arnold permutation, and the advanced encryption standard technique. It combines the randomness and good correlation properities of pseudo random number sequences, speed of arnold permutation, and robustness advantage of AES. So, the proposed technique is intended to reduce the execution time of the encryption process and increase the robustness of the encrypted image. Furthermore, no errors are encountered in the image decryption in contrast to the image compression based selective encryption techniques. 2. Proposed Selective Encryption Technique In this section, the proposed selective image encryption technique is presented. Figure (1) shows the block diagram of the proposed technique. 188 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 Figure 1: The block diagram of the proposed technique. The proposed technique follows these steps: (1) Sensitive Area Selection The plain image is divided into a number of equal size and non overlapping blocks. Entropy calculation is applied to the individual image blocks to determine the 𝑁 entropy values (𝐸1,𝐸2,𝐸3, … . . , π‘Žπ‘›π‘‘ 𝐸𝑁). To recognize the region of interest (ROI) or sensitive area, the blocks having the highest entropy values are selected. For small encryption time and high security the selected blocks should constitute 25% of the size of the plain image. (2) Pseudo Random Number Matrix Generation This section presents the pseudo random number generation (PRNG) technique using linear feedback shift register (LFSR). Pseudo random number generators have applications in many areas where producing an unpredictable result is desirable [6]. Random number generators are very useful in developing Monte Carlo method simulations as debugging is facilitated by the ability to run the same sequence of random numbers again by starting from the same random seed. They are also used in various cryptography applications such as data and multimedia encryption keys and bank security communication channels, etc., so long as the seed is secret. Maximum-length linear feedback shift register produces an m-sequence (i.e. it cycles through all possible 2𝑛 βˆ’ 1 states within the shift register). The sequence of numbers generated by this method is random and the period of the sequence is (2𝑛 βˆ’ 1), where 𝑛 is the number of shift registers used in the design or the degree of the generator polynomial 𝑃(π‘₯). The total number of internal random states generated using the LFSR are 2𝑛 βˆ’ 1 and depends on the order of the generator polynomial 𝑃(π‘₯). 189 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 The state of the shift-register at clock pulse 𝑖 is the finite length vector 𝑏𝑖; 𝑏𝑖 = (𝑏𝑖 (1 ), 𝑏𝑖 (2 ), … . , 𝑏𝑖 (𝑛 βˆ’ 1 ), 𝑏𝑖 (𝑛 )) (1) and the output number 𝑐𝑖 at clock pulse 𝑖 is the concatenation of these states; 𝑐𝑖 = (𝑏𝑖 (1 )& 𝑏𝑖 (2 )& … . &𝑏𝑖 (𝑛 βˆ’ 1 )& 𝑏𝑖 (𝑛 )) (2) where & denotes the concatenation operator. In this case, a sequence of pseudo random numbers 𝑐𝑖 of length 𝑀 is represented as follows; 𝐢𝑀 = (𝑐1, 𝑐2, 𝑐3, … … . . , 𝑐𝑀) (3) For 𝑀 Γ— 𝑀 input image, an 𝑀 Γ— 𝑀 matrix of pseudo random numbers 𝐢𝑀×𝑀 has to be generated. Considering a sequence of pseudo random numbers 𝐢𝑀 of length 𝑀, the rows of the coding matrix 𝐢𝑀×𝑀 are the 𝐿-numbers successive shifted versions of the original sequence 𝐢𝑀 where 𝐢𝑀×𝑀(𝑖, : ) = π‘π‘–π‘Ÿπ‘π‘™π‘’ π‘ β„Žπ‘–π‘“π‘‘ 𝑏𝑦 ((𝑖 βˆ’ 1) βˆ— 𝐿)π‘œπ‘“ 𝐢𝑀 (4) where 𝑖 is the row index of the 𝐢𝑀×𝑀 matrix, and 𝐿 is the number of shifts. The shifted versions of the pseudo random number sequences exhibit low autocorrelation. Such important property plays a significant role in the encryption process of the input images when xored with the 𝐢𝑀×𝑀 matrix, as it tends to increase the entropy of the encrypted image, decrease the autocorrelation between the original image and the encrypted image, and provides encrypted image with uniform histogram. (3) Image Encryption using PRN Sequences The plain image is initially encrypted using the generated PRN codes. The 𝑀 Γ— 𝑀 plain image is xored with the generated PRN matrix 𝐢𝑀×𝑀 to produce a primary PRN encrypted image. This process reduces the correlation between the plain image and encrypted image. It is also secure since it changes the histogram and provides change diffusion. (4) Image Arnold Transformation Arnold’s cat map scrambling technique [7-9] can be applied in image encryption, and it has more security and better effect. An image (not necessarily a cat) is hit with a transformation that apparently randomizes the original organization of its pixels. However, its period is fixed, the ACM has two main disadvantages: The original image will be returned to itself if iterating some times, and the histogram of the encrypted image is the same as the histogram of the original image. This is due to the fact that the pixel values themselves didn’t change [9]. That is the reason for applying PRN coding for the plain image before Arnold transformation. 190 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 (5) AES Encryption Advanced Encryption Standard (AES) is a cryptographically secure encryption algorithm. A brute force attack requires 2128 trials for the 128-bit key size. In addition, the structure of the algorithm and the round functions used in it ensure high immunity to linear and dierential cryptanalysis. Attacks against AES haven't been successful till now and AES is the current encryption standard. The AES design can be used in any application that requires protection of data during transmission through the communication network, including applications such as electronic commerce transactions, ATM machines, and wireless communication. The AES is a universal encryption standard. It can be used for encryption of any type of data, text and other media alike [10]. In the previous section, Arnold cat map is used to shuffle the positions of the primary PRN encrypted image pixels. Selected sensitive image blocks are encrypted using AES to form the final encrypted image. 3. Simulation Results The proposed SE encryption technique can be applied to any image format. The simulation results was implemented in MATLAB 2014a on an Intel (R), core (TM) i7-2620M, CPU@ 2.7GHz, and 4GB laptop running Windows 7. The 256 Γ— 256 Lena image is used for simulations. The simulation follows these steps: 1. The 256 Γ— 256 Lena image (lena256.jpg) shown in Figure (2) is divided into equal size and non overlapping 𝑁 = 2π‘š sub-blocks such that 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, for π‘š = 2, 4, π‘Žπ‘›π‘‘ 8, respectively. The resulting sub-bloks are of sizes 128 Γ— 128, 64 Γ— 64, and 32 Γ— 32, respectively. Figure 2: The 256 Γ— 256 Lena image (lena256.jpg). 2. Entropy calculation is applied to the individual image sub-blocks. 3. To recognize the region of interest (ROI) or sensitive area, the sub-blocks having the highest entropy values are selected. For small encryption time and high security the selected sub-blocks should constitute 25% of size of input image. The selected entropy values for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, caes and the corresponding sensitive sub-blocks are listed in table (1). Figure (3) shows the selected sub-blocks for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, cases. 191 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 Table 1: Selected entropy values for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64 caes and the corresponding sensitive sub-blocks. Number of image sub- blocks (N) N=4 N=16 N=64 Selected entropy values E3= 7.0908 E10=7.09 21 E6=7.061 1 E11=6.99 25 E9=6.913 7 E36=7.1335 E43=7.0973 E51=7.0428 E28=7.0142 E38=6.9169 E34=6.8881 E42=6.8782 E35=6.8519 E30=6.8050 E54=6.6925 E27=6.6588 E63=6.6369 E37=6.6242 E49=6.6240 E57=6.5824 E23=6.5006 Selected sensitive blocks B3 B10 B6 B11 B9 B36 B30 B43 B54 B51 B27 B28 B63 B38 B37 B34 B49 B42 B57 B35 B23 (a) (b) (c) Figure 3: (a) selected sensitive sub-blocks for 𝑁 = 4 blocks, (b) selected sensitive sub-blocks for 𝑁 = 16 blocks, and (c) selected sensitive sub-blocks for 𝑁 = 64 blocks. 4. Generation of a pseudo random numbers (PRN) sequence 𝐢𝑀 using 𝑛-stages linear feedback shift register. For 256 Γ— 256 plain image, it is required to generate a 256 length PRN sequence. In this case, 𝑛 = 8 stages LFSR is used. For maximum length sequence, the the LFSR satisfies the generating polynomial 𝑃(π‘₯) of Eq. (5). It generates 𝑛 = 28 βˆ’ 1 = 255 internal random states. Figure (4) shows the block diagram of the designed 𝑛 = 8 stages LFSR. The required 256 length sequence 𝐢256 is composed of the 255 random states plus the first state. 𝑃(π‘₯) = π‘₯^8 + π‘₯^6 + π‘₯^5 + π‘₯^4 + 1 (5) 192 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 Figure 4: The block diagram of the designed 𝑛 = 8 stages LFSR for generating polynomial 𝑃(π‘₯) = π‘₯^8 + π‘₯^6 + π‘₯^5 + π‘₯^4 + 1. The main advantage of the PRN sequence is that it exhibits low autocorrelationn properities that enhances the encryption process. Figure (5) shows the autocorrelation between the original PRN sequence and its one number successive shifted versions. Figure 5: The autocorrelation between the original PRN sequence and its one number successive shifted versions. 5. 256 Γ— 256 PRN coding matrix formation. The individual rows of the coding matrix 𝐢256Γ—256 are the 8- numbers successive shifted versions of the original sequence 𝐢256 . The shift between any two adjacent PRN sequences in the coding matrix is chosen to be 8 numbers to minimize the correlation between the adjacent pixels in the same column. Figure (6) shows the autocorrelation between the original PRN sequence and its 8-numbers successive shifted versions. After PRN coding matrix formation, the input plain image is xored with the PRN matrix to generate the primary PRN encrypted image as shown in Figure (7). -200 -100 0 100 200 -0.2 0 0.2 0.4 0.6 0.8 1 Shift value C or re la tio n 193 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 Figure 6: The autocorrelation between the original PRN sequence and its 8-numbers successive shifted versions. Figure 7: Primary PRN encrypted image. 6. Arnold cat map is used to shuffle the positions of the primary PRN encrypted image pixels, as shown in Figure (8). Figure 8: Arnold permutation of the primary PRN encrypted image. 0 200 400 600 800 1000 1200 1400 1600 1800 2000 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 Shift value C or re la tio n Correlation between the PRN sequence and its 8-numbers shifted versions 194 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 7. Selected sensitive image sub-blocks are encrypted using advanced encryption standard (AES) to form the final encrypted image. The encrypted images for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, block caes are shown in Figure (9). The plain image histogram is non-uniform while proposed SE encryption technique results in uniform histogram in all cases, as shown in Figure (10). The simulation results indicate that the proposed technique provides higher entropy, lower correlation between the plain image and the encrypted image, and reduced encryption time than the AES technique. The encryption times for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, block caes are reduced by 72.74%, 72.63%, and 72.3%, respectively compared to full image encryption using AES technique as listed in table (2). Furthermore, the proposed technique provides higher entropy and lower correlation between the plain image and the encrypted image compared to full image encryption using AES technique, as listed in table (2). (a) (b) (c) Figure 9: The encrypted images for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, blocks caes respectively. (a) 0 100 200 300 400 500 600 700 800 Histogram of the plain image 0 50 100 150 200 250 195 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 (b) (c) (d) Figure 10: (a) Histogram of the plain image. (b), (c), and (d) histograms of the encrypted images for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64 blocks caes respectively. 196 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 Table 2: Measured metrics for the proposed SE encryption technique compared to full image encryption using AES technique. Metrics Proposed SE Technique AES N=4 N=16 N=64 Encryption Time (sec) 7.32 7.35 7.44 26.86 Time saving (%) compared to AES 72.74% 72.63% 72.3% ---- Entropy 7.9973 7.9977 7.9978 7.9972 Correlation between plain image and encrypted image 0.0014 0.0013 0.0015 0.0019 ID 0.7221 0.7206 0.7227 0.7209 NCPR 99.6292 99.6246 99.6399 99.6445 UACI 27.7360 27.7787 27.7672 27.7907 MDMF 0.7814 0.7836 0.7872 0.7891 4. Conclusion In this paper, an efficient selective image encryption technique is presented. The algorithm is based on a hyprid combination between the pseudo random number sequences, Arnold permutation, and the advanced encryption standard technique. The proposed technique is intended to reduce the execution time of the encryption process and increase the robustness of the encrypted image. The simulation results indicate that the proposed technique provides higher entropy, lower correlation between the plain image and the encrypted image, and reduced encryption time than the AES technique. The encryption times for 𝑁 = 4, 16, π‘Žπ‘›π‘‘ 64, blocks caes are reduced by 72.74%, 72.63%, and 72.3%, respectively compared to the full image encryption using AES technique. Furthermore, the proposed technique provides higher entropy and lower correlation between the plain image and the encrypted image compared to full image encryption using AES technique. 197 American Scientific Research Journal for Engineering, Technology, and Sciences (ASRJETS) (2015) Volume 12, No 1, pp 187-198 References [1] W. Stallings, Cryptography and Network Security Principles and Practice, 5th ed., Prentice Hall, 2011. [2] A. Mahmood, R. Dony, S. Areibi, "An adaptive encryption based genetic algorithms for medical images", Machine Learning for Signal Processing (MLSP), 2013 IEEE International Workshop, vol., no., pp.1-6, 22-25 Sept. 2013. [3] A. M. Riad, A. H. Hussein, A. A. El-Azm, "A new selective image encryption approach using hybrid chaos and block cipher," Informatics and Systems (INFOS), 2012 8th International Conference on , vol., no., pp.MM-36,MM-39, 14-16 May 2012. [4] K. C. Ravishankar, M. G.Venkateshmurthy, "Region based selective image encryption," Computing & Informatics, ICOCI '06. International Conference, pp. 6-8, June, 2006. [5] S. K. Naveenkumar, H. T. Panduranga, and Kiran, "Partial Image Encryption for Smart Camera," International Conference on Recent Trends in Information Technology (ICRTIT), pp.126-132, 2013. [6] Schindler, Werner, "Functionality Classes and Evaluation Methodology for Deterministic Random Number Generators", Anwendungshinweise and Interpretation (AIS), pp. 5–11. (Dec., 1999), Retrieved Aug., 2013. [7] L. Wu, J. Zhang, W. Deng, D. He, "Arnold Transformation Algorithm and Anti-Arnold Transformation Algorithm," Information Science and Engineering (ICISE), 1st International Conference, pp.1164-1167, 26- 28 Dec. 2009. [8] Y. Wang, T. Li, "Study on Image Encryption Algorithm Based on Arnold Transformation and Chaotic System," Intelligent System Design and Engineering Application (ISDEA), 2010 International Conference on , vol.2, pp.449-451, 13-14 Oct. 2010. [9] S. Lian, Multimedia content Encryption, CRC Press, Taylor & Francis Group, 2009. [10] Advanced Encryption Standard (AES), Federal Information Processing Standards Publication 197, Nov. 2001. 198 https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Zertifizierung/Interpretationen/AIS_20_Functionality_Classes_Evaluation_Methodology_DRNG_e.pdf?__blob=publicationFile https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Zertifizierung/Interpretationen/AIS_20_Functionality_Classes_Evaluation_Methodology_DRNG_e.pdf?__blob=publicationFile 1. Introduction (1) Sensitive Area Selection (2) Pseudo Random Number Matrix Generation (3) Image Encryption using PRN Sequences (4) Image Arnold Transformation (5) AES Encryption