Cryptography Tutorials - Tutorial Addendum - Bulletin Abstract - MD5 Algorithm

arcadegamesios strategygamesios adventuregamesios
 31 December 18:00   

    



    



    

(Continued from antecedent part...)

    



    

Step 3. Initializing MD Buffer. MD5 algorithm requires a 128-bit absorber with a specific

    

initial value. The rules of initializing absorber are:

    



        

  • The absorber is disconnected into 4 words (32 $.25 each), called as A, B, C, and D.

        



  •     

  • Word A is initialized to: 0x67452301.

        



  •     

  • Word B is initialized to: 0xEFCDAB89.

        



  •     

  • Word C is initialized to: 0x98BADCFE.

        



  •     

  • Word D is initialized to: 0x10325476.

        



  •     



    



    

Step 4. Processing Bulletin in 512-bit Blocks. This is the capital move of MD 5 algorithm, which

    

loops through the bedlam and added bulletin in blocks of 512 $.25 each. For anniversary ascribe block,

    

4 circuit of operations are performed with 16 operations in anniversary round. This move can be

    

described in the afterward bogus cipher hardly adapted from the RFC 1321 s version:

    

 

    

Input and predefined functions:

    

A, B, C, D: initialized absorber words

    

F(X,Y,Z) = (X AND Y ) OR (NOT X AND Z)

    

G(X,Y,Z) = (X AND Z ) OR (Y AND NOT Z)

    

H(X,Y,Z) = X XOR Y XOR Z

    

I(X,Y,Z) = Y XOR (X OR NOT Z)

    

T: Arrangement of appropriate constants (32-bit integers) as:

    

T = int(abs(sin(i)) * 2**32)

    



    

M: Blocks of the bedlam and added message

    

R1(a,b,c,d,X,s,i): Annular 1 operation authentic as:

    

a = b + ((a + F(b,c,d) + X + T) <<< s)

    

R2(a,b,c,d,X,s,i): Annular 1 operation authentic as:

    

a = b + ((a + G(b,c,d) + X + T) <<< s)

    

R3(a,b,c,d,X,s,i): Annular 1 operation authentic as:

    

a = b + ((a + H(b,c,d) + X + T) <<< s)

    

R4(a,b,c,d,X,s,i): Annular 1 operation authentic as:

    

a = b + ((a + I(b,c,d) + X + T) <<< s)

    

Algorithm:

    

For k = 1 to N do the following

    

AA = A

    

BB = B

    

CC = C

    

DD = D

    

(X, X, ..., X) = M /* Bisect M into 16 words */

    



    

/* Annular 1. Do 16 operations. */

    

R1(A,B,C,D,X, 7, 1)

    

R1(D,A,B,C,X,12, 2)

    

R1(C,D,A,B,X,17, 3)

    

R1(B,C,D,A,X,22, 4)

    

R1(A,B,C,D,X, 7, 5)

    

R1(D,A,B,C,X,12, 6)

    

R1(C,D,A,B,X,17, 7)

    

R1(B,C,D,A,X,22, 8)

    

R1(A,B,C,D,X, 7, 9)

    

R1(D,A,B,C,X,12,10)

    

R1(C,D,A,B,X,17,11)

    

R1(B,C,D,A,X,22,12)

    

R1(A,B,C,D,X, 7,13)

    

R1(D,A,B,C,X,12,14)

    

R1(C,D,A,B,X,17,15)

    

R1(B,C,D,A,X,22,16)

    

/* Annular 2. Do 16 operations. */

    

R2(A,B,C,D,X, 5,17)

    

R2(D,A,B,C,X, 9,18)

    

R2(C,D,A,B,X,14,19)

    

R2(B,C,D,A,X,20,20)

    

R2(A,B,C,D,X, 5,21)

    

R2(D,A,B,C,X, 9,22)

    

R2(C,D,A,B,X,14,23)

    

R2(B,C,D,A,X,20,24)

    

R2(A,B,C,D,X, 5,25)

    

R2(D,A,B,C,X, 9,26)

    

R2(C,D,A,B,X,14,27)

    

R2(B,C,D,A,X,20,28)

    

R2(A,B,C,D,X, 5,29)

    

R2(D,A,B,C,X, 9,30)

    

R2(C,D,A,B,X,14,31)

    

R2(B,C,D,A,X,20,32)

    



    

/* Annular 3. Do 16 operations. */

    

R3(A,B,C,D,X, 4,33)

    

R3(D,A,B,C,X,11,34)

    

R3(C,D,A,B,X,16,35)

    

R3(B,C,D,A,X,23,36)

    

R3(A,B,C,D,X, 4,37)

    

R3(D,A,B,C,X,11,38)

    

R3(C,D,A,B,X,16,39)

    

R3(B,C,D,A,X,23,40)

    

R3(A,B,C,D,X, 4,41)

    

R3(D,A,B,C,X,11,42)

    

R3(C,D,A,B,X,16,43)

    

R3(B,C,D,A,X,23,44)

    

R3(A,B,C,D,X, 4,45)

    

R3(D,A,B,C,X,11,46)

    

R3(C,D,A,B,X,16,47)

    

R3(B,C,D,A,X,23,48)

    

/* Annular 4. Do 16 operations. */

    

R4(A,B,C,D,X, 6,49)

    

R4(D,A,B,C,X,10,50)

    

R4(C,D,A,B,X,15,51)

    

R4(B,C,D,A,X,21,52)

    

R4(A,B,C,D,X, 6,53)

    

R4(D,A,B,C,X,10,54)

    

R4(C,D,A,B,X,15,55)

    

R4(B,C,D,A,X,21,56)

    

R4(A,B,C,D,X, 6,57)

    

R4(D,A,B,C,X,10,58)

    

R4(C,D,A,B,X,15,59)

    

R4(B,C,D,A,X,21,60)

    

R4(A,B,C,D,X, 6,61)

    

R4(D,A,B,C,X,10,62)

    

R4(C,D,A,B,X,15,63)

    

R4(B,C,D,A,X,21,64)

    



    

A = A + AA

    

B = B + BB

    

C = C + CC

    

D = D + DD

    

End of for loop

    



    

Output:

    

A, B, C, D: Bulletin digest

    



    

(Continued on next part...)

    



    



    

 


Tags: words, operation, operations, message, blocks, defined, notes, tutorial, tutorials

 round, operations, message, initialized, buffer, algorithm, defined, operation, digest, words, blocks, , < <, operation defined, md5 algorithm, message digest, notes message digest, tutorial notes message, tutorials tutorial notes, cryptography tutorials tutorial,

Share Cryptography Tutorials - Tutorial Addendum - Bulletin Abstract - MD5 Algorithm:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  crypto