Good hash function should be collision resistant. In 2004 it was shown that MD5 is not collision resistant. As such, MD5 is not suitable for applications like SSL certificates or digital signatures that rely on this property for digital security. Today we see this method is widely use in sites and many device.

  • What is the reason for using this insecure hash function?

Edit: what is the advantage of MD5 relative to other hash function such as the SHA/256 that people use this insecure hash function yet?

  • You first need to define the context. If MD5 is used for password hashing then yes it's insecure but if it's used for identfiying an unique file then it might be ok.
    – HamZa
    Jan 19, 2016 at 14:25
  • Let we have two file with same hash, how we can find original? Jan 19, 2016 at 14:30
  • 1
    Your comment doesn't make sense. Care to clarify?
    – HamZa
    Jan 19, 2016 at 14:30
  • @HamZa: This is not always true, have a look at mathstat.dal.ca/~selinger/md5collision
    – Jeroen
    Jan 19, 2016 at 15:40
  • 1
    @Jeroen-ITNerdbox I've seen that exploit. Note that there's a difference between generating such files and finding such files in the wild. My point was: md5 might be insecure for hashing but enough for other applications.
    – HamZa
    Jan 19, 2016 at 17:24

1 Answer 1


Common reasons I saw:

  • Outdated/insecure learning material: A great deal of books/online sites teaching PHP still teach using unsalted MD5 for passwords instead of bcrypt etc. I remember of about 201x a google search for "php password" returned mostly only such tutorials.
  • Outdated knowledge of the programmer: many programmer don't keep their security knowledge up to date and continue to use what they learn.
  • It just has to work/the programmer doesn't care about security/doesn't know about security. The programmer generated hashes of 2 different strings. The hashes looked different. The hashes looked different then the string. He didn't see a straight-forward method to convert the hash back to the original string. "getting those GUI-features/functionality working" is more importing
  • The same for (maybe outdated) libraries used by the programmer and the programmer did not check enough or he trusted the library to do it right.
  • better crypto not supported: the system/language/third party system/... does not support better crypto
  • nobody will ever hack us because we are too small/unhackable/...
  • once written and never changed: especially connected with the previous one and connected with "changing this will cost too much/might introduce problems"
  • a more secure version was not specified/paid: many companies give programming work to contractors which subcontract others for the least possible money. The real work is then often done by inexperienced/cheap/... programmers who do only do the minimum required work

I hope most of those reasons will be gone in near future.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .