Unformatted text preview: its short of being a multiple of 512. This padding is a single 1bit added to the end of the message, followed by as many zeros as are required. Then, a 64bit representation of the message’s length (before padding bits were added) is appended to the result. These two steps serve to make the message length an exact multiple of 512 bits in length (required for the rest of the algorithm), while ensuring that different messages will not look the same after padding. Four 32bit variables are initialized: A = 0x01234567 B = 0x89abcdef C = 0xfedcba98 D = 0x76543210 These are called chaining variables. Now, the main loop of the algorithm begins. This loop continues for as many 512bit blocks as are in the message. The four variables are copied into different variables: a gets A, b gets B, c gets C, and d gets D. The main loop has four rounds (MD4 had only three rounds), all very similar. Each round uses a different operation 16 times. Each operation performs a nonlinear function on three of a, b, c, and d. Then it adds that result to the fourth variable, a subblock of the text and a constant. Then it rotates that result to the right a variable number of bits and adds the result to one of a, b, c, or d. Finally the result replaces one of a, b, c, or d. See Figures 18.5 and 18.6. Figure 18.5 MD5 main loop. There are four nonlinear functions, one used in each operation (a different one for each round). F(X,Y,Z) = (X ¥ Y) ¦ ((¬ X) ¥ Z) G(X,Y,Z) = (X ¥ Z) ¬ (Y (¬ Z)) H(X,Y,Z) = X • Y • Z I(X,Y,Z) = Y • (X ¦ (¬ Z)) (• is XOR,¥ is AND, ¦ is OR, and ¬ is NOT.) These functions are designed so that if the corresponding bits of X, Y, and Z are independent and unbiased, then each bit of the result will also be independent and unbiased. The function F is the bitwise conditional: If X then Y else Z. The function H is the bitwise parity operator. Previous Table of Contents Next Products  Contact Us  About Us  Privacy  Ad Info  Home Use of this site is subject to certain Terms & Conditions, Copyright © 19962000 EarthWeb Inc. All rights res...
View
Full Document
 Fall '10
 ALIULGER
 Cryptography, Bruce Schneier, Applied Cryptography, EarthWeb, Search Search Tips

Click to edit the document details