MD5
A Hash Algorithm…
MD5
Why HASH?
Fingerprint of message does not tell
anything about the message.
This is because there are infinite other
possible equations which can produce
same result.
Principle Of MD
Easy to Compute
Same message same MD
Difficult to reverse
Different message different MD
Collision
Birthday Paradox for collision detection
History
Series of MD algorithm.
Original message digest algorithm called as MD.
MD2 (1989) for 8 bit PC, rounds18 found to be
quite weak.
MD3 was failure never released.
MD4 (1990) digest length128 bits rounds 3, found
to wantig.
MD5 (1992) we will discuss it in details.
MD6 (2008) variable digest size up to 512 bits &
rounds.
How MD5 Works?
Digest Length=128 bit
I/P Text=512 bit
Sub Block size-32bit
512/32=16 total Sub blocks
No. Of Rounds=4
Iteration per round=16
Chaining Variable = 4*32=128
K[t] constant = Where t=0 to 63
O/P-> four 32 bit blocks
Steps
1. Padding
2. Append length
3. Divide the I/P in 512 bit blocks
4. Initialize chaining variables
5. Process blocks
a) Copying chaining variables into temporary
var.
b) Sub blocks within a block
c) i/p to round temp var,16 bit sub
block ,constant [t]
Step [Link] chaining variables
A 128 bit buffer (4 registers) is used
to hold the intermediate and final
result of the hash function. They are
initialized to the following values:
A = 01234567
B = 89ABCDEF
C = FEDCBA98
D = 76543210
At this point the message is passed in
blocks of 512 bits through the
compression function as seen below:
After all the 512 bit blocks have been processed a 128 bit message digest is
produced, which is a function of all the bits of your message.
The operations of the Functions F, G, H, I can be expressed by the following diagram:
Understanding The Process P
where g can be expressed as:
ROUND 1: (b AND c) OR (b`AND d)
ROUND 2: (b AND d) OR (c AND d`)
ROUND 3: b XOR c XOR d
ROUND 4: c XOR (b OR d`)
MD5 v/s MD4
Point of MD4 MD5
discussion
Number of Rounds 3 4
Use of Additive Same for all the Different for all the
Constant t iteration iteration
Process P Less Random More Random
Security Less More