l l l Check Digit Check Sum Hash

  • Slides: 54
Download presentation

การตรวจสอบความถกตองของขอมล l l l Check Digit Check Sum Hash Function Message Authentication Code Digital

การตรวจสอบความถกตองของขอมล l l l Check Digit Check Sum Hash Function Message Authentication Code Digital Signature

CHECK DIGIT

CHECK DIGIT

CHECK SUM

CHECK SUM

Error Detection in IP Protocol l IP Check sum Field

Error Detection in IP Protocol l IP Check sum Field

ตวอยางการคำนวณ l l l l checksum Packet : 01 00 F 2 03 F

ตวอยางการคำนวณ l l l l checksum Packet : 01 00 F 2 03 F 4 F 5 F 6 F 7 00 00 โดย 00 00 = checksum field จดกลมได : 0100 F 203 F 4 F 5 F 6 F 7 รวมตวเลข : 0100 + F 203 + F 4 F 5 + F 6 F 7 = 0002 DEEF ตวสวน Overflow (0002) บวกกบสวนทเหลอ : DEEF + 002 = DEF 1 ทำ 1's complement : ~DEF 1 = 210 E ได checksum = 21 0 E รวมเปนขอมล 01 00 F 2 03 F 4 F 5 F 6 F 7 21 0 E

HASH FUNCTION

HASH FUNCTION

Hash Functions 20

Hash Functions 20

Hash Function l ตวอยาง l l l l Hash Function) Message Digest , Secure

Hash Function l ตวอยาง l l l l Hash Function) Message Digest , Secure Hash Algorithm) MD 2 (128 bits) by Ronald Rivests MD 4 (128 bits) by Ronald Rivests MD 5 (128 bits) by Ronald Rivests MD 6 (Variable, 0<d≤ 512 bits) by Ronald Rivests Team SHA 0 (160 bits) by National Security Agency : NSA SHA 1 (160 bits) by National Security Agency : NSA SHA 2 Series (SHA-224, SHA-256, SHA-384, SHA-512) By National Security Agency : NSA

MD 5 l l l คดคนโดย Ronald Rivest (the R in RSA) ผลลพธมขนาด 128

MD 5 l l l คดคนโดย Ronald Rivest (the R in RSA) ผลลพธมขนาด 128 -bit RFC 1321

4. Continued (4 Rounds) Addition (+) is mod 232

4. Continued (4 Rounds) Addition (+) is mod 232

Step 4. Continued (Each Round) Addition (+) is mod 232 For each 512 -bit

Step 4. Continued (Each Round) Addition (+) is mod 232 For each 512 -bit chunk of message break chunk into sixteen 32 -bit littleendian words X[k], 0 ≤ k ≤ 15

Table T l l ตาราง T มคาขอมลทงหมด สรางจาก sine function. l l 64 คา

Table T l l ตาราง T มคาขอมลทงหมด สรางจาก sine function. l l 64 คา for i from 0 to 63 T[i] : = floor(abs(sin(i + 1)) × (2 pow 32)) 31

Table T 32

Table T 32

Step 4. Round 1 and 2 <<<S = Left bit Rotation by S Space

Step 4. Round 1 and 2 <<<S = Left bit Rotation by S Space

Step 4. Round 3 and 4 34

Step 4. Round 3 and 4 34

MD 5 Boolean Functions l ฟงกชน ของขอมล l l G, H, I, F ทำหนาทเปน

MD 5 Boolean Functions l ฟงกชน ของขอมล l l G, H, I, F ทำหนาทเปน X, Y, Z เมอ "bitwise parallel” AND OR NOT XOR 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)

Step 4. Continued 36

Step 4. Continued 36

ตวอยาง MD 5 function l MD 5("The quick brown fox jumps over the lazy

ตวอยาง MD 5 function l MD 5("The quick brown fox jumps over the lazy dog") 9 e 107 d 9 d 372 bb 6826 bd 81 d 3542 a 419 d 6 l MD 5("The quick brown fox jumps over the lazy dog. ") e 4 d 909 c 290 d 0 fb 1 ca 068 ffaddf 22 cbd 0 l MD 5("") d 41 d 8 cd 98 f 00 b 204 e 9800998 ecf 8427 e

Other Message Digest Algorithms l l l MD 4 SHA-1 RIPEMD-160 39

Other Message Digest Algorithms l l l MD 4 SHA-1 RIPEMD-160 39

A Comparison of MD 5, SHA-1, and RIPEMD-160 40

A Comparison of MD 5, SHA-1, and RIPEMD-160 40

MESSAGE AUTHENTICATION CODE

MESSAGE AUTHENTICATION CODE

Message Authentication Code

Message Authentication Code

Use of a MAC Secret key MAC message Secret key algorithm Unsecured channel message

Use of a MAC Secret key MAC message Secret key algorithm Unsecured channel message MAC verification algorithm Signer Verifier Ok / not Ok

DIGITAL SIGNATURE

DIGITAL SIGNATURE

Digital Signatures Scheme l l l Data integrity Message authentication Non-repudiation Signer’s private key

Digital Signatures Scheme l l l Data integrity Message authentication Non-repudiation Signer’s private key Signing message Signer’s public key algorithm Unsecured channel message signature Signature verification algorithm Signer Verifier Ok / not Ok