MD5 which is short for Message-Digest algorithm 5 is a cryptographic function that is used for creating hash values that are 16 bytes in length (128 bits).
MD5 has been specified in the RFC 1321 and has been used widely in many different security applications and most commonly used in digital certificates or also commonly known as the SSL certificates.
Another common use of MD5 is for checking the integrity of files. The MD5 function is mostly used as a hash value function.
This means that once the data has been processed, a 128 bit value is generated and this value is not reversible. So effectively, given a 128 bit hash value, it is not possible to construct the actual data by reversing the hashing algorithm.
MD5 is the successor of MD4 and was designed by Ron Rivest in 1991. MD5 provides a fixed output of 128 bits for any variable length input. The algorithm of MD5 works on 512 bits at any given time and so the message is padded with extra bits if the entire length of the message is not divisible by 512 bits.
The 512 bits of data is further divided into 4 32 bit words and the real processing takes place on these 4 32bit words.
The MD5 algorithm has been broken on five occasions. The first attempts to break the algorithm were made in 2004 followed by further attempts in 2005, 2006, 2007 and then finally in 2009.
At each level of circumventing the algorithm, MD5 proved to be weaker and weaker and finally it has been announced that MD5 cannot be considered secure for advanced applications like the SSL certificates or digital signatures.
MD5 has been widely used for assuring the integrity of files. MD5 has been also implemented for storing the passwords. This is done by creating a 128 bit hash value of the input password and then stored the file. As the hash value is irreversible, the password cannot be obtained in clear text through reversal of the algorithm.
Due to the recent weakness that was found in MD5, a more secure alternative is being pushed forward which is the SHA-2 algorithm.