Cryptography Reference
In-Depth Information
The remainder above is the binary number 11000 (24 in decimal).
4.12.3 MD5
MD5 [12] is a message digest algorithm (so named because it was the fifth in a series). It outputs a 128-bit
number from any number of bits as input (including zero).
MD5 works fairly simply. First, the input is padded so that its length is equal to 448 modulo 512 (meaning it
is 448 + 512 × n bits long, for any integer n greater than or equal to 0). Then, a 64-bit number representing its
length is added to the end of this (or, if the length is more than can be represented in a 64-bit number, then the
lower 64 bits of its length). This is appended as the lower-order 32 bits first, and then the upper 32 bits (i.e., in
LSB order).
MD5 operates on a 128-bit buffer at a time, split into four 32-bit words, A, B, C , and D . Their initial values
are shown in Table 4-6 .
Four functions are used in the MD5 computation, one for each major round:
Table 4-6 Initial Values of MD5 Buffer, in Hexadecimal
A :
01 23 45 67
B :
89 ab cd ef
C :
fe dc ba 98
D :
76 54 32 10
Each of the four portions uses one of these functions 16 times, churning through the data in a fairly twisty
manner. At each step of the 64 steps, an operation is performed using one of the above functions, followed by a
rotation of the bytes:
where F represents the f -function (Steps 0-15), the g -function (Steps 16-31), the h -function (Steps 32-47), and
the i -function (Steps 48-63). The X k -value represents the portion of the message block that we are pulling from.
The T i -value actually represents a value of the sine function, defined to be (from i = 1, ... , 64)
Here, we assume that i is the input to the sine function, in radians. (Recall that 2 π radians is the same as 360 ° .)
Finally, we circularly shift left (or rotate left) by different values at each step, represented by the
operation.
After this, we rotate the values:
 
 
Search WWH ::




Custom Search