MD5 Algorithm
MD5 Algorithm
Step 2: Add a 1 to the end of the converted message, then add zeros until it reach 448 mod 512 bits
long
Add 1 to the end: 01100001 00100000 01100110 01101111 01111000 1 (41 bit)
We want the message to consist of a length of a number that mod 512 = 448. So we add 407 zeros (0) to the end
of the message. The message becomes:
Step 3: Convert the length of the initial message to a 64-bit value, then added to the end of the
padded message to create a multiply-of-512-bit-long message.
The length of the initial message (40 bits) is convert to binary in form of a 64-bit length then added to the
message. 40 (DEC)= 101000 (BIN).
So the added message is 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00101000.
Round 3: H(B, C, D) =B ⊕ C ⊕ D
Round 1 Operation 1:
3. Compute modular addition (M0 + (A + F(B, C, D)) mod 232) mod 232
(M0 + (A + F(B, C, D)) mod 232) mod 232 = 6120666e (HEX) = 1629513326 (DEC)
4. Compute (K1 + ((M0 + (A + F(B, C, D)) mod 232) mod 232)) mod 232
(K1 + ((M0 + (A + F(B, C, D)) mod 232) mod 232)) = (3614090360 + 1629513326) = 5243603686
(K1 + ((M0 + (A + F(B, C, D)) mod 232) mod 232)) mod 232 = 388B0AE6 (HEX) = 948636390 (DEC)
Base on the operation is being taken, the previous result from step 4 will be converted to binary then shifted 7
spaces to the left
A = D = 76543210 (HEX)
C = B = 89abcdef (HEX)
D = C = fedcba98 (HEX)