A Meaningful MD5 Hash Collision Attack

A Meaningful MD5 Hash Collision Attack

San Jose State University SJSU ScholarWorks Master's Projects Master's Theses and Graduate Research 2006 A Meaningful MD5 Hash Collision Attack Narayana D. Kashyap San Jose State University Follow this and additional works at: https://scholarworks.sjsu.edu/etd_projects Part of the Computer Sciences Commons Recommended Citation Kashyap, Narayana D., "A Meaningful MD5 Hash Collision Attack" (2006). Master's Projects. 21. DOI: https://doi.org/10.31979/etd.fm5j-tzcm https://scholarworks.sjsu.edu/etd_projects/21 This Master's Project is brought to you for free and open access by the Master's Theses and Graduate Research at SJSU ScholarWorks. It has been accepted for inclusion in Master's Projects by an authorized administrator of SJSU ScholarWorks. For more information, please contact [email protected]. A Meaningful MD5 Hash Collision Attack A Writing Project Presented to the Faculty of the Department of Computer Science San Jose State University In Partial Fulfillment of the Requirements for the Degree Master of Science By Narayana D Kashyap Aug 2006 Dedicated to My parents Hema and Datha And my sweet Grandma Ajji ACKNOWLEDGEMENTS I would like to thank Dr. Mark Stamp for his guidance, insights and immense patience, without which my project would have been impossible to complete. His suggestions and his work in this field helped me tremendously in understanding and working on the topic. Dr. Stamp also provided appropriate research papers, including his own book, which aided me in identifying the areas to concentrate and consequently write a sound project statement. I would also like to thank Dr. Sami Khuri and Prof. David Blockus for agreeing to be the committee members to review and certify my project. Finally, I would like to express my gratitude to Asif, Vinod, Venkat, Bharath, Joshi, Vamsi, Karan, Lakshmi, Amulya, Pavan, Chakki, Manu, my brothers Chythanya and Vinay and all my other friends and family members who have supported me immensely both in technical and moral spheres. i ABSTRACT It is now proved by Wang et al., that MD5 hash is no more secure, after they proposed an attack that would generate two different messages that gives the same MD5 sum. Many conditions need to be satisfied to attain this collision. Vlastimil Klima then proposed a more efficient and faster technique to implement this attack. We use these techniques to first create a collision attack and then use these collisions to implement meaningful collisions by creating two different packages that give identical MD5 hash, but when extracted, each gives out different files with contents specified by the atacker. Keywords: MD5, hash, collision, Wang, attack ii Table of Contents 1 Introduction to cryptography .............................................................................................. 1 2 Cryptosystems and Public key cryptography..................................................................... 3 2.1 Outline of some cryptographic algorithms ..................................................................... 3 2.1.1 Diffie-Hellman (DH) public-key algorithm:........................................................... 3 2.1.2 RSA......................................................................................................................... 4 2.1.2.1 Algorithm............................................................................................................ 4 2.1.2.2 RSA Security...................................................................................................... 5 3 Hash Functions...................................................................................................................... 6 3.1 Application of Hash Functions ....................................................................................... 7 3.1.1 Digital Signature..................................................................................................... 7 3.1.2 Password Protection................................................................................................ 7 4 MD5........................................................................................................................................ 8 5 Wang’s Attack on MD5...................................................................................................... 11 5.1 Differential cryptanalysis.............................................................................................. 11 5.2 Wang’s Differentials for MD5 Attack .......................................................................... 13 5.3 The Outline of the Attack ............................................................................................. 14 5.4 Reverse Engineering Wang’s Attack............................................................................ 15 5.5 Message Modification................................................................................................... 19 5.5.1 Single Step Modification...................................................................................... 19 5.5.2 Multi-Step Modification....................................................................................... 21 5.6 Klima’s technique......................................................................................................... 23 5.7 Implementation of Wang’s Attack................................................................................ 25 6 A Practical Attack on MD5 by Constructing Meaningful Collisions............................. 26 6.1 Poisoned Message Attack ............................................................................................. 26 6.2 Other document file formats ......................................................................................... 27 7 Implementation of a Practical Attack.............................................................................. 28 7.1 A practical scenario of the attack.................................................................................. 29 8 Conclusion and Future Work ............................................................................................ 31 9 References............................................................................................................................ 32 iii Appendix A.................................................................................................................................. 34 Wang’s Output Differentials...................................................................................................... 34 Appendix B .................................................................................................................................. 37 Add-differences provided by Hawkes et al............................................................................... 37 iv Table of Illustrations Figure 1: The principle behind timing attack ............................................................................. 5 Figure 2: Merkle-Damgard Construction ................................................................................... 7 Figure 3: MD5 processing of a single 512-bit block................................................................ 10 Figure 4: Packager program asking for the name of the final output file................................. 28 v 1 Introduction to cryptography The evolution of cryptography was led by the idea of information security, i.e., cryptography is the science of securing the information. It involves encryption and decryption of messages. Encryption is the process of converting a plain text into cipher text and decryption is the process of getting the original message back from the encrypted text. Cryptography also provides Integrity, Authentication, and Non-repudiation, in addition to confidentiality [2]. There are many known cryptographic algorithms. The basis of any cryptographic algorithm is the “key” used for encrypting/decrypting the information. Many of the cryptographic algorithms are available publicly, though some believe in having a secret algorithm. The general method has been to use a publicly known algorithm while maintaining a secret key [7]. Based on the key used, there are two categories of cryptosystems: Symmetric and Asymmetric. In Symmetric Key Cryptosystems, the same key is used for both Encryption and decryption. i.e. if K and M were the key and the message, then, we have DK(EK(M)) = M where D and E denotes decryption and encryption. Advantages of this system are speed and security based on the strength of key. There are some disadvantages too. Exchange and administration of the key gets complicated and non-repudiation is impossible. Examples: DES, 3-DES, RC4, RC5 etc [2][7]. In Asymmetric, also called shared key or Public key cryptosystems, two different but interchangeable keys are used for encryption and decryption. The two keys are linked mathematically. One of the keys is made public (shared) while the other is kept secret. i.e. if k1 and k2 are public and private keys, respectively and M be the message, then Dk2(Ek1(M)) = Dk1(Ek2(M)) = M [2]. Public key systems are considered to be very secure and encourages non-repudiation. Key exchange is not required thus minimizing the key administration. But the ciphertext tend to be much bigger than plaintext and is much slower than Symmetric systems. Examples: Diffie-Hellman, RSA and Elliptic Curve Cryptography. - 1 - The idea of using Elliptic curves in cryptography was first suggested by Victor Miller and Neal Koblitz. This was introduced as an alternative to

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    45 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us