International Journal of Engineering Trends and Technology (IJETT) – Volume 17 Number 1 – Nov 2014 A Hybrid Approach of Image Encryption and Compression for Secure Transmission Posa Naga Lavanya Yedida1, P. Ravi Kiran2 1 Final M.Tech Student ,2 Associate Professor Dept of CSE, Swarnandhra College Engineering and Technology, Seetharampuram,W.G.Dt,[A.P],India 1,2 Abstract: In addition to provide the security for data through image, we are using the concepts hybrid approach of encryption and compression techniques, before transmission of data we can encrypt it by using cryptographic technique. In this paper we are using triple DES algorithm for data encryption and decryption, after encryption of data the cipher data can be stored into image using LSB technique and image can be encrypted by using PTT(pixel transpose technique),after encryption ,image can be compressed by using Arithmetic compression and decompression technique. Our proposed architecture provides data confidentiality and improves the performance than traditional approaches. I. INTRODUCTION In previous days transfer the image and data through network in form of plain format. So that transferring data and image in form of plain is will loss the security in a network. So that we can provide the security the transferring image and data can be sent in form of unknown format. So that by convert data and image into unknown format we can encrypt image by using any technique.[1,5] The main aim of encoding or encryption is to provide the confidentiality over the communication and storage process. In present days the usage is considered as particular devices that consider extra features those are calculations over authorized computers. For this use unauthorized nodes is only the encoded version of the data in the process. The nodes will calculation on the encoded data without having any knowledge on the real value. Lastly the data send back and decrypt the data. [4] The most well-known cryptosystems are deterministic: for a fixed encryption key, a given plain text will always be encrypted in the same ciphertext. This may lead to some drawbacks.RSA is a good example to illustrate this point: (i) Particular plain texts may be encrypted in a too much structured way: with RSA, messages 0 and 1 are always encrypted as 0 and 1, respectively; (ii) it may be easy to compute partial information about the plaintext: with RSA, the cipher text c leaks one bit of Whereas the development of tools capable of processing encrypted signals may seem a formidable task, some recent,still scattered, studies, spanning from secure embedding and detection of digital watermarks and secure ISSN: 2231-5381 information about the plain text m, namely, the so called Jacobi symbol; (iii) when using a deterministic encryption scheme, it is easy to detect when the same message is sent twice while processed with the same key. Coming to security issues the encryption schemes are formatted for initial time and it introduced an author Shannon that is best method to provide perfect secrecy which the encoding methods are not given any information about plain text or about key. In this method it is proved that one time pad that is successfully protected under some particular conditions. This model has allowed the study of the security level for numerous asymmetric ciphers. Recent works show that we are now able to perform proofs in a more realistic model called the standard model. From [2] to [3], a lot of papers compared these two models, discussing the gap between them. In parallel with this formal estimation of the security level, an empirical one is performed in any case, and new symmetric and asymmetric schemes are evaluated according to published attacks. II. RELATEDWORK In recent studies the digital signaling is enabled in many number of applications. It is introduced in multimedia systems and these services are using in secret communication. Present technical solutions are secure modifications of the data using cryptographic methods using secure network layer techniques. That is for protecting data at the time of transferring the data. This tends to the cryptographic layer features by generating to protect the unauthorized access of the users. It is for providing the authorize access in the network for data access.[7,8] It is clear that the availability of signal processing algorithms that work directly on encrypted signals would be ofgreat help for application scenarios where signals must be produced, processed, or exchanged securely. content distributionto compression of encrypted data and access to encrypted databases, have shown that performing signal processing operations in encrypted content is indeed possible.[6] http://www.ijettjournal.org Page 51 International Journal of Engineering Trends and Technology (IJETT) – Volume 17 Number 1 – Nov 2014 III. PROPOSED SYSTEM User A key generation: Now a day’s transmission of data through image over network without losing data integrity is a complex task. To provide security of data and image, we can use the cryptography techniques, image encryption and decryption technique and compression techniques. In this paper we are using an efficient technique for provide more security. User A selects a private key and calculates a public key. In Cryptographic Module, it is used for convert data into unknown format. The conversion of data into unknown format is called encryption and converting cipher text into plain text is called the decryption, before sending data through image the sender will encrypt data using Triple DES algorithm. After converting data into unknown format that cipher text will be stored into image and sent to receiver. The receiver will retrieve the cipher text from the image and decrypt using triple des to retrieve the plain text. XA<p Generate public key YA YA=q XA mod p User B key generation: User B selects a private key and Calculates a public key. Select private key XB XB<p Generate public key Y B YB=q Key Generation algorithm: Diffie-hellman is one of the key exchange algorithms and is used for Delta value generation. Select private key XA Global public elements: XB mod p Generation of secret key by User A: This algorithm considers the two public keys: User A generate a secret key using his private key and User B public key. p(prime number) K=(YB) XA mod p q(primitive root) Generation of secret key by User B: q<p. User B generate a secret key using his private key and User A public key. K=(YA) XB mod p Store data into image: (ii) The sender will receive the cipher text and convert into binary format. After converting binary format the sender will store into image by using LSB technique. Before storing data into image the sender will retrieve each pixel from the image and convert into binary format after we can store data into image, after completion of storing data into image the sender will generate data hide image. (iii) POT technique: After storing data into image the sender will encrypt and decrypt the image. In this paper the sender and receiver will use POT technique for image encryption and decryption. The procedure of POT technique as follows. (iv) Then stored all the pixels value of I in two dimensional array named as P like every image have rows or column wise pixels. Firstly row wise XOR all the bits of pixel from top to bottom like as firstly XOR first and second row and then store first row as XOR Result and second rows as it is than XOR second and third rows and store as according to previous operation and then apply to all the rows. A square grid of required size constructed by taking binary data from thexor data. (V) 1. Encryption process: (i) First of all select whole image and give named as I. ISSN: 2231-5381 Now grid transposition applied by reading data diagonally and writing it down on row basis from left to right. (Vi) A new grid generated after transposition. http://www.ijettjournal.org Page 52 International Journal of Engineering Trends and Technology (IJETT) – Volume 17 Number 1 – Nov 2014 (vii) The new grid is converted into ASCII sequence and written into Image file. 2. Decryption process : After decompression of image the image can be converted into pixel and perform the decryption process. (i) (ii) A square grid of required size constructed by taking binary data from the Image file. Now grid transposition applied by reading data diagonally and writing it down on row basis from left to right. (iii) A new grid generated after transposition. (iv) After column wise XOR all the bits of pixel from right to left like as firstly XOR last and lase second column until completion of reverse process encryption. After column xor again perform the row wise from right to left . Then stored all the pixels value of I in two dimensional array named as P And getting original image. (v) Symbol A E I O U ! Probability .2 .3 .1 .2 .1 .1 ISSN: 2231-5381 Arithmetic compression technique Here sender performs the compression technique for image compression and receiver performs the decompression technique for image decompression, for performing compression and decompression we are using arithmetic technique for image compression and decompression. After performing of encryption of image the sender will compress the image using Arithmetic compression technique and sent to receiver, after sending the receiver will retrieve the compressed image and decompress by using the arithmetic decompression technique. Arithmetic compression technique To encode a long message into a single code word without using a large codebook, we must Step I: use a (hash) function to compute an ID (or tag) for the message. The function should be invertible Step II: Given an ID (tag), assign a codeword for it using simple rules, hence, there is no need to build a large codebook Arithmetic coding is an example of how these two steps can be achieved by using cumulative density function (CDF) as the hash function In arithmetic coding, each symbol is mapped to an interval Message: “eaii!” Interval [0, 0.2) [0.2, 0.5) [0.5, 0.6) [0.6, 0.8) [0.8, 0.9) [0.9, 1.0) http://www.ijettjournal.org Page 53 International Journal of Engineering Trends and Technology (IJETT) – Volume 17 Number 1 – Nov 2014 Tag selection for a message: Since the intervals of messages are disjoint, we canpick any values from the interval as the tag A popular choice is the lower limit of the interval, Single symbol example: if the mid-point of the interval[FX(ai–1), FX(ai)) is used as the tag TX(ai) of symbol ai, then Note that: the function TX(ai) is invertible. To generate a unique tag for a long message, we need an ordering on all message sequences A logical choice of such ordering rule is the lexicographic ordering of the message With lexicographical ordering, for all messages of length m, we have Symbol 1 2 3 4 Fx .5 .75 .875 1.0 Tx .25 .625 .8125 .9375 Recursive Computation of Tags: Assume that we want to code the outcome of rolling a fair die for three times. Let’s compute the upper and lower limits of the message “3-2-2.” For the first out come “3,” we have l(1) = FX(2), u(1) = FX(3). For the second outcome “2,” we have upper limit FX (2)(32) = [P(x1 = 1) + P(x1 = 2)] + P(x = 31) + P(x = 32) = FX(2) + P(x1 = 3)P(x2 = 1) + P(x1 = 3)P(x2 = 2) = FX(2) + P(x1 = 3)FX(2) = FX(2) + [FX(3) – FX(2)]FX(2). In Binary .010 .101 .1101 .1111 Thus, u(2) = l(1) + (u(1) – l(1))FX(2). Similarly, the lower limit FX (2)(31) is l(2) = l(1) + (u(1) – l(1))FX(1). For the third outcome “2,” we have l(3) = FX (3)(321), u(3) = FX(3)(322). Using the same approach above, we have FX(3)(321) = FX(2)(31) + [FX(2)(32) – FX(2)(31)]FX(1). FX(3)(322) = FX(2)(31) + [FX(2)(32) – FX(2)(31)]FX(2). Therefore, l(3) = l(2) + (u(2) – l(2))FX(1), and u(3) = l(2) + (u(2) – l(2))FX(2). In general, we can show that for any sequence x = (x1x2…xn), l(n) = l(n–1) + (u(n–1) – l(n–1))FX(xn–1) u(n) = l(n–1) + (u(n–1) – l(n–1))FX(xn). If the mid-point is used as the tag, then Note that we only need the CDF of the source alphabet to compute the tag of any long messages. Deciphering The Tag: The algorithm to deciphering the tag is quite straight forward: 1. Initialize l(0) = 0, u(0) = 1. 2. For each k, find t* = (TX(x) – l(k–1))/(u(k–1) – l(k–1)). 3. Find the value of xk for which FX(xk – 1) t* FX(xk). 4. Update u(k) and l(k). 5. If there are more symbols, go to step 2. In practice, a special “end-of-sequence” symbol is used to signal the end of a sequence. ISSN: 2231-5381 Where y < xi means y precedes xi in the ordering of all messages.Bad news: need P(y) for all y < xi to compute TX(xi)! [log* 1/pco]+1 2 3 4 4 Code 01 101 1101 1111 Example of Decoding Tag: Given A = {1, 2, 3}, FX(1) = 0.8, FX(2) = 0.82, FX(3) = 1, l(0) = 0, u(0) = 1. If the tag is TX(x) = 0.772352, what is x? Note: l(n) = l(n–1) + (u(n–1) – l(n–1))FX(xn–1) u(n) = l(n–1) + (u(n–1) – l(n–1))FX(xn) t* = (0.772352 – 0)/(1 – 0) = 0.772352 FX(0) = 0 ≤t* ≤ 0.8 = FX(1) l(1) =0, u(1) = 0.8.1 t* = (0.772352 – 0)/(0.8 – 0) = 0.96544 FX(2) = 0.82 ≤t* ≤ 1 = FX(3) l(2) =0.656, u(2) = 0.8.13 t* = (0.772352 – 0.656)/(0.8 – 0.656) = 0.808 FX(1) = 0.8 ≤t* ≤ 0.82 = FX(2) l(3) =0.7712, u(3) = 0.77408.132 t* = (0.772352 – 0.7712)/(0.77408 – 0.7712) = 0.4 FX(1) = 0 ≤t* ≤ 0.8 = FX(1)1321 Binary Code for the Tag: If the mid-point of an interval is used as the tag TX(x),a binary code for TX(x) is the binary representation ofthe number truncated to l(x) = _log(1/P(x))_ + 1 bits. _ For example, A = { a1, a2, a3, a4 } with probabilities{ 0.5, 0.25, 0.125, 0.125 }, a binary code for each symbol is as follows IV. CONCLUSION We are concluding our current research work with efficient encryption of image and compression techniques. Data privacy or confidentiality and can be maintained by Triple DES cryptographic algorithm and Diffie-hellman key http://www.ijettjournal.org Page 54 International Journal of Engineering Trends and Technology (IJETT) – Volume 17 Number 1 – Nov 2014 exchange protocol.PTT technique encrypts the image and followed by image compression technique with arithmetic coding mechanism and vice versa followed by the receiver decompress the image followed by decryption of image then retrieves the cipher information and convert to plain with triple DES algorithm. REFERENCES [1] “Methods for subjective determination of transmission quality,” ITUR Recommendation P.800, 1996. [2] “Methodology for the subjective assessment of the quality of television pictures,” ITU-R Recommendation BT.500-11, 2002. [3] I. Avcibas, B. Sankur, and K. Sayood, “Statistical evaluation of image quality measures,” Journal of Electronic Imaging, vol. 11, no. 2, pp. 206– 223, 2002. RAVI KIRAN received his B.Tech from J.N.T.U and M.TECH in Computers & Communications from JNTU.His areas of interests include Artificial Intelligence, Image processing, Speech processing and Neural networks. He has 8+ years of experience in teaching to engineering students. He is the member of C.S.I, (India) and IAENG (U.S.A). He is now the Associate Professor, Department of C.S.E at Swarnandhra College of Engineering & Technology; Narsapur. He is heading Special Interest Research Groups in Image and Speech processing. He was also listed in ICGST and ACM. He has published many technical papers both in international and national Journals & Conferences. [4] G. Chen, Y.Mao, and C. K. Chui, “A symmetric image encryption scheme based on 3D chaotic cat maps,” Chaos, Solitonsand Fractals, vol. 21, no. 3, pp. 749–761, 2004. [5] S.-G. Cho, Z. Bojkovic, D. Milovanovic, J. Lee, and J.-J.Hwang, “Image quality evaluation: Jpeg 2000 versus intraonlyh.264/avc high profile,” FactaUniversitatis, Nis, Series: Electronicsand Energetics, vol. 20, no. 1, pp. 71–83, 2007. [6] J. Daemen and V. Rijmen, The Design of Rijndael: AES— TheAdvanced Encryption Standard, Springer, New York, NY, USA,2002. [7] A. M. Eskicioglu, “Quality measurement for monochromecompressed images in the past 25 years,” in Proceedings of IEEEInternational Conference on Acoustics, Speech and Signal Processing(ICASSP ’00), vol. 4, pp. 1907–1910, Istanbul, Turkey,June 2000. [8] J. Fridrich, “Symmetric ciphers based on two-dimensionalchaotic maps,” International Journal of Bifurcation and Chaosin Applied Sciences and Engineering, vol. 8, no. 6, pp. 1259–1284, 1998. [9] B. Furht and D. Kirovski, Eds.,Multimedia Security Handbook,CRC Press, Boca Raton, Fla, USA, 2005. [10] M. Gschwandtner, A. Uhl, and P. Wild, “Compression of encryptedvisual data,” in Proceedings of the 10th IFIP InternationalConference on Communications andMultimedia Security(CMS ’06), H. Leitold and E. Markatos, Eds., vol. 4237 of LectureNotes on Computer Science, pp. 141–150, Springer, Crete,Greece, October 2006. BIOGRAPHIES Posa Naga Lavanya Yedida received B.Tech degree in computer science and engineering from Jawaharlal Nehuru Technological university Kakinada, pursuing M.Tech (computer science and engineering).she is an p.gstudent, department of computer science and engineering, Swarnandhra College of Engg, Technology, Seetharampuram, W.G.Dt(A.P),India. Her area of interest is Image processing. ISSN: 2231-5381 http://www.ijettjournal.org Page 55