What is MD5

W

MD5 (Message Digest Algorithm 5) is a unidirectional hash-like cryptographic function that delivers a fixed 128-bit length value. The value calculated using the MD5 function (shortly md5sum) is widely used as a check amount when checking the integrity of the files.

The MD5 algorithm

It is the latest in a series of algorithms designed by Ronald Rivest, a professor at the Massachusetts Institute of Technology (MIT). MD5 was developed in 1990 as a safer replacement of the cryptanalyzed MD4 algorithm by Hans Dobbertin who demonstrated his weaknesses. The MD5 algorithm has an arbitrary length text input and outputs a 128-bit digital fingerprint.
It is desirable that two different messages do not generate the same fingerprint and at the same time, it is not possible to generate a specific message to which a certain well-defined fingerprint is associated. The MD5 algorithm is used in digital signature applications, where a large file must be “signed” in a safe way before being encrypted with a public key algorithm such as RSA.

To calculate the fingerprint of a message, MD5 uses hash functions.
The most important properties (in terms of cryptography) of hash functions are:
1. If two results are different then surely the incoming messages are different
2. On the other hand, the equality of two results does not imply that identical messages were at the entrance.

Algorithms that use dispersion functions are generally used to authenticate messages and must meet the following requirements:
1. Ensure the integrity of the message by searching for a method to verify that it has not been altered or tampered with.
2.Identifier of the sender.
3. Ensure that the sender can not deny sending the message.
4.Rapidity: Authentication is faster than a classic encryption algorithm.
5. Fixed dimension of the result.
6. Ensure the security of the message in case of attempted unauthorized encryption.

Essentially, MD5 is a way to check the integrity of sent data that is much safer than the checksums or other commonly used methods.

Description of the MD5 algorithm:

Step 1
The initial message will be completed with a bit 1 followed by a bit sequence 0 until the bit length of the message is equal to 448 modulo 512. The reason for this type of expansion is that 512 * x + 448 is a multiple of 64 (8 bytes) .

Step 2
The message completed in the previous step is added to the length of the original message in bits. If the message length is greater than 2 ^ 64, only the last 64 bits of the number representing the length of the message will be kept. At this point, the length of the message (in bits) will be multiple of 512 (or 16 words (32 bit)).

Step 3 – Initialize the MD buffer
A 4 word buffer (A, B, C, D) is used to calculate the fingerprint. Note that the buffer length is exactly 128 bits that will be the final length of the MD5 fingerprint.

The four registers will be initialized as follows:
Word A: 01234567
Word B: 89ABCDEF
Word C: FEDCBA98
Word D: 76543210

Step 4
An evaluation function I (X, Y, Y) will be used and will change G (X, Y, Z) as follows:
F (X, Y, Z) = XY in (X) Z (X and Y or not (X) and Z)
G (X, Y, Z) = XZ in Y not (Z)
H (X, Y, Z) = X, or Y, or Z
I (X, Y, Z) = Y xor (X v (Z))

This step will also use a T table constructed using the sinus function, where T [i] will denote the element at position i having the full value equal to sin (i) * 2 ^ 32.
Obs: 2 ^ 32 = 4294967296

In 1996 Dobbertin made known a collision in the compression function of MD5. This is not a proper attack against the MD5 function, but makes all cryptologists propose to replace the MD5 function with safer functions such as SHA-1 or RIPEMD-160. In August 2004, Chinese researchers discovered collisions in the proper MD5 function.
These attacks only demonstrate the existence of collisions in the algorithm. Preimage attacks with this new attack method did not produce results in a realistic timeframe. So a digital certificate created with the MD5 function still can’t be falsified.

About the author

Ilias spiros
By Ilias spiros

Recent Posts

Archives

Categories