Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

question on MD5 state variables

Tags:

md5

I am studying MD5 algorithm. I found out 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?

like image 848
Moon Avatar asked Nov 13 '09 04:11

Moon


People also ask

What is MD5 explain with example?

What is the MD5 Algorithm? MD5 (Message Digest Method 5) is a cryptographic hash algorithm used to generate a 128-bit digest from a string of any length. It represents the digests as 32 digit hexadecimal numbers. Ronald Rivest designed this algorithm in 1991 to provide the means for digital signature verification.

How padding is done in MD5?

MD5 processes a variable-length message into a fixed-length output of 128 bits. The input message is broken up into chunks of 512-bit blocks (sixteen 32-bit words); the message is padded so that its length is divisible by 512. The padding works as follows: first, a single bit, 1, is appended to the end of the message.

What is MD5 explain MD5 with suitable example?

The MD5 hashing algorithm converts data into a string of 32 characters. For example, the word “frog” always generates this hash: 938c2cc0dcc05f2b68c4287040cfcf71. Similarly, a file of 1.2 GB also generates a hash with the same number of characters.


1 Answers

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.

like image 198
Mark Rushakoff Avatar answered Oct 14 '22 05:10

Mark Rushakoff