0% found this document useful (0 votes)
2 views8 pages

MD-5 2

MD-5 is a fast hashing algorithm that produces a 128-bit message digest by processing input text in 512-bit blocks. The algorithm involves padding the original message, appending its length, and processing it through four rounds with specific operations on sub-blocks. Each round utilizes chaining variables and constants to compute the final digest output.

Uploaded by

sujalpatil993333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

MD-5 2

MD-5 is a fast hashing algorithm that produces a 128-bit message digest by processing input text in 512-bit blocks. The algorithm involves padding the original message, appending its length, and processing it through four rounds with specific operations on sub-blocks. Each round utilizes chaining variables and constants to compute the final digest output.

Uploaded by

sujalpatil993333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

MD-5

INTRODUCTION
MD-5 is quite fast and produces a 128 bit message digest.
The input text is processed in 512 bit blocks which are further divided into 16 (32
bit sub blocks)
The output of the algorithm is a set of 4 32 bit blocks which make up the 128 bit
message digest.
WORKING OF MD-5
Step 1:Padding
The aim of this step is to make the length of the original message equal to a value
which is 64 bits less than the exact multiple of 512 bits.
Suppose we are given a message of 1000 bits. Now we have to add padding bits
to the original message. Here we will add 472 padding bits to the original
message. After adding the padding bits the size of the original message/output of
the first step will be 1472 i.e. 64 bits less than an exact multiple of 512 (i.e. 512*3
= 1536).
The padding consists of single 1 bit followed by all 0s as required.
Note:Padding bits are always added even if the length is already 64 bits less
than an exact multiple of 512
Step 2: Append Length

After padding bits are added , the next step is to calculate the length of the original
message in terms of 64 bits (2^ 64 ) which is then appended at the end of the
original message + padding.

Original message Padding Length

Data to be hashed

512 bits
Step 3:Divide the input into 512 blocks

Step 4:Initialize the chaining variables:

In this 4 variables called chaining variables are initialized.They are A,B,C,D.

Each of this is a 32 bit number.The initial hexadecimal values of the chaining


variables are as follows:
Step 5:Process blocks

After all the initializations, the real algorithm begins.There is a loop that runs as many
512 bi blocks as follows:

5.1 Copy the four chaining variables into four variables a,b,c,d.

A=a,B=b,C=c,D=d

5.2 Divide the current 512 block into 16 sub blocks.Thus each sub block contains 32 bits

5.3 We have 4 rounds.In each round we process all the 16 sub block belonging to a
block.The inputs to each round are:

a)all the 16 sub blocks

b)the variables a,b,c,d

c)Some constant designated as k


Internal Operations for each round
All the four rounds vary in one major
way

Step 1 of the 4 rounds have different


processing.The other steps on all other
rounds are the same.

In each round we have 16 input sub


blocks named M[0],M[1],....M[15]

Also T is an array of constants.It


contains 64 elements with each
element consisting of 32 bits.We
denote it as K[0],K[1]....K[63]
Internal Operations for each round
A process F is first performed on b,c,d.This process is different in all 4 rounds.

Variable a is added to output of process F.

The message block M[i] is added to the output of step 2.

The constant K[i] is added to the output of step 3

The output of step 4 is circularly left shifted by s bits

Variable b is added to output of step 5


Round 1 Round 3

Round 2

Round 4

You might also like