question on MD5 state variables
I am studying MD5 algorithm. I found 开发者_如何学Cout that there are four state variables (I am not sure what that means). Those variables are 0x67452301 , 0xEFCDAB89, 0x98BADCFE, and 0x10325476. I converted variables to decimals and came up with 1732584193, 4023233417, 2562383102, and 271733878 resepectively.
my question is, why those numbers? Are they special numbers?
See RFC 1321, section 3.3:
3.3 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. These registers are initialized to the following values in hexadecimal, low-order bytes first):
word A: 01 23 45 67 word B: 89 ab cd ef word C: fe dc ba 98 word D: 76 54 32 10
The numbers they picked are just ascending and descending single hexadecimal digits, in order (which seems to be a delightfully arbitrary set of initial values).
Since they wrote the low-order bytes first, when you write it with the least significant bytes on the right, you get 0x67452301, etc.
精彩评论