You are on page 1of 15

MD-5 Algorithm

V. K. Pachghare

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP) 1
Forerunners in Technical Education
Message Digest
• MD5 algorithm can be used as a digital signature
mechanism.

• Designed by Ronald Rivest (the R in RSA)

• Produces a 128-bit hash value

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
• Takes as input a message of arbitrary length and
produces as output a 128 bit “fingerprint” or “message
digest” of the input.

• It is conjectured that it is computationally infeasible to


produce two messages having the same message digest.

• Intended where a large file must be “compressed” in a


secure manner before being encrypted with a private key
under a public-key cryptosystem such as PGP.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
MD5 Algorithm
• Suppose a k-bit message as input, and that we need to
find its message digest.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
MD5 Overview

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Yq CVq
128

512 A B C D 32

F,T[1..16], X[i] 16 steps

G,T[17..32], X[p2i] 16 steps

H,T[33..48], X[p3i] 16 steps

A B C D

I,T[49..64], X[p4i] 16 steps

+ + + +

128
CVq+1
Department of Computer Engineering and Information Technology
College of Engineering Pune (COEP) 10/6/2015
6
Forerunners in Technical Education
Step 1 – append padded bits:
– The message is padded so that its length is
congruent to 448, modulo 512. Means extended to
just 64 bits that of being of 512 bits long.
– A single “1” bit is appended to the message, and
then “0” bits are appended so that the length in bits
equals 448 modulo 512.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Step 2 – append length:

– A 64 bit representation of K is appended to the

result of the previous step.

– The resulting message has a length that is an exact


multiple of 512 bits.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Step 3 – Initialize MD Buffer
A four-word buffer (A,B,C,D) is used to compute the
message digest.

Here each of A,B,C,D, is a 32 bit register.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Registers A, B, C, D are initialized to the
following values in hexadecimal:

• word A: 01 23 45 67
• word B: 89 ab cd ef
• word C: fe dc ba 98
• word D: 76 54 32 10

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Step 4 – Process message in 16-word blocks.

– Four auxiliary functions that take as input three 32-


bit words and produce as output one 32-bit word.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
There are four possible functions F; a different one is
used in each round:

F(X, Y, Z) = (X AND Y) OR (NOT X AND Z)

G(X, Y, Z) = (X AND Z) OR (Y AND NOT Z)

H(X, Y, Z) = X XOR Y XOR Z

I(X, Y, Z) = Y XOR ( X OR NOT Z)

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
If the bits of X, Y, and Z are independent and unbiased,
the each bit of F(X,Y,Z), G(X,Y,Z), H(X,Y,Z), and I(X,Y,Z)
will be independent and unbiased.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Step 5 – output

– The message digest produced as output is A, B, C, D.


– That is, output begins with the low-order byte of A,
and end with the high-order byte of D.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP)
Forerunners in Technical Education
Conclusions
• A message digest algorithm is a hash function that takes a bit sequence of
any length and produces a bit sequence of a fixed small length.

• The output of a message digest is considered as a digital signature of the


input data.

• MD5 is a message digest algorithm producing 128 bits of data.

• It loops through the original message in blocks of 512 bits, with 4 rounds of
operations for each block, and 16 operations in each round.

Department of Computer Engineering and Information Technology


College of Engineering Pune (COEP) 10/6/2015
15
Forerunners in Technical Education

You might also like