The MD5
The MD5
2. Append Length Bits: In this step, we add the length bit in the output of
the first step in such a way that the total number of the bits is the perfect
multiple of 512. Simply, here we add the 64-bit as a length bit in the output
of the first step.
i.e. output of first step = 512 * n – 64
length bits = 64.
After adding both we will get 512 * n i.e. the exact multiple of 512.
3. Initialize MD buffer: Here, we use the 4 buffers i.e. A B, C, and D. The
size of each buffer is 32 bits.
- A = 0x67425301
- B = 0xEDFCBA45
- C= 0x98CBADFE
- D = 0x13DCE476
4. Process Each 512-bit Block: This is the most important step of the
MD5 algorithm. Here, a total of 64 operations are performed in 4 rounds.
In the 1st round, 16 operations will be performed, 2nd round 16 operations
will be performed, 3rd round 16 operations will be performed, and in the
4th round, 16 operations will be performed. We apply a different function
on each round i.e. for the 1st round we apply the F function, for the 2nd G
function, 3rd for the H function, and 4th for the I function.
We perform OR, AND, XOR, and NOT (basically these are logic gates) for
calculating functions. We use 3 buffers for each function i.e. B, C, D.
After applying the function now we perform an operation on each block.
For performing operations we need