MD5 Generation - PowerPoint PPT Presentation

About This Presentation
Title:

MD5 Generation

Description:

MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen MD5 Generation Iteration 1: Step 59 a = d, d = c, c = b, b = previous resulting ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 76
Provided by: oneo154
Category:

less

Transcript and Presenter's Notes

Title: MD5 Generation


1
MD5 Generation
  • Auto-Generated Slides To Visualize MD5 Hash
    Generation by Chris Fremgen

2
MD5 Hashing Summary
  • MD5 is a function used in cryptography to ensure
    data integrity.
  • The idea of hashing is to create a unique code
    for a set of data through the use of functions.
  • It was created by Ronald Rivest in 1991 and each
    message digest is 128 bits long.
  • You can find more details in RFC 1321.
  • There are two main steps in generating an MD5
    digest. Pre-processing of data, and hash
    generation.

3
MD5 Data Preprocessing
  • Preprocessing
  • First we need two unsigned integer arrays with
    64 items in each.
  • Lets use 'r' for the rotational array and 'k'
    for the constant array
  • r 0..15 7, 12, 17, 22, 7, 12, 17, 22, 7,
    12, 17, 22, 7, 12, 17, 22
  • r16..31 5, 9, 14, 20, 5, 9, 14, 20, 5,
    9, 14, 20, 5, 9, 14, 20
  • r32..47 4, 11, 16, 23, 4, 11, 16, 23, 4,
    11, 16, 23, 4, 11, 16, 23
  • r48..63 6, 10, 15, 21, 6, 10, 15, 21, 6,
    10, 15, 21, 6, 10, 15, 21
  • Use the following formula to generate the
    constants
  • for i from 0 to 63
  • ki floor(abs(sin(i 1)) (2 pow 32))
  • We also need 4 constant variables to start bit
    shifting
  • (these are arbitrary but need to be the same in
    all MD5 generators)
  • var int h0 0x67452301
  • var int h1 0xEFCDAB89
  • var int h2 0x98BADCFE
  • var int h3 0x10325476

4
MD5 Pseudo code
  • For each 512-bit chunk of message
  • break chunk into sixteen 32-bit little-endian
    words wi for(i0ilt15i)
  • / Initialize hash value for this chunk (recall
    h0,h1,h2,h3 were declared as constants earlier)
    /
  • var int a h0
  • var int b h1
  • var int c h2
  • var int d h3
  • / Main loop /
  • / Here are the logic functions that define this
    algorithm /
  • for i from 0 to 63
  • if 0 i 15 then
  • f (b and c) or ((not b) and d)
  • g i
  • else if 16 i 31
  • f (d and b) or ((not d) and c)
  • g (5i 1) mod 16
  • else if 32 i 47
  • f b xor c xor d
  • g (3i 5) mod 16

5
MD5 Generation From User Input
  • User Input String 'sfgsdfgdfgd'
  • User Input Bytes 115 102 103 115 100 102 103 100
    102 103 100

6
MD5 Generation From User Input
  • After Pre-Processing of data, Message Bytes 115
    102 103 115 100 102 103 100 102 103 100 128 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0
  • There will be 1 iteration(s) since the padded
    message size is 512 bits long

7
MD5 Generation
  • Now we continue to crank through the 4 logic
    functions provided in the RFC
  • Before we start the process the constant
    variables are as follows
  • h0 1732584193
  • h1 4023233417
  • h2 2562383102
  • h3 271733878

8
MD5 Generation
  • Iteration 1 Step 1
  • a d, d c, c b, b previous resulting value
  • a (1732584193)01100111010001010010001100000001
  • b (4023233417)11101111110011011010101110001001
  • c (2562383102)10011000101110101101110011111110
  • d (271733878)00010000001100100101010001110110
  • Data Block (1936156275)01110011011001110110011001
    110011
  • R Constant (7)00000000000000000000000000000111
  • Sin Value (3614090360)110101110110101010100100011
    11000
  • Logic Function (1732584193)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1490231470)010110001101001
    10010000010101110

9
MD5 Generation
  • Iteration 1 Step 2
  • a d, d c, c b, b previous resulting value
  • a (271733878)00010000001100100101010001110110
  • b (1490231470)01011000110100110010000010101110
  • c (4023233417)11101111110011011010101110001001
  • d (2562383102)10011000101110101101110011111110
  • Data Block (1684498020)01100100011001110110011001
    100100
  • R Constant (12)00000000000000000000000000001100
  • Sin Value (3905402710)111010001100011110110111010
    10110
  • Logic Function (271733878)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (264479506)0000111111000011
    1010001100010010

10
MD5 Generation
  • Iteration 1 Step 3
  • a d, d c, c b, b previous resulting value
  • a (2562383102)10011000101110101101110011111110
  • b (264479506)00001111110000111010001100010010
  • c (1490231470)01011000110100110010000010101110
  • d (4023233417)11101111110011011010101110001001
  • Data Block (2154063718)10000000011001000110011101
    100110
  • R Constant (17)00000000000000000000000000010001
  • Sin Value (606105819)0010010000100000011100001101
    1011
  • Logic Function (2562383102)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3411537711)110010110101011
    11110111100101111

11
MD5 Generation
  • Iteration 1 Step 4
  • a d, d c, c b, b previous resulting value
  • a (4023233417)11101111110011011010101110001001
  • b (3411537711)11001011010101111110111100101111
  • c (264479506)00001111110000111010001100010010
  • d (1490231470)01011000110100110010000010101110
  • Data Block (0)00000000000000000000000000000000
  • R Constant (22)00000000000000000000000000010110
  • Sin Value (3250441966)110000011011110111001110111
    01110
  • Logic Function (4023233417)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1238057718)010010011100101
    10100001011110110

12
MD5 Generation
  • Iteration 1 Step 5
  • a d, d c, c b, b previous resulting value
  • a (1490231470)01011000110100110010000010101110
  • b (1238057718)01001001110010110100001011110110
  • c (3411537711)11001011010101111110111100101111
  • d (264479506)00001111110000111010001100010010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (7)00000000000000000000000000000111
  • Sin Value (4118548399)111101010111110000001111101
    01111
  • Logic Function (1490231470)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (324338884)0001001101010101
    0000010011000100

13
MD5 Generation
  • Iteration 1 Step 6
  • a d, d c, c b, b previous resulting value
  • a (264479506)00001111110000111010001100010010
  • b (324338884)00010011010101010000010011000100
  • c (1238057718)01001001110010110100001011110110
  • d (3411537711)11001011010101111110111100101111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (12)00000000000000000000000000001100
  • Sin Value (1200080426)010001111000011111000110001
    01010
  • Logic Function (264479506)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (145209036)0000100010100111
    1011011011001100

14
MD5 Generation
  • Iteration 1 Step 7
  • a d, d c, c b, b previous resulting value
  • a (3411537711)11001011010101111110111100101111
  • b (145209036)00001000101001111011011011001100
  • c (324338884)00010011010101010000010011000100
  • d (1238057718)01001001110010110100001011110110
  • Data Block (0)00000000000000000000000000000000
  • R Constant (17)00000000000000000000000000010001
  • Sin Value (2821735955)101010000011000001000110000
    10011
  • Logic Function (3411537711)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (4246282358)111111010001100
    10010000001110110

15
MD5 Generation
  • Iteration 1 Step 8
  • a d, d c, c b, b previous resulting value
  • a (1238057718)01001001110010110100001011110110
  • b (4246282358)11111101000110010010000001110110
  • c (145209036)00001000101001111011011011001100
  • d (324338884)00010011010101010000010011000100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (22)00000000000000000000000000010110
  • Sin Value (4249261313)111111010100011010010101000
    00001
  • Logic Function (1238057718)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (736982581)0010101111101101
    0111011000110101

16
MD5 Generation
  • Iteration 1 Step 9
  • a d, d c, c b, b previous resulting value
  • a (324338884)00010011010101010000010011000100
  • b (736982581)00101011111011010111011000110101
  • c (4246282358)11111101000110010010000001110110
  • d (145209036)00001000101001111011011011001100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (7)00000000000000000000000000000111
  • Sin Value (1770035416)011010011000000010011000110
    11000
  • Logic Function (324338884)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (478986887)0001110010001100
    1100001010000111

17
MD5 Generation
  • Iteration 1 Step 10
  • a d, d c, c b, b previous resulting value
  • a (145209036)00001000101001111011011011001100
  • b (478986887)00011100100011001100001010000111
  • c (736982581)00101011111011010111011000110101
  • d (4246282358)11111101000110010010000001110110
  • Data Block (0)00000000000000000000000000000000
  • R Constant (12)00000000000000000000000000001100
  • Sin Value (2336552879)100010110100010011110111101
    01111
  • Logic Function (145209036)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3181103711)101111011001101
    11100101001011111

18
MD5 Generation
  • Iteration 1 Step 11
  • a d, d c, c b, b previous resulting value
  • a (4246282358)11111101000110010010000001110110
  • b (3181103711)10111101100110111100101001011111
  • c (478986887)00011100100011001100001010000111
  • d (736982581)00101011111011010111011000110101
  • Data Block (0)00000000000000000000000000000000
  • R Constant (17)00000000000000000000000000010001
  • Sin Value (4294925233)111111111111111101011011101
    10001
  • Logic Function (4246282358)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2721579625)101000100011100
    00000001001101001

19
MD5 Generation
  • Iteration 1 Step 12
  • a d, d c, c b, b previous resulting value
  • a (736982581)00101011111011010111011000110101
  • b (2721579625)10100010001110000000001001101001
  • c (3181103711)10111101100110111100101001011111
  • d (478986887)00011100100011001100001010000111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (22)00000000000000000000000000010110
  • Sin Value (2304563134)100010010101110011010111101
    11110
  • Logic Function (736982581)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3537140781)110100101101010
    00111110000101101

20
MD5 Generation
  • Iteration 1 Step 13
  • a d, d c, c b, b previous resulting value
  • a (478986887)00011100100011001100001010000111
  • b (3537140781)11010010110101000111110000101101
  • c (2721579625)10100010001110000000001001101001
  • d (3181103711)10111101100110111100101001011111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (7)00000000000000000000000000000111
  • Sin Value (1804603682)011010111001000000010001001
    00010
  • Logic Function (478986887)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1862241864)011011101111111
    11000111001001000

21
MD5 Generation
  • Iteration 1 Step 14
  • a d, d c, c b, b previous resulting value
  • a (3181103711)10111101100110111100101001011111
  • b (1862241864)01101110111111111000111001001000
  • c (3537140781)11010010110101000111110000101101
  • d (2721579625)10100010001110000000001001101001
  • Data Block (0)00000000000000000000000000000000
  • R Constant (12)00000000000000000000000000001100
  • Sin Value (4254626195)111111011001100001110001100
    10011
  • Logic Function (3181103711)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (4085335592)111100111000000
    10100011000101000

22
MD5 Generation
  • Iteration 1 Step 15
  • a d, d c, c b, b previous resulting value
  • a (2721579625)10100010001110000000001001101001
  • b (4085335592)11110011100000010100011000101000
  • c (1862241864)01101110111111111000111001001000
  • d (3537140781)11010010110101000111110000101101
  • Data Block (88)00000000000000000000000001011000
  • R Constant (17)00000000000000000000000000010001
  • Sin Value (2792965006)101001100111100101000011100
    01110
  • Logic Function (2721579625)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (4231699765)111111000011101
    01001110100110101

23
MD5 Generation
  • Iteration 1 Step 16
  • a d, d c, c b, b previous resulting value
  • a (3537140781)11010010110101000111110000101101
  • b (4231699765)11111100001110101001110100110101
  • c (4085335592)11110011100000010100011000101000
  • d (1862241864)01101110111111111000111001001000
  • Data Block (0)00000000000000000000000000000000
  • R Constant (22)00000000000000000000000000010110
  • Sin Value (1236535329)010010011011010000001000001
    00001
  • Logic Function (3537140781)int result b
    RotateLeft((a (b c) (b d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2847830167)101010011011111
    00111000010010111

24
MD5 Generation
  • Iteration 1 Step 17
  • a d, d c, c b, b previous resulting value
  • a (1862241864)01101110111111111000111001001000
  • b (2847830167)10101001101111100111000010010111
  • c (4231699765)11111100001110101001110100110101
  • d (4085335592)11110011100000010100011000101000
  • Data Block (1684498020)01100100011001110110011001
    100100
  • R Constant (5)00000000000000000000000000000101
  • Sin Value (4129170786)111101100001111000100101011
    00010
  • Logic Function (1862241864)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2445071621)100100011011110
    01101010100000101

25
MD5 Generation
  • Iteration 1 Step 18
  • a d, d c, c b, b previous resulting value
  • a (4085335592)11110011100000010100011000101000
  • b (2445071621)10010001101111001101010100000101
  • c (2847830167)10101001101111100111000010010111
  • d (4231699765)11111100001110101001110100110101
  • Data Block (0)00000000000000000000000000000000
  • R Constant (9)00000000000000000000000000001001
  • Sin Value (3225465664)110000000100000010110011010
    00000
  • Logic Function (4085335592)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2409280399)100011111001101
    01011001110001111

26
MD5 Generation
  • Iteration 1 Step 19
  • a d, d c, c b, b previous resulting value
  • a (4231699765)11111100001110101001110100110101
  • b (2409280399)10001111100110101011001110001111
  • c (2445071621)10010001101111001101010100000101
  • d (2847830167)10101001101111100111000010010111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (14)00000000000000000000000000001110
  • Sin Value (643717713)0010011001011110010110100101
    0001
  • Logic Function (4231699765)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2061378203)011110101101111
    00010001010011011

27
MD5 Generation
  • Iteration 1 Step 20
  • a d, d c, c b, b previous resulting value
  • a (2847830167)10101001101111100111000010010111
  • b (2061378203)01111010110111100010001010011011
  • c (2409280399)10001111100110101011001110001111
  • d (2445071621)10010001101111001101010100000101
  • Data Block (1936156275)01110011011001110110011001
    110011
  • R Constant (20)00000000000000000000000000010100
  • Sin Value (3921069994)111010011011011011000111101
    01010
  • Logic Function (2847830167)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2396027463)100011101101000
    00111101001000111

28
MD5 Generation
  • Iteration 1 Step 21
  • a d, d c, c b, b previous resulting value
  • a (2445071621)10010001101111001101010100000101
  • b (2396027463)10001110110100000111101001000111
  • c (2061378203)01111010110111100010001010011011
  • d (2409280399)10001111100110101011001110001111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (5)00000000000000000000000000000101
  • Sin Value (3593408605)110101100010111100010000010
    11101
  • Logic Function (2445071621)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1725131123)011001101101001
    10110100101110011

29
MD5 Generation
  • Iteration 1 Step 22
  • a d, d c, c b, b previous resulting value
  • a (2409280399)10001111100110101011001110001111
  • b (1725131123)01100110110100110110100101110011
  • c (2396027463)10001110110100000111101001000111
  • d (2061378203)01111010110111100010001010011011
  • Data Block (0)00000000000000000000000000000000
  • R Constant (9)00000000000000000000000000001001
  • Sin Value (38016083)00000010010001000001010001010
    011
  • Logic Function (2409280399)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3377716324)110010010101001
    11101110001100100

30
MD5 Generation
  • Iteration 1 Step 23
  • a d, d c, c b, b previous resulting value
  • a (2061378203)01111010110111100010001010011011
  • b (3377716324)11001001010100111101110001100100
  • c (1725131123)01100110110100110110100101110011
  • d (2396027463)10001110110100000111101001000111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (14)00000000000000000000000000001110
  • Sin Value (3634488961)110110001010000111100110100
    00001
  • Logic Function (2061378203)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2717379416)101000011111011
    11110101101011000

31
MD5 Generation
  • Iteration 1 Step 24
  • a d, d c, c b, b previous resulting value
  • a (2396027463)10001110110100000111101001000111
  • b (2717379416)10100001111101111110101101011000
  • c (3377716324)11001001010100111101110001100100
  • d (1725131123)01100110110100110110100101110011
  • Data Block (0)00000000000000000000000000000000
  • R Constant (20)00000000000000000000000000010100
  • Sin Value (3889429448)111001111101001111111011110
    01000
  • Logic Function (2396027463)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3626627807)110110000010100
    11111001011011111

32
MD5 Generation
  • Iteration 1 Step 25
  • a d, d c, c b, b previous resulting value
  • a (1725131123)01100110110100110110100101110011
  • b (3626627807)11011000001010011111001011011111
  • c (2717379416)10100001111101111110101101011000
  • d (3377716324)11001001010100111101110001100100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (5)00000000000000000000000000000101
  • Sin Value (568446438)0010000111100001110011011110
    0110
  • Logic Function (1725131123)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (59722125)00000011100011110
    100100110001101

33
MD5 Generation
  • Iteration 1 Step 26
  • a d, d c, c b, b previous resulting value
  • a (3377716324)11001001010100111101110001100100
  • b (59722125)00000011100011110100100110001101
  • c (3626627807)11011000001010011111001011011111
  • d (2717379416)10100001111101111110101101011000
  • Data Block (88)00000000000000000000000001011000
  • R Constant (9)00000000000000000000000000001001
  • Sin Value (3275163606)110000110011011100000111110
    10110
  • Logic Function (3377716324)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (940281177)0011100000001011
    1000110101011001

34
MD5 Generation
  • Iteration 1 Step 27
  • a d, d c, c b, b previous resulting value
  • a (2717379416)10100001111101111110101101011000
  • b (940281177)00111000000010111000110101011001
  • c (59722125)00000011100011110100100110001101
  • d (3626627807)11011000001010011111001011011111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (14)00000000000000000000000000001110
  • Sin Value (4107603335)111101001101010100001101100
    00111
  • Logic Function (2717379416)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1486469616)010110001001100
    11011100111110000

35
MD5 Generation
  • Iteration 1 Step 28
  • a d, d c, c b, b previous resulting value
  • a (3626627807)11011000001010011111001011011111
  • b (1486469616)01011000100110011011100111110000
  • c (940281177)00111000000010111000110101011001
  • d (59722125)00000011100011110100100110001101
  • Data Block (0)00000000000000000000000000000000
  • R Constant (20)00000000000000000000000000010100
  • Sin Value (1163531501)010001010101101000010100111
    01101
  • Logic Function (3626627807)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2992577225)101100100101111
    10001101011001001

36
MD5 Generation
  • Iteration 1 Step 29
  • a d, d c, c b, b previous resulting value
  • a (59722125)00000011100011110100100110001101
  • b (2992577225)10110010010111110001101011001001
  • c (1486469616)01011000100110011011100111110000
  • d (940281177)00111000000010111000110101011001
  • Data Block (0)00000000000000000000000000000000
  • R Constant (5)00000000000000000000000000000101
  • Sin Value (2850285829)101010011110001111101001000
    00101
  • Logic Function (59722125)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (1949076012)011101000010110
    01000101000101100

37
MD5 Generation
  • Iteration 1 Step 30
  • a d, d c, c b, b previous resulting value
  • a (940281177)00111000000010111000110101011001
  • b (1949076012)01110100001011001000101000101100
  • c (2992577225)10110010010111110001101011001001
  • d (1486469616)01011000100110011011100111110000
  • Data Block (2154063718)10000000011001000110011101
    100110
  • R Constant (9)00000000000000000000000000001001
  • Sin Value (4243563512)111111001110111110100011111
    11000
  • Logic Function (940281177)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (3497151355)110100000111001
    00100101101111011

38
MD5 Generation
  • Iteration 1 Step 31
  • a d, d c, c b, b previous resulting value
  • a (1486469616)01011000100110011011100111110000
  • b (3497151355)11010000011100100100101101111011
  • c (1949076012)01110100001011001000101000101100
  • d (2992577225)10110010010111110001101011001001
  • Data Block (0)00000000000000000000000000000000
  • R Constant (14)00000000000000000000000000001110
  • Sin Value (1735328473)011001110110111100000010110
    11001
  • Logic Function (1486469616)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (2722099353)101000100011111
    11111000010011001

39
MD5 Generation
  • Iteration 1 Step 32
  • a d, d c, c b, b previous resulting value
  • a (2992577225)10110010010111110001101011001001
  • b (2722099353)10100010001111111111000010011001
  • c (3497151355)11010000011100100100101101111011
  • d (1949076012)01110100001011001000101000101100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (20)00000000000000000000000000010100
  • Sin Value (2368359562)100011010010101001001100100
    01010
  • Logic Function (2992577225)int result b
    RotateLeft((a ((b d) (c d)) DataBlock
    SinValue), R Constant)
  • Result after shifting (757985563)0010110100101101
    1111000100011011

40
MD5 Generation
  • Iteration 1 Step 33
  • a d, d c, c b, b previous resulting value
  • a (1949076012)01110100001011001000101000101100
  • b (757985563)00101101001011011111000100011011
  • c (2722099353)10100010001111111111000010011001
  • d (3497151355)11010000011100100100101101111011
  • Data Block (0)00000000000000000000000000000000
  • R Constant (4)00000000000000000000000000000100
  • Sin Value (4294588738)111111111111101000111001010
    00010
  • Logic Function (1949076012)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (1704908696)011001011001111
    01101011110011000

41
MD5 Generation
  • Iteration 1 Step 34
  • a d, d c, c b, b previous resulting value
  • a (3497151355)11010000011100100100101101111011
  • b (1704908696)01100101100111101101011110011000
  • c (757985563)00101101001011011111000100011011
  • d (2722099353)10100010001111111111000010011001
  • Data Block (0)00000000000000000000000000000000
  • R Constant (11)00000000000000000000000000001011
  • Sin Value (2272392833)100001110111000111110110100
    00001
  • Logic Function (3497151355)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3999238571)111011100101111
    11000100110101011

42
MD5 Generation
  • Iteration 1 Step 35
  • a d, d c, c b, b previous resulting value
  • a (2722099353)10100010001111111111000010011001
  • b (3999238571)11101110010111111000100110101011
  • c (1704908696)01100101100111101101011110011000
  • d (757985563)00101101001011011111000100011011
  • Data Block (0)00000000000000000000000000000000
  • R Constant (16)00000000000000000000000000010000
  • Sin Value (1839030562)011011011001110101100001001
    00010
  • Logic Function (2722099353)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (4014162037)111011110100001
    10100000001110101

43
MD5 Generation
  • Iteration 1 Step 36
  • a d, d c, c b, b previous resulting value
  • a (757985563)00101101001011011111000100011011
  • b (4014162037)11101111010000110100000001110101
  • c (3999238571)11101110010111111000100110101011
  • d (1704908696)01100101100111101101011110011000
  • Data Block (88)00000000000000000000000001011000
  • R Constant (23)00000000000000000000000000010111
  • Sin Value (4259657740)111111011110010100111000000
    01100
  • Logic Function (757985563)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3523939096)110100100000101
    10000101100011000

44
MD5 Generation
  • Iteration 1 Step 37
  • a d, d c, c b, b previous resulting value
  • a (1704908696)01100101100111101101011110011000
  • b (3523939096)11010010000010110000101100011000
  • c (4014162037)11101111010000110100000001110101
  • d (3999238571)11101110010111111000100110101011
  • Data Block (1684498020)01100100011001110110011001
    100100
  • R Constant (4)00000000000000000000000000000100
  • Sin Value (2763975236)101001001011111011101010010
    00100
  • Logic Function (1704908696)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (4024023932)111011111101100
    11011101101111100

45
MD5 Generation
  • Iteration 1 Step 38
  • a d, d c, c b, b previous resulting value
  • a (3999238571)11101110010111111000100110101011
  • b (4024023932)11101111110110011011101101111100
  • c (3523939096)11010010000010110000101100011000
  • d (4014162037)11101111010000110100000001110101
  • Data Block (0)00000000000000000000000000000000
  • R Constant (11)00000000000000000000000000001011
  • Sin Value (1272893353)010010111101111011001111101
    01001
  • Logic Function (3999238571)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (1915020258)011100100010010
    01110001111100010

46
MD5 Generation
  • Iteration 1 Step 39
  • a d, d c, c b, b previous resulting value
  • a (4014162037)11101111010000110100000001110101
  • b (1915020258)01110010001001001110001111100010
  • c (4024023932)11101111110110011011101101111100
  • d (3523939096)11010010000010110000101100011000
  • Data Block (0)00000000000000000000000000000000
  • R Constant (16)00000000000000000000000000010000
  • Sin Value (4139469664)111101101011101101001011011
    00000
  • Logic Function (4014162037)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (1367349718)010100011000000
    00001100111010110

47
MD5 Generation
  • Iteration 1 Step 40
  • a d, d c, c b, b previous resulting value
  • a (3523939096)11010010000010110000101100011000
  • b (1367349718)01010001100000000001100111010110
  • c (1915020258)01110010001001001110001111100010
  • d (4024023932)11101111110110011011101101111100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (23)00000000000000000000000000010111
  • Sin Value (3200236656)101111101011111110111100011
    10000
  • Logic Function (3523939096)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3115236826)101110011010111
    01011110111011010

48
MD5 Generation
  • Iteration 1 Step 41
  • a d, d c, c b, b previous resulting value
  • a (4024023932)11101111110110011011101101111100
  • b (3115236826)10111001101011101011110111011010
  • c (1367349718)01010001100000000001100111010110
  • d (1915020258)01110010001001001110001111100010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (4)00000000000000000000000000000100
  • Sin Value (681279174)0010100010011011011111101100
    0110
  • Logic Function (4024023932)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3785810149)111000011010011
    01110000011100101

49
MD5 Generation
  • Iteration 1 Step 42
  • a d, d c, c b, b previous resulting value
  • a (1915020258)01110010001001001110001111100010
  • b (3785810149)11100001101001101110000011100101
  • c (3115236826)10111001101011101011110111011010
  • d (1367349718)01010001100000000001100111010110
  • Data Block (1936156275)01110011011001110110011001
    110011
  • R Constant (11)00000000000000000000000000001011
  • Sin Value (3936430074)111010101010000100100111111
    11010
  • Logic Function (1915020258)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (2405476274)100011110110000
    01010011110110010

50
MD5 Generation
  • Iteration 1 Step 43
  • a d, d c, c b, b previous resulting value
  • a (1367349718)01010001100000000001100111010110
  • b (2405476274)10001111011000001010011110110010
  • c (3785810149)11100001101001101110000011100101
  • d (3115236826)10111001101011101011110111011010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (16)00000000000000000000000000010000
  • Sin Value (3572445317)110101001110111100110000100
    00101
  • Logic Function (1367349718)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3561596298)110101000100100
    11010010110001010

51
MD5 Generation
  • Iteration 1 Step 44
  • a d, d c, c b, b previous resulting value
  • a (3115236826)10111001101011101011110111011010
  • b (3561596298)11010100010010011010010110001010
  • c (2405476274)10001111011000001010011110110010
  • d (3785810149)11100001101001101110000011100101
  • Data Block (0)00000000000000000000000000000000
  • R Constant (23)00000000000000000000000000010111
  • Sin Value (76029189)00000100100010000001110100000
    101
  • Logic Function (3115236826)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (2995128552)101100101000011
    00000100011101000

52
MD5 Generation
  • Iteration 1 Step 45
  • a d, d c, c b, b previous resulting value
  • a (3785810149)11100001101001101110000011100101
  • b (2995128552)10110010100001100000100011101000
  • c (3561596298)11010100010010011010010110001010
  • d (2405476274)10001111011000001010011110110010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (4)00000000000000000000000000000100
  • Sin Value (3654602809)110110011101010011010000001
    11001
  • Logic Function (3785810149)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (87148498)00000101001100011
    100011111010010

53
MD5 Generation
  • Iteration 1 Step 46
  • a d, d c, c b, b previous resulting value
  • a (2405476274)10001111011000001010011110110010
  • b (87148498)00000101001100011100011111010010
  • c (2995128552)10110010100001100000100011101000
  • d (3561596298)11010100010010011010010110001010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (11)00000000000000000000000000001011
  • Sin Value (3873151461)111001101101101110011001111
    00101
  • Logic Function (2405476274)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3667134115)110110101001010
    00000011010100011

54
MD5 Generation
  • Iteration 1 Step 47
  • a d, d c, c b, b previous resulting value
  • a (3561596298)11010100010010011010010110001010
  • b (3667134115)11011010100101000000011010100011
  • c (87148498)00000101001100011100011111010010
  • d (2995128552)10110010100001100000100011101000
  • Data Block (0)00000000000000000000000000000000
  • R Constant (16)00000000000000000000000000010000
  • Sin Value (530742520)0001111110100010011111001111
    1000
  • Logic Function (3561596298)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (3333384114)110001101010111
    10110011110110010

55
MD5 Generation
  • Iteration 1 Step 48
  • a d, d c, c b, b previous resulting value
  • a (2995128552)10110010100001100000100011101000
  • b (3333384114)11000110101011110110011110110010
  • c (3667134115)11011010100101000000011010100011
  • d (87148498)00000101001100011100011111010010
  • Data Block (2154063718)10000000011001000110011101
    100110
  • R Constant (23)00000000000000000000000000010111
  • Sin Value (3299628645)110001001010110001010110011
    00101
  • Logic Function (2995128552)int result b
    RotateLeft((a (b c d) DataBlock
    SinValue), R Constant)
  • Result after shifting (2176301160)100000011011011
    11011100001101000

56
MD5 Generation
  • Iteration 1 Step 49
  • a d, d c, c b, b previous resulting value
  • a (87148498)00000101001100011100011111010010
  • b (2176301160)10000001101101111011100001101000
  • c (3333384114)11000110101011110110011110110010
  • d (3667134115)11011010100101000000011010100011
  • Data Block (1936156275)01110011011001110110011001
    110011
  • R Constant (6)00000000000000000000000000000110
  • Sin Value (4096336452)111101000010100100100010010
    00100
  • Logic Function (87148498)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (2255720028)100001100111001
    11000111001011100

57
MD5 Generation
  • Iteration 1 Step 50
  • a d, d c, c b, b previous resulting value
  • a (3667134115)11011010100101000000011010100011
  • b (2255720028)10000110011100111000111001011100
  • c (2176301160)10000001101101111011100001101000
  • d (3333384114)11000110101011110110011110110010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (10)00000000000000000000000000001010
  • Sin Value (1126891415)010000110010101011111111100
    10111
  • Logic Function (3667134115)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (2468694990)100100110010010
    10100101111001110

58
MD5 Generation
  • Iteration 1 Step 51
  • a d, d c, c b, b previous resulting value
  • a (3333384114)11000110101011110110011110110010
  • b (2468694990)10010011001001010100101111001110
  • c (2255720028)10000110011100111000111001011100
  • d (2176301160)10000001101101111011100001101000
  • Data Block (88)00000000000000000000000001011000
  • R Constant (15)00000000000000000000000000001111
  • Sin Value (2878612391)101010111001010000100011101
    00111
  • Logic Function (3333384114)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (3116351871)101110011011111
    11100000101111111

59
MD5 Generation
  • Iteration 1 Step 52
  • a d, d c, c b, b previous resulting value
  • a (2176301160)10000001101101111011100001101000
  • b (3116351871)10111001101111111100000101111111
  • c (2468694990)10010011001001010100101111001110
  • d (2255720028)10000110011100111000111001011100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (21)00000000000000000000000000010101
  • Sin Value (4237533241)111111001001001110100000001
    11001
  • Logic Function (2176301160)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (337436225)0001010000011100
    1101111001000001

60
MD5 Generation
  • Iteration 1 Step 53
  • a d, d c, c b, b previous resulting value
  • a (2255720028)10000110011100111000111001011100
  • b (337436225)00010100000111001101111001000001
  • c (3116351871)10111001101111111100000101111111
  • d (2468694990)10010011001001010100101111001110
  • Data Block (0)00000000000000000000000000000000
  • R Constant (6)00000000000000000000000000000110
  • Sin Value (1700485571)011001010101101101011001110
    00011
  • Logic Function (2255720028)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (1613146541)011000000010011
    01010100110101101

61
MD5 Generation
  • Iteration 1 Step 54
  • a d, d c, c b, b previous resulting value
  • a (2468694990)10010011001001010100101111001110
  • b (1613146541)01100000001001101010100110101101
  • c (337436225)00010100000111001101111001000001
  • d (3116351871)10111001101111111100000101111111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (10)00000000000000000000000000001010
  • Sin Value (2399980690)100011110000110011001100100
    10010
  • Logic Function (2468694990)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (303029247)0001001000001111
    1101101111111111

62
MD5 Generation
  • Iteration 1 Step 55
  • a d, d c, c b, b previous resulting value
  • a (3116351871)10111001101111111100000101111111
  • b (303029247)00010010000011111101101111111111
  • c (1613146541)01100000001001101010100110101101
  • d (337436225)00010100000111001101111001000001
  • Data Block (0)00000000000000000000000000000000
  • R Constant (15)00000000000000000000000000001111
  • Sin Value (4293915773)111111111110111111110100011
    11101
  • Logic Function (3116351871)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (2520188603)100101100011011
    10000011010111011

63
MD5 Generation
  • Iteration 1 Step 56
  • a d, d c, c b, b previous resulting value
  • a (337436225)00010100000111001101111001000001
  • b (2520188603)10010110001101110000011010111011
  • c (303029247)00010010000011111101101111111111
  • d (1613146541)01100000001001101010100110101101
  • Data Block (1684498020)01100100011001110110011001
    100100
  • R Constant (21)00000000000000000000000000010101
  • Sin Value (2240044497)100001011000010001011101110
    10001
  • Logic Function (337436225)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (2240316896)100001011000100
    01000010111100000

64
MD5 Generation
  • Iteration 1 Step 57
  • a d, d c, c b, b previous resulting value
  • a (1613146541)01100000001001101010100110101101
  • b (2240316896)10000101100010001000010111100000
  • c (2520188603)10010110001101110000011010111011
  • d (303029247)00010010000011111101101111111111
  • Data Block (0)00000000000000000000000000000000
  • R Constant (6)00000000000000000000000000000110
  • Sin Value (1873313359)011011111010100001111110010
    01111
  • Logic Function (1613146541)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (1832606642)011011010011101
    10101101110110010

65
MD5 Generation
  • Iteration 1 Step 58
  • a d, d c, c b, b previous resulting value
  • a (303029247)00010010000011111101101111111111
  • b (1832606642)01101101001110110101101110110010
  • c (2240316896)10000101100010001000010111100000
  • d (2520188603)10010110001101110000011010111011
  • Data Block (0)00000000000000000000000000000000
  • R Constant (10)00000000000000000000000000001010
  • Sin Value (4264355552)111111100010110011100110111
    00000
  • Logic Function (303029247)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (775893908)0010111000111111
    0011001110010100

66
MD5 Generation
  • Iteration 1 Step 59
  • a d, d c, c b, b previous resulting value
  • a (2520188603)10010110001101110000011010111011
  • b (775893908)00101110001111110011001110010100
  • c (1832606642)01101101001110110101101110110010
  • d (2240316896)10000101100010001000010111100000
  • Data Block (0)00000000000000000000000000000000
  • R Constant (15)00000000000000000000000000001111
  • Sin Value (2734768916)101000110000000101000011000
    10100
  • Logic Function (2520188603)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (1664965074)011000110011110
    10101100111010010

67
MD5 Generation
  • Iteration 1 Step 60
  • a d, d c, c b, b previous resulting value
  • a (2240316896)10000101100010001000010111100000
  • b (1664965074)01100011001111010101100111010010
  • c (775893908)00101110001111110011001110010100
  • d (1832606642)01101101001110110101101110110010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (21)00000000000000000000000000010101
  • Sin Value (1309151649)010011100000100000010001101
    00001
  • Logic Function (2240316896)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (483623998)0001110011010011
    1000010000111110

68
MD5 Generation
  • Iteration 1 Step 61
  • a d, d c, c b, b previous resulting value
  • a (1832606642)01101101001110110101101110110010
  • b (483623998)00011100110100111000010000111110
  • c (1664965074)01100011001111010101100111010010
  • d (775893908)00101110001111110011001110010100
  • Data Block (0)00000000000000000000000000000000
  • R Constant (6)00000000000000000000000000000110
  • Sin Value (4149444226)111101110101001101111110100
    00010
  • Logic Function (1832606642)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (4230970502)111111000010111
    10111110010000110

69
MD5 Generation
  • Iteration 1 Step 62
  • a d, d c, c b, b previous resulting value
  • a (775893908)00101110001111110011001110010100
  • b (4230970502)11111100001011110111110010000110
  • c (483623998)00011100110100111000010000111110
  • d (1664965074)01100011001111010101100111010010
  • Data Block (0)00000000000000000000000000000000
  • R Constant (10)00000000000000000000000000001010
  • Sin Value (3174756917)101111010011101011110010001
    10101
  • Logic Function (775893908)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (3601917876)110101101011000
    01110011110110100

70
MD5 Generation
  • Iteration 1 Step 63
  • a d, d c, c b, b previous resulting value
  • a (1664965074)01100011001111010101100111010010
  • b (3601917876)11010110101100001110011110110100
  • c (4230970502)11111100001011110111110010000110
  • d (483623998)00011100110100111000010000111110
  • Data Block (2154063718)10000000011001000110011101
    100110
  • R Constant (15)00000000000000000000000000001111
  • Sin Value (718787259)0010101011010111110100101011
    1011
  • Logic Function (1664965074)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (1650717882)011000100110001
    11111010010111010

71
MD5 Generation
  • Iteration 1 Step 64
  • a d, d c, c b, b previous resulting value
  • a (483623998)00011100110100111000010000111110
  • b (1650717882)01100010011000111111010010111010
  • c (3601917876)11010110101100001110011110110100
  • d (4230970502)11111100001011110111110010000110
  • Data Block (0)00000000000000000000000000000000
  • R Constant (21)00000000000000000000000000010101
  • Sin Value (3951481745)111010111000011011010011100
    10001
  • Logic Function (483623998)int result b
    RotateLeft((a ((c (b d))) DataBlock
    SinValue), R Constant)
  • Result after shifting (1715185767)011001100011101
    11010100001100111

72
MD5 Generation
  • After Iteration 1 Add the new result to the
    previous iteration's result
  • h0 A 1668587399
  • h1 B 1443451888
  • h2 C 4213100984
  • h3 D 3873651754

73
MD5 Generation
  • After all iterations are complete
  • h0 1668587399 (Hex 879f7463)
  • h1 1443451888 (Hex f0530956)
  • h2 4213100984 (Hex b8d11efb)
  • h3 3873651754 (Hex 2a3ce3e6)
  • The final digest
  • 879f7463f0530956b8d11efb2a3ce3e6

74
MD5 Generation Summary
  • As you can see, there is quite a bit of bit
    shifting happening which makes it nearly
    impossible to reverse engineer
  • The goal of generating hash keys (i.e. Message
    Digests) is exactly this- to ensure data
    integrity.
  • Hopefully this presentation has helped you gain a
    better understanding of how the process of key
    generation works.

75
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com