MD5 algorithm is basically used for finding the message digest. Basically what happens in MD5 algorithm is that every message is padded into blocks of 512bits each. There are basically 4 rounds of 16 operations each, which implies that in total we perform 64 operations in each block and the output of every block, is fed into the subsequent block. And again the process continues till the last block. The output of the last block is our message digest.
There are 5 prominent steps in the working of the MD5 Algorithm. They are,
Initially, when we get the message, it can be of any size say 5000bits, 12345bits, etc. For this message, we add some more bits, which are known as padding bits. And the thing to keep in mind is that bits are added in such a way that, the resultant total number of bits must be 64 bits short from becoming the multiple of 512. And when it comes to padding, we add 1 at the beginning and the rest 0’s.
In this step instead of padding bits, we add the length bits. Initially, in first step, we appended the message in such a way that the total number of bits in the message was 64bits short from becoming the multiple of 512. Now we add the length bits in such a way that the total number of bits in the message is perfectly the multiple of 512. That means 64bits; length bits to be precise are added to the message.
In this step, we use 4 buffers of 32 bits each. Let’s name this buffer as A, B, C and D respectively. The use of these buffers will be known in the coming steps. The buffers are to be initialised in this step. The way in which we initialize is given below
A = 0, 1, 2, 3, 4, 5, 6, 7Â
B = 8, 9, a, b, c, d, e, f
C = f, e, d, c, b, a, 9, 8
D = 7, 6, 5, 4, 3, 2, 1, 0
Previously it was said that there will be 64 processes, divided into 4 rounds of 16 processes. We use 4 different functions for 4 different rounds. The functions used here F, G, H and I respectively.
In the previous step, we had initialised the buffers namely A, B, C, and D. After the round operation, the output will also be A1, B1, C1, and D1.
The output of B will be fed into C1, C into D1, and D into A1. A will also be fed into B1 but after some process.
First, the output of B, C, and D are taken and the F function is applied to them. We will do the addition modulo by 232 bits for the output of this with A. For this, we add the 32 bits message and again we do the addition modulo by 232Â bits. Then we add a 32 bit constant to the output and once again addition modulo by 32bits. At last, we do left shift by s (s can be any value) and addition modulo by 232.
The result of this will be fed to b1. Thus we got the output for all 4 buffers. This is one operation by using F function. There will be a total of 16 operations by using F function, and then 16 operations by using G, H and I functions to make it 64 in all.
The output we get here will be the starting block of the next 512 bit block.
This process goes on till the last block of 512 bit is processed. The output of the last 512 bit block is ultimately our message digest. The outputs we get are the blocks of 32 bit. So that makes 4 blocks of 32 bits, which ultimately means 128 bit output. So here we feed 512 bit and get 128 bit as our output.
Though there are disadvantages in using MD5 algorithm, we should also focus on the merits by the use of this algorithm. This is indeed faster and easier to use. And many developments are on its way.
So, have you made up your mind to make a career in Cyber Security? Visit our Master Certificate in Cyber Security (Red Team) for further help. It is the first program in offensive technologies in India and allows learners to practice in a real-time simulated ecosystem, that will give them an edge in this competitive world.
Fill in the details to know more
What Is Asset Classification?
March 20, 2023
Masquerade Attack – Everything You Need To Know!
February 27, 2023
Best Infosys Information Security Engineer Interview Questions and Answers
What Are SOC and NOC In Cyber Security? What’s the Difference?
A Brief Introduction to Cyber Security Analytics
February 26, 2023
Cyber Safe Behaviour In Banking Systems
February 17, 2023
Add your details:
By proceeding, you agree to our privacy policy and also agree to receive information from UNext through WhatsApp & other means of communication.
Upgrade your inbox with our curated newletters once every month. We appreciate your support and will make sure to keep your subscription worthwhile