Image Encryption based on the RGB PIXEL Transposition and Shuffling
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
I. J. Computer Network and Information Security, 2013, 7, 43-50 Published Online June 2013 in MECS (http://www.mecs-press.org/) DOI: 10.5815/ijcnis.2013.07.05 Image Encryption based on the RGB PIXEL Transposition and Shuffling Quist-Aphetsi Kester, MIEEE Lecturer, Faculty of Informatics Ghana Technology University College Accra, Ghana kquist-aphetsi@gtuc.edu.gh Abstract — Privacy is one of the key issues information Enormous number of transfer of data and information Security addresses. Through encryption one can prevent a takes place through internet, which is considered to be third party from understanding raw data during signal most efficient though it’s definitely a public access transmission. The encryption methods for enhancing the medium. security of digital contents has gained high significance The cryptography in digital computing has been in the current era of breach of security and misuse of the applied to different kinds of digital file formats such as confidential information intercepted and misused by the text, images video etc. unauthorized parties. One of the best-known techniques of visual This paper sets out to contribute to the general body of cryptography has been credited to Moni Naor and Adi knowledge in the area of cryptography application and by Shamir. They demonstrated a visual secret sharing developing a cipher algorithm for image encryption of scheme, where an image was broken up into n shares so m*n size by shuffling the RGB pixel values. The that only someone with all n shares could decrypt the algorithm ultimately makes it possible for encryption and image, while any n − 1 shares revealed no information decryption of the images based on the RGB pixel. The about the original image. Each share was printed on a algorithm was implemented using MATLAB. separate transparency, and decryption was performed by overlaying the shares. When all n shares were overlaid, Index Terms — Cryptography, Encryption, algorithm, the original image would appear [4]. cipher image The chaotic confusion and pixel diffusion [5] methods was proposed by Friedrich perform the permutations using a chaotic 2-D [6] combined with alterations of I. INTRODUCTION Grey-Level values of each pixel in a sequential manner. Repetitive rounds of permutations and changes were used In cryptography, encryption is the process of to achieve higher security. It was experimentally verified transforming information using an algorithm to make it that the amount of time overhead in performing complex unreadable to anyone except those possessing special calculations and the complex diffusion process had led to knowledge, usually referred to as a key. The result of the large time complexity of the system. process is encrypted information. The reverse process is When Visual Cryptography is used for secure referred to as decryption. [1] Cryptography has evolved communications; the sender will distribute one or more from the from classical such as Caesar, Vigenère, Trifid random layers 1 in advance to the receiver. If the sender ciphers to modern day cipher and public key systems has a message, he creates a layer 2 for a particular such as Diffie-Hellman etc[2] distributed layer 1 and sends it to the receiver. The Cryptography today involves the use of advanced receiver aligns the two layers and the secret information mathematical procedures during encryption and is revealed, this without the need for an encryption device, decryption processes. Cipher algorithms are becoming a computer or performing calculations by hand. The more complex daily. There two main algorithmic system is unbreakable, as long as both layers don't fall in approaches to encryption, these are symmetric and the wrong hands. When one of both layers is intercepted asymmetric. Symmetric-key algorithms [3] are a class of it's impossible to retrieve the encrypted information.[7] algorithms for cryptography that use the same This paper proposes an image based encryption cryptographic keys for both encryption of plaintext and technique by developing a cipher algorithm for image decryption of cipher text. The keys may be identical or encryption of m*n size by shuffling the RGB pixel values. there may be a simple transformation to go between the The algorithm ultimately makes it possible for encryption two keys. and decryption of the images based on the RGB pixel. The encryption and decryption process of this paper is The paper has the following structure: section II is based on symmetrical algorithm encryption process. about related works, section III gives information on the Typical examples symmetric algorithms are Advanced methodology employed for the encryption and the Encryption Standard (AES), Blowfish, Triple Data decryption process, section IV presents the mathematical Encryption Standard (3DES) and Serpent. algorithms employed to come out with a cipher for the Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
44 Image Encryption based on the RGB PIXEL Transposition and Shuffling encryption process, section V gives explains the the pixel gray values were modified from the first pixel to algorithm mathematically by showing the step by step the last pixel firstly, and then the modified image was manipulation and shuffling of the image pixels, section encrypted from the last pixel to the first pixel in the VI provided the architectural summary of the encryption inverse order. In order to accelerate the encryption speed, and decryption process using flow charts, section VII every time NCM was iterated, n (n>3) bytes random consist of the simulated results and their mathematical as numbers were used to mask the plain-image. And to well as graphical analysis and section VIII concluded the enhance the security, a small perturbation was given to paper. the parameters of the NCM based on the last obtained n bytes modified elements before next iteration. [13] Ruisong Ye and Wei Zhou proposed a chaos-based II. RELATED WORKS image encryption scheme where one 3D skew tent map with three control parameters were utilized to generate A new cryptographic scheme proposed for securing chaotic orbits applied to scramble the pixel positions color image based on visual cryptography scheme was while one coupled map lattice was employed to yield done by Krishnan, G.S. and Loganathan, D. A binary random gray value sequences to change the gray values image was used as the key input to encrypt and decrypt a so as to enhance the security. Experimental results have color image. The secret color image which needs to be been carried out with detailed analysis to demonstrate communicated was decomposed into three that the proposed image encryption scheme possesses monochromatic images based on YCbCr color space. large key space to resist brute-force attack and possesses Then these monochromatic images were then converted good statistical properties to frustrate statistical analysis into binary image, and finally the obtained binary images attacks. And at the end, the proposed scheme utilizes the were encrypted using binary key image, called share-1, to 3D skew tent map to shuffle the plain-image efficiently in obtain the binary cipher images. During their encryption the pixel Positions permutation process and it employed process, exclusive OR operation was used between binary the coupled map lattice system to change the gray values key image and three half-tones of secret color image of the whole image pixels greatly.[14] separately. These binary images were combined to obtain With the exceptionally good properties in chaotic share-2. In the decryption process, the shares were systems, such as sensitivity to initial conditions and decrypted, and then the recovered binary images were control parameters, pseudo-randomness and ergodicity, inversed half toned and combined to get secret color chaos-based image encryption algorithms have been image. [8] widely studied and developed in recent years. Standard With extended Visual Cryptography, which is a map is chaotic and it can be employed to shuffle the method of cryptography that reveals the target image by positions of image pixels to get a totally visual difference stacking meaningful images. Christy and Seenivasagam from the original images. proposed a method that uses Back Propagation Network Ruisong Ye,Huiqing Huang proposed two novel (BPN) for extended visual cryptography. BPN was used schemes to shuffle digital images. Different from the to produce the two shares. The size of the image conventional schemes based on Standard map, they produced was the same as that of the original image. [9] disordered the pixel positions according to the orbits of A k-out-of-n Extended Visual Cryptography Scheme the Standard map. The proposed shuffling schemes didn’t (EVCS) is a secret sharing scheme which hides a secret need to discretize the Standard map and own more cipher image into n shares, which are also some images. The leys compared with the conventional shuffling scheme secret image can be recovered if at least k of the shares based on the discretized Standard map. The shuffling are superimposed, while nothing can be obtained if less schemes were applied to encrypt image and disarray the than k shares are known. Previous EVCS schemes are host image in watermarking scheme to enhance the either for black-and-white images or having pixel robustness against attacks. [15] expansion. Wu, Xiaoyu, Wong, Duncan S. and Li, Qin Amnesh Goel and Nidhi proposed contrastive methods proposed the first k-out-of-n EVCS for color images with to encrypt images by introducing a new image encryption no pixel expansion. The scheme also improved the method which first rearranges the pixels within image on contrast of the n shares and the reconstructed secret basis of RGB values and then forward intervening image image (i.e. the superimposed image of any k or more for encryption. [16] shares) by allowing users to specify the level of each Image Encryption Based on Explosive Inter Pixel primary color (i.e. Red, Green and Blue) in the image Displacement of the RGB Attribute of a Pixel: In this shares as well as the reconstructed secret image. [10] method focus was more on the inter pixel displacement Kester, QA proposed a cryptographic algorithm based rather than just manipulation of pixel bits value and on matrix and a shared secrete key.[11]. He further shifting of pixel completely from its position to new applied encryption and decryption of the images based on position. RGB value of pixel was untouched in this the RGB pixel [12]. method, but R value of pixel jumps to another location Shujiang Xu,Yinglong Wang , Yucui Guo and Cong horizontally and vertically same as in chaotic method. In Wanga proposed a novel image encryption scheme based the similar manner, G and B values of pixel [17]. on a nonlinear chaotic map (NCM) and only by means of With the proposed method in this paper, the shuffling XOR operation. There were two rounds in the proposed of the image will be done by solely displacing the RGB image encryption scheme. In each round of the scheme, Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
Image Encryption based on the RGB PIXEL Transposition and Shuffling 45 pixels and also interchanging the RGB pixel values. At Step 14. Let y= (1/3 rd part of n): (2/3 rd part of the end the total image size before encryption will be the n) as 1-dimensional array same as the total image size after encryption. Step 15. Let p= (2/3 rd part of n): (nth) as 1- dimensional array Step 16. Transform l, p, and y from vector to III. METHODOLOGY matrix with the same dimension of ‘r’ or ‘g’ or ‘b’ of the original image. The images used will have their RGB colors extracted Step 17. Finally the data will be converted into and their RGB values transposed and shuffled to obtain an image format to get the encrypted image. ciphered images. The ciphering of the images for this research will be done by using the RBG pixel values of The inverse of the algorithm will decrypt the encrypted the images only. image back into the plain image. In this method, there were no changes of the bit values of the images used and there was no pixel expansion at the end of the encryption and the decryption process. The V. THE MATHEMATICAL EXPLANATION numerical values of the pixels were displaced from their respective positions and the RGB values were Step 1. Start interchanged in order to obtain the ciphered images. This Step 2. Importing data from image and creating implies that, the total change in the sum of all values in an image graphics object by interpreting each the image is zero. Therefore there was no change in the element in a matrix. total size of the image during encryption and decryption Let Q= an image=Q(R, G, B) process. The characteristic sizes of image remained Q is a color image of m x n x 3 arrays unchanged during the encryption process. The images were looked at as a decomposed version in which the three principle component which forms the R G B image was chosen to act upon by the algorithm. The R-G- B components were considered as the triplet that forms the characteristics of a pixel. The pixel is the smallest (1) element of an image that can be isolated and still contains the characteristic found in the image. The RGB values were shifted out of their native pixel positions and interchanged within the image boundaries. The Shift displacement of the R G and B Values known as the component displacement factor array was different for the R, G and B. Where Q(R, G, B) = m x n With the proposed method in this paper, the shuffling Where R, G, B ∈ R of the image was ultimately done by solely displacing the (R o G) i j = (R) ij .(G) ij RGB pixels and also interchanging the RGB pixel values. Where R= = first value of R r= [ri1] (i=1, 2… m) x ∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} IV. THE ALGORITHM a=0 and b=255 Step 1. Start R= r= Q(m,n,1) Step 2. Import data from image and create an image graphics object by interpreting each Where G= g = first value of G element in a matrix. g= [gi2] (i=1, 2... m) Step 3. Extract the red component as ‘r’ x ∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} Step 4. Extract the green component as ‘g’ a=0 and b=255 Step 5. Extract the blue component as ‘b’ G= g= Q(m,n,1) Step 6. Reshape red into 1-dimensional array as ‘p’ And B= b = first value of B Step 7. Reshape green into 1-dimensional array b= [bi3] (i=1, 2... m) as ‘l’ x ∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} Step 8. Reshape blue into 1-dimensional array a=0 and b=255 as ‘y’ B=b= Q (m, n, 1) Step 9. Let t=[y; l; p] which is a column matrix. Step 10. Transpose‘t’ Such that R= r= Q (m, n, 1) Step 11. Reshape‘t’ into 1-dimensional array Step 12. Let n= total number of array Step 3. Extracting the red component as ‘r’ Step 13. Let l=(1st part of n): (1/3 rd part of n) Let size of R be m x n [row, column] = size (R) as 1-dimensional array = R (m x n) Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
46 Image Encryption based on the RGB PIXEL Transposition and Shuffling Step 8. Reshaping blue into 1-dimensional R array as ‘y’ Let size of B be m x n [row, column] = size (B) =B (m x n) rij= r= Q (m, n, 1) = (2) y=bij= b= Q (m, n,1) B = (7) Step 4. Extracting the green component as ‘g’ Let size of G be m x n [row, column] = size (G) = G (m x n) Step 9. Let t=[y; l; p] which is a column matrix. G y l p gij= g= Q (m, n, 1) = (3) t= (8) Step 5. Extracting the blue component as ‘b’ Step 10. Transpose of ‘t’ Let size of B be m x n [row, column] = size (B) t =t’[y; l; p] = B (m x n) y l p B t= (9) bij= b= Q (m, n, 1) = (4) Step 11. Reshape‘t’ into 1-dimensional array Step 6. Reshaping red into 1-dimensional array as ‘p’ Let size of R be m x n [row, column] = size (R) =R t= (10) (m x n) P=rij= r= Q (m, n,1) Step 12. Let n= total number of array Let size of T=t be m x n [row, column] = size (T) R =T(1 x n) = (5) Where n=n(tij) t= [t1i] and i=1, 2… m [a, b]= {n ∈ I: a ≤ x ≥ b} a=0 and b= +∞ Step 7. Reshaping green into 1-dimensional array as ‘l’ Step 13. Let l=(1st part of n): (1/3 rd part of n) Let size of G be m x n [row, column] = size (G) as 1-dimensional array =G (m x n) l=tij[(1st part of n): (1/3 rd part of n)] l=gij= g= Q (m, n,1) l = G = (11) (6) Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
Image Encryption based on the RGB PIXEL Transposition and Shuffling 47 Step 14. Let y= (1/3 rd part of n): (2/3 rd part of n) as 1-dimensional array R G B y=tij[1/3 rd part of n : (2/3 rd part of n) ] Let CI = (18) = y (12) Step 15. Let p= (2/3 rd part of n): (nth) as 1- dimensional array The inverse of the algorithm will decrypt the encrypted p=tij [(2/3 rd part of n): (nth)] image back into the plain image. Where CI (R, G, B) = Where R, G, B ∈ R m x n p = (13) (R o G) i j = (R) ij .(G) ij Where R= = first value of R r= [ri1] (i=1, 2… m) x∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} Step 16. Transforming l, p, and y from vector to a=0 and b=255 matrix with the same dimension of ‘r’ or ‘g’ R= r= CI (m,n,1) or ‘b’ of the original image. Where CI = = first value of G r=l=tij[(1st part of n): (1/3 rd part of n)] g= [gi2] (i=1, 2... m) x ∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} l a=0 and b=255 = (14) G= g= CI (m,n,1) And B= = first value of B g= [bi3] (i=1, 2... m) g=tij[1/3 rd part of n : (2/3 rd part of n) ] x∈ : [a, b]= {x ∈ I: a ≤ x ≥ b} a=0 and b=255 y = (15) B= b= CI (m, n, 1) Such that R= r= CI (m, n, 1) b=tij [(2/3 rd part of n): (nth)] p = (16) r b b Let CI = (17) Step 17. Finally the data will be converted into an image format to get the encrypted image. CI = Ciphered image =CI(R, G, B) CI is a color image of m x n x 3 arrays Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
48 Image Encryption based on the RGB PIXEL Transposition and Shuffling VI. THE ARCHITECTURAL SUMMARY OF THE ENCRYPTION PROCESS USING FLOW CHART DIAGRAM Figure 2: The flow chart diagram for the encryption and decryption process Fig. 1 is an illustration of the summary of the encryption of the plain image using flow chart. And then fig. 2 is an illustration of for the encryption and decryption processes. VII. THE SIMULATED RESULTS The simulation of the above algorithm was performed using MATLAB Version 7.0.0.1. The plain image size used was 25x21.The MATLAB code for the algorithm was written and tested. The results are shown below. Figure 3: Plain image Figure 1: The flow chart diagram for the encryption algorithm Figure 4: Cipher Image Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
Image Encryption based on the RGB PIXEL Transposition and Shuffling 49 Figure 5: Plain image Figure 11: An RBG graph of plain image of Fig. 5 Figure 6: Cipher Image Figure 7: Plain image Figure 12: An RBG graph of cipher image of Fig. 6 Figure 8: Cipher Image Figure 13: An RBG graph of plain image of Fig. 7 Figure 9: An RBG graph of plain image of Fig. 3 Figure 14: An RBG graph of cipher image of Fig. 8 V. DISCUSSION AND CONCLUSION Figure 10: An RBG graph of cipher image of Fig: 4 The transposition and reshuffling of the RGB values of the image in steps has proven to be really effective in terms of the security analysis. The extra swapping of RGB values in the image file after R G B component shifting has increased the security of the image against all possible attacks available currently. Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
50 Image Encryption based on the RGB PIXEL Transposition and Shuffling Our future research on this is focused on the [13] Shujiang Xu,Yinglong Wang,Yucui Guo,Cong Wang, employment of public key cryptography in the encryption "A Novel Image Encryption Scheme based on a of images. Nonlinear Chaotic Map", IJIGSP, vol.2, no.1, pp.61- 68, 2010. [14] Ruisong Ye,Wei Zhou,"A Chaos-based Image REFERENCES Encryption Scheme Using 3D Skew Tent Map and Coupled Map Lattice", IJCNIS, vol.4, no.1, pp.38-44, [1] Abraham Sinkov, Elementary Cryptanalysis: A 2012. Mathematical Approach, Mathematical Association [15] Ruisong Ye,Huiqing Huang, "Application of the of America, 1966. ISBN 0-88385-622-0 Chaotic Ergodicity of Standard Map in Image [2] Kester, Quist-Aphetsi. "A cryptosystem based on Encryption and Watermarking", IJIGSP, vol.2, no.1, Vigenère cipher with varying key." International pp.19-29, 2010. Journal of Advanced Research in Computer [16] Amnesh Goel,Nidhi Chandra,"A Technique for Engineering & Technology (IJARCET) 1, no. 10 Image Encryption with Combination of Pixel (2012): pp-108. Rearrangement Scheme Based On Sorting Group- [3] Nicolas Courtois, Josef Pieprzyk, "Cryptanalysis of Wise Of RGB Values and Explosive Inter-Pixel Block Ciphers with Overdefined Systems of Displacement", IJIGSP, vol.4, no.2, pp.16-22, 2012. Equations". pp267–287, ASIACRYPT 2002 [17] Reji Mathews, Amnesh Goel, PrachurSaxena & [4] Visual cryptography retrieved from: Ved Prakash Mishra, "Image Encryption Based on http://en.wikipedia.org/wiki/Visual_cryptography Explosive Inter-pixel Displacement of the RGB [5] M. Salleh, S Ibrahim and I.F. Isnin, Image Attributes of a PIXEL", Proceedings of the World encryption algorithm based on chaotic Congress on Engineering and Computer Science mapping.JurnalTeknologi, 39(D) Dis. 2003: 1– 2011 Vol I WCECS 2011, October 19-21, 2011, San 12 UniversitiTeknologi Malaysia. Francisco, USA. ISBN: 978-988-18210-9-6 [6] R.Kadir, R.Shahri and M.A.Maarof, A modified image encryption scheme based on 2D chaotic map. 978-1-4244-6235-3/10/2010 IEEE. [7] Dirk Rijmenants Visual Cryptography retrieved Quist-Aphetsi Kester, MIEEE is a from: global award winner 2010 (First http://users.telenet.be/d.rijmenants/en/visualcrypto.ht place Winner with Gold), in Canada m Toronto, of the NSBE’s Consulting [8] Krishnan, G.S.; Loganathan, D.; , "Color image Design Olympiad Awards and has cryptography scheme based on visual cryptography," been recognized as a Global Signal Processing, Communication, Computing and Consulting Design Engineer. Networking Technologies (ICSCCN), 2011 Currently, he is the national chair for International Conference on , vol., no., pp.404-407, Policy and Research Internet Society 21-22 July 2011 (ISOC) Ghana Chapter, a world renowned body that [9] Christy, J.I.; Seenivasagam, V.; , "Construction of provides international leadership in Internet related color Extended Visual Cryptographic scheme using standards, education, and policy. He is the Chairman for Back Propagation Network for color images," the Centre of Research, Information Technology and Computing, Electronics and Electrical Technologies Advanced computing-CRITAC. He is a law student at the (ICCEET), 2012 International Conference on , vol., University of London UK. He is a PhD Candidate in no., pp.1101-1108, 21-22 March 2012 Computer Science. The PhD program is in collaboration [10] Wu, Xiaoyu; Wong, Duncan S.; Li, Qing; , between the AWBC/ Canada and the Department of "Extended Visual Cryptography Scheme for color Computer Science and Information Technology (DCSIT), images with no pixel expansion," Security and University of Cape Coast. He had a Master of Software Cryptography (SECRYPT), Proceedings of the 2010 Engineering degree from the OUM, Malaysia and BSC in International Conference on , vol., no., pp.1-4, 26-28 Physics from the University of Cape Coast-UCC Ghana. July 2010 He has worked in various capacities as a peer reviewer [11] Kester, Quist-Aphetsi; , "A public-key exchange for IEEE ICAST Conference, IET-Software Journal, cryptographic technique using matrix," Adaptive lecturer, Head of Digital Forensic Laboratory Department Science & Technology (ICAST), 2012 IEEE 4th at the Ghana Technology University and Head of International Conference on , vol., no., pp.78-81, 25- Computer science department. He is currently a lecturer 27 Oct. 2012 at the Ghana Technology University College and He may [12] Kester, Quist-Aphetsi; Koumadi, Koudjo M; , be reached at kquist- "Cryptographie technique for image encryption aphetsi@gtuc.edu.gh/kquist@ieee.org based on the RGB pixel displacement," Adaptive Science & Technology (ICAST), 2012 IEEE 4th International Conference on , vol., no., pp.74-77, 25- 27 Oct. 2012 Copyright © 2013 MECS I.J. Computer Network and Information Security, 2013, 7, 43-50
You can also read