The MD5 Message Digest Algorithm

Following is the MD5 message digest algorithm. This page is a summary of the RFC1321 document which describes the MD5 message digest algorithm in detail and also contains a C implemtation of the algorithm. The document can be found here.

The MD5 message digest algorithm strength is theoretically as follows:


We start with our original message which can have a length between 0 and an arbitrarily large number of bits. The length of the message need not be in multiples of 8.

Our message could be written down as follows, where b is the number of bits in the message:

m0m1m2 ... mb-1

The following five steps are performed to produce the digest:

1. Append Padding Bits

2. Append Length

3. Initialize Message Digest Buffer

4. Process the Message in 16-bit Blocks

5. Output

back