A Pattern Recognition Approach to Block Cipher
Total Page:16
File Type:pdf, Size:1020Kb
A PATTERN RECOGNITION APPROACH TO BLOCK CIPHER IDENTIFICATION A THESIS submitted by SREENIVASULU NAGIREDDY for the award of the degree of MASTER OF SCIENCE (by Research) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING INDIAN INSTITUTE OF TECHNOLOGY MADRAS. October 2008 Dedicated to my parents i THESIS CERTIFICATE This is to certify that the thesis entitled A Pattern Recognition Approach to Block Cipher Identification submitted by Sreenivasulu Nagireddy to the Indian Institute of Technology Madras, for the award of the degree of Master of Science (By Research) is a bonafide record of research work carried out by him under our supervision and guidance. The contents of this thesis, in full or in parts, have not been submitted to any other Institute or University for the award of any degree or diploma. Dr. C. Chandra Sekhar Dr. Hema A. Murthy Chennai-600036 Date: ACKNOWLEDGEMENTS I wish to express my gratitude to everyone who contributed in making this work a reality. There are persons not mentioned here but, deserve my token of appreciation, first of all, I thank them all. Let me also thank the Indian Institute of Technology Madras for giving me an opportunity to pursue my post graduation. I am grateful to Computer science department for providing the facilities for the same. This institute has given me great exposure. There has been a drastic change in my vision of life. I enjoyed every moment of my IIT life. I would like to thank my guides, Prof. Hema A. Murthy and Dr. C Chandra Sekhar whose expertise, understanding, and patience, helped me through the course. I also thank Dr. Shri Kant (DRDO) for clearing my concepts and for his valuable suggetions in solving complex problems. I am grateful to the other members of my general test committee, Dr. N S Narayanaswamy and Dr. C S Ramalingam for the assistance they provided at all levels of my research. I also thank other faculty members of Computer science department especially, Dr. Debdeep Mukhopadhyay for taking time out from his busy schedule for reviewing my work and giving precious feedbacks. My sincere gratitude to the head of the computer science department, Prof. Timothy A Gonsalves for the facilities and support for the completion of my course. I hereby, thank every faculty member of this department who taught me many values in life apart from the regular curriculum especially Dr. Shankar Balachandran who is very friendly and source inspiration for my research. I thank my friend Swapna who was also working in similar research topic and have given valuable suggestions in my research as well 85 personal life. My lab-mates have been extraordinarily helpful, in both my academic and personal life. Kasirajan, Deivapalan, Manohar, Nikhil, Samuel, Dinil and lot many at DON lab have made their remarkable contributions for the fruitful results of my GENERAL TEST COMMITTEE research. My friends at IIT, Manikumar, Sheetal, Noor, Mahesh, Anil, Ramakrishna, Prashant, Bhanu, Sarma, Laskhmi Narayana, Abhilash, Sid and KP without whom 1 Chairperson: Dr. P Sreenivas Kumar my IIT life is unimaginable. 2 Guides: Prof. Hema A. Murthy and Dr. C. Chandra Sekhar I express my salutation to god almighty for giving me such understanding and 3 Members: supporting parents and family. • Dr. N.S. Narayanaswamy • Dr. C.S. Ramalingam 84 iv ABSTRACT CURRICULUM VITAE Keywords: Cryptanalysis; Identification of encryption method; Pattern recognition 1. Name: Sreenivasulu Nagireddy techniques; Histogram method; Support Vector Machines; Gaussian Mixture Models; 2. Date of Birth: 25th May, 1982 Data expansion methods;Block ciphers; AES; DES; BlowFish; TDES; RC5 3. Educational Qualifications: • 2008 - Master of Science (M.S) With the advent of high speed network technologies, large amount of sensitive data is being transfered over the Internet and other public channels. Faster and larger • 2003 - Bachelor of Engineering (B.E) storage devices have become cheaper. The concern for protection of information is 4. Permanent address: increasing at an alarming rate. Block ciphers are being widely used for secure trans- Srikolanu, Sangam, mission over the network and also for storing information securely in fixed hard drives Nellore - 524308, and removable drives. New block ciphers are being designed as the existing block Andhra Pradesh. ciphers are prone to attack and also to make the encryption process faster than the Email-id: [email protected] existing ciphers. Users of block ciphers must be convinced that the block ciphers that they are using are resilient to different kinds of attacks. Hence, a mechanism is required to assess the strength of the block ciphers. Identification attack or dis- tinguishing attack is a cryptanalytic attack that serves as a primary assessment of strength of ciphers. This attack can be applied prior to either the key space reduction or in decryption without the key. Most of the research in cryptanalysis starts with the assumptions that the en- cryption method and mode of operation are already known. Also researchers work on reduced versions of encryption algorithm instead of full algorithm. But in real world it is necessary to know the encryption method and mode of operation before doing the 83 cryptanalysis of finding key or plaintext. In this work we try to find out encryption method and mode of operation. Further we use the complete encryption algorithms instead of simplified versions. Identification of the encryption method of block ciphers is a kind of cryptanalysis attack. It is considered to be the primary attack that assesses the security of the block ciphers. Two sub-problems of this task namely, (a) detecting the encryption mode and (b) locating the starting position of a block in a captured ciphertext are addressed in this work. Identification of the encryption method from block ciphers is considered as a pat- tern classification problem. We use pattern recognition techniques such as the his- togram matching method, support vector machines and Gaussian mixture models for detecting the patterns in block ciphers. We develop several attacking techniques under three attacking models (a) ciphertext-only attack, (b) known-plaintext attack and (c) side channel attack. Various techniques have been proposed and implemented as part of this research. The results indicate that cipher texts in the ECB mode are prone to attack where as the CBC mode cipher texts are robust. The AES emerges as a strong block cipher among the widely used block ciphers such as AES, DES, TDES, Blowfish and RC5. 82 vi [57] Serge Vaudenay, “On the weak keys of blowfish,” in Proceedings of the Third International Workshop on Fast Software Encryption, London, UK, 1996, pp. TABLE OF CONTENTS 27–32, Springer-Verlag. [58] “Rc5,” http://en.wikipedia.org/wiki/RC5. Thesis certificate ii [59] Alex Biryukov and Eyal Kushilevitz, “Improved cryptanalysis of rc5,” Lecture Acknowledgements iii Notes in Computer Science, vol. 1403, pp. 85–100, 1998. Abstract v [60] “Project rc5 by distributed.net,” http://www.distributed.net/rc5/. List of Tables xi List of Figures xiv 1 Introduction 1 1.1 Overview................................... 1 1.2 Motivation.................................. 4 1.3 Majorcontributions............................. 5 1.4 Organization ................................ 5 2 Overview of Cryptography 7 2.1 Introduction................................. 7 2.2 Cryptography ................................ 7 2.3 Propertiesofagoodmoderncipher . 8 2.4 Typesofcryptography ........................... 9 2.4.1 Typesofsymmetriccryptography . 10 2.5 Blockciphermodesofoperation. 11 2.5.1 ElectronicCodebook(ECB)mode. 11 2.5.2 Cipher Block Chaining (CBC) Mode . 12 2.6 Cryptanalysis ................................ 14 2.6.1 TypesofCryptanalysisAttacks . 14 81 [47] D. W. Davies and S. Murphy, “Pairs and triplets of des s-boxes,” Journal of . 2.6.1.1 Ciphertext-onlyattack . 14 Cryptology, vol. 8, pp. 1–25, 1995. 2.6.1.2 Known-plaintextattack . 15 [48] Eli Biham and Alex Biryukov, “An improvement of davies’ attack on des,” Jour- 2.6.1.3 Chosen-plaintextattack . 15 nal of Cryptology: the journal of the International Association for Cryptologic 2.6.1.4 Chosen-ciphertext attack . 15 Research, vol. 10, no. 3, pp. 195–205, 1997. 2.6.1.5 Sidechannelattack. 16 2.7 Summary .................................. 16 [49] Ralph C. Merkle and Martin E. Hellman, “On the security of multiple encryp- 3 Ciphertext-only Attack 17 tion,” Commun. ACM, vol. 24, no. 7, pp. 465–467, 1981. 3.1 Overview................................... 17 [50] C. van Oorschot and Michael J. Wiener, “A known-plaintext attack on two- 3.1.1 Datasetsusedinthestudy . 18 key triple encryption,” in EUROCRYPT ’90: Proceedings of the workshop on 3.2 Histogrammethod ............................. 19 the theory and application of cryptographic techniques on Advances in cryptology, 3.2.1 Histogrambasedclassification . 22 New York, NY, USA, 1991, pp. 318–325, Springer-Verlag New York, Inc. 3.2.2 Histogram method-Pairwise classification . .... 25 [51] Stefan Lucks, “Attacking triple encryption,” in FSE ’98: Proceedings of the 3.2.3 Classification of the first block of CBC mode ciphertext ..... 26 5th International Workshop on Fast Software Encryption, London, UK, 1998, pp. 3.2.4 Identification of encryption method for ciphertexts of image and 239–253, Springer-Verlag. speechdata ............................. 27 28 [52] Eli Biham, “How to forge des-encrypted messages in 2 steps,” . 3.2.5 Identification of encryption mode . 27 [53] Daniel J. Bernstein, “Cache-timing attacks on AES,” 2004. 3.2.6 Identification