1 / 60

Network Security

Network Security. Chapter 3 Public-Key Cryptography and Message Authentication. Slides by H. Johnson & S. Malladi- Modified & Translated by Sukchatri P. Overview. Message Authentication Secure Hash Functions and HMAC Public-Key Cryptography Principles Public-Key Cryptography Algoroithms

mlorenzo
Télécharger la présentation

Network Security

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Security Chapter 3 Public-Key Cryptography and Message Authentication Slides by H. Johnson & S. Malladi- Modified & Translated by Sukchatri P.

  2. University of Phayao Overview • Message Authentication • Secure Hash Functions and HMAC • Public-Key Cryptography Principles • Public-Key Cryptography Algoroithms • Digital Signatures • Key Management

  3. University of Phayao Authentication • “A message, file, document or data is said to be authentic when it is genuine and came from its alleged source.” ข้อความ, ไฟล์เอกสารหรือข้อมูลที่มีการกล่าวถึงเป็นจริงเมื่อมันเป็นของแท้และมาจากแหล่งที่ถูกต้อง • Encryption prevents against passive attacks ( eavesdropping) การเข้ารหัสป้องกันการโจมตีแบบพาสซีฟ (แอบฟัง) • Message Authentication prevents against active attacks or falsification. ข้อความรับรองความถูกต้องป้องกันการโจมตีที่ใช้งานหรือการกระทำผิด

  4. University of Phayao Message Authentication • Requirements - must be able to verify that: (ความต้องการ – ต้องสามารถตรวจสอบได้ว่า ) 1. Message came from apparent source or author, ข้อความมาจากแหล่งข้อมูลที่ชัดเจนหรือผู้เขียนจริง 2. Contents have not been altered, เนื้อหาไม่ถูกแก้ไข 3. Sometimes, it was sent at a certain time or sequence. บางครั้งอาจจะถูกส่งไปกับบางช่วงเวลาหรือลำดับ • Protection against active attack (falsification of data and transactions) การป้องกันการโจมตีที่ใช้งาน (การกระทำผิดเกี่ยวกับข้อมูลและการทำธุรกรรม)

  5. University of Phayao Approaches to Message Authentication • Authentication Using Conventional Encryptionการตรวจสอบการใช้การเข้ารหัสลับแบบปกติดั้งเดิม • Only the sender and receiver should share a key เฉพาะผู้ส่งและผู้รับควรใช้คีย์ร่วมกัน • Message Authentication without Message Encryption ข้อความการตรวจสอบสิทธิ์โดยปราศจาก การเข้ารหัสข้อความ • An authentication tag is generated and appended to each message แท็กการตรวจสอบจะถูกสร้างและผนวกเข้ากับแต่ละข้อความ • Message Authentication Code การตรวจสอบรหัสข้อความ • Calculate the MAC as a function of the message and the key. MAC= F(K, M)

  6. University of Phayao Message Authentication • Using Encryption • Assume only sender and receiver share a key สมมติผู้ส่งเท่านั้นและหุ้นรับสำคัญ • Then a correctly encrypted message should be from the sender จากนั้นข้อความที่เข้ารหัสได้อย่างถูกต้องควรจะเป็นจากผู้ส่ง • Usually also contains error-detection code, sequence number and time stamp โดยปกติแล้วยังมีรหัสข้อผิดพลาดตรวจสอบหมายเลขลำดับและการลงเวลา

  7. University of Phayao

  8. University of Phayao Message Authentication • Without Encryption • No confidentiality is preferred when: การรักษาความลับไม่เป็นที่ต้องการเมื่อ • Same message is broadcast to many destinations ข้อความเดียวกันนี้มีการถ่ายทอดไปยังปลายทางจำนวนมาก • Heavy load and cannot decrypt all messages – some chosen at random ภาระหนักและไม่สามารถถอดรหัสข้อความทั้งหมด -- บางส่วนเลือกโดยการสุ่ม • No danger in sending plaintext Append authentication tag to each message,ไม่มีอันตรายในการส่งข้อความเพิ่มแท็กรับรองความถูกต้องกับแต่ละข้อความได้

  9. University of Phayao Message Authentication • Message Authentication Code (MAC) • Small block of data that is appended to the message บล็อกเล็กของข้อมูลถูกต่อท้ายข้อความ • MAC is generated by using a secret key; MAC จะถูกสร้างขึ้นโดยใช้รหัสลับ • Assumes both parties A,B share common secret key KAB • Code is function of message and key MACM= F(KAB, M) • Message plus code are transmitted

  10. University of Phayao Message Authentication Code • If received code matches calculated code then หากรหัสตรงกับรหัสที่ได้รับการคำนวณแล้ว • Receiver is sure message has not been altered ผู้รับแน่ใจว่าข้อความไม่มีการเปลี่ยนแปลงใดๆ • Message is from sender since only sender shares the key ผู้ส่งเท่านั้นที่ให้รหัสไปพร้อมกับการส่งข้อความ • If the message includes correct sequence number, that number could not have been altered by hacker ถ้าข้อความหมายมีลำดับที่ถูกต้องรวมถึงจำนวนข้อความที่ไม่ได้ถูกเปลี่ยนแปลงโดยแฮกเกอร์

  11. University of Phayao Message Authentication Code • Different from encryption ที่แตกต่างกันจากการเข้ารหัส • MAC does not have to be reversible as the cipher text does in encryption; MAC ไม่ต้องมีการย้อนกลับและขณะที่ cipher text ทำการเข้ารหัส • Because of mathematical properties, it is less vulnerable to being broken than encryption เนื่องจากคุณสมบัติทางคณิตศาสตร์ จะมีช่องโหวน้อยกว่าการเข้ารหัส • 16 to 32 bit code is typical โดยทั่วไปแล้วคือรหัสบิต 16-32

  12. University of Phayao

  13. University of Phayao One-way HASH function • Alternative to Message Authentication Code ทางเลือกในรหัสการตรวจสอบข้อความ • Accepts a variable size message M as input and produces a fixed-size message digest H (M) as output ยอมรับตัวแปรขนาด M ข้อความเ ขณะที่การเข้าและการสร้างข้อความขนาดคงที่ถูกย่อยออกเป็น H (M)

  14. One-way HASH function University of Phayao

  15. One-way HASH function University of Phayao • Secret value is added before the hash and removed before transmission. • ค่าความลับจะถูกเพิ่มก่อนที่จะถูกซอยย่อยและลบทิ้งก่อนส่ง

  16. Secure HASH Functions University of Phayao • Purpose of the HASH function is to produce a “fingerprint” • Used in message authentication and digital signatures • Properties of a HASH function H : • H can be applied to a block of data at any size • H produces a fixed length output • H(x) is easy to compute for any given x. • For any given block x, it is computationally infeasible to find x such that H(x) = h (one-way property) • For any given block x, it is computationally infeasible to find with H(y) = H(x). (weak collision resistance) บอบบางต่อความต้านทานการปะทะกัน • It is computationally infeasible to find any pair (x, y) such that H(x) = H(y) ( strong collsion resistance)

  17. University of Phayao Simple Hash Function • General principle • Input is a sequence of n-bit blocks • Input is processed one block at a time to produce an n-bit hash function • A simple example is the XOR of each block Ci = bi1 bi2  …  bim Ci is ith bit of hash code 1 <= i <= n m is number of n-bit block in input bij is ith bit in jth block  Is the XOR operation

  18. Simple Hash Function University of Phayao

  19. University of Phayao Simple Hash FunctionImproved • To improve- perform a one-bit circular shift on the hash value after each block is processed • Initally set the n-bit hash value to zero • Process each successive n-bit blok of data by: • Rotating current hash value to the left by 1 bit • XOR the block into the hash value

  20. University of Phayao SHA-1 Secure Hash Function • The Secure Hash Algorithm( SHA) was developed by the National Institute of Standards and Technology and published in 1993. SHA-1 is 1995 revised version. ฉบับแก้ไขเพิ่มเติม • It takes as input a message with maximum length < 264 bits and produces a 160-bit message digest. รองรับข้อความที่เข้ามาได้ถึงความยาวสูงสุด 264 บิตและข้อความย่อยขาออกได้ 160 bit • It is processed in 512-bit blocks. มันจะถูกประมวลผลในบล็อก 512 - bit

  21. University of Phayao Message Digest Generation Using SHA-1

  22. SHA-1 Processing of single 512-Bit Block University of Phayao

  23. Other Secure HASH functions University of Phayao

  24. University of Phayao HMAC • Use a MAC derived from a cryptographic hash code, such as SHA-1. ใช้ MAC ที่ได้จากการเข้ารหัสลับรหัสแฮชเช่น SHA - 1 • Motivations: • Cryptographic hash functions executes faster in software than encryptoin algorithms such as DES ฟังก์ชันแฮช Cryptographic ประมวลผลได้เร็วกว่าในซอฟต์แวร์กว่าขั้นตอนวิธี encryptoin เช่น DES • Library code for cryptographic hash functions is widely available มีคลังรหัสสำหรับฟังก์ชันแฮชการเข้ารหัสลับมีใช้อย่างกว้างขวาง • No export restrictions from the US ไม่เข้มงวดในการนำออกจาก US

  25. University of Phayao HMAC Structure

  26. Public-Key Cryptography Principles University of Phayao • The use of two keys has consequences in: key distribution, confidentiality and authentication. • The scheme has six ingredients (see Figure 3.7) • Plaintext • Encryption algorithm • Public and private key • Ciphertext • Decryption algorithm

  27. University of Phayao Encryption using Public-Key system

  28. Authentication usingPublic-Key System University of Phayao

  29. University of Phayao Applications for Public-Key Cryptosystems • Three categories: • Encryption/decryption: The sender encrypts a message with the recipient’s public key. • Digital signature: The sender ”signs” a message with its private key. • Key exchange: Two sides cooperate to exhange a session key.

  30. University of Phayao Requirements for Public Key Cryptography • Computationally easy for a party B to generate a pair (public key KUb, private key KRb) • Easy for sender to generate ciphertext: • Easy for the receiver to decrypt ciphertect using private key:

  31. University of Phayao Requirements for Public Key Cryptography • Computationally infeasible to determineprivate key (KRb) knowing public key (KUb) • Computationally infeasible to recover message M, knowing KUband ciphertext C • Either of the two keys can be used for encryption, with the other used for decryption:

  32. University of Phayao Public Key Algorithms- RSA • RSA (1977, Ron Rivest, Adi Shamir and Len Adleman), MIT • Most popular and widely implemented • Block cipher • Plain text and cipher text are integers between 0 and (n-1) for some n • C = Me mod n • M = Cd mod n = (Me mod n)d = (Med mod n)

  33. University of Phayao Public key Algorithms- RSA • Both sender and receiver know n and e • Only receiver knows d • Public key = {e,n} • Private key = {d,n} • Requirements • Should be possible to find e, d, n such that Med = M mod n for all M < n

  34. University of Phayao Requirements continued… • Easy to calculate Me and Cd for all M < n • Infeasible to determine d, given e and n • First two requirements are easy. • Third one is also possible if e, n are large

  35. University of Phayao Steps • Given in text book including examples • See figure on the next slide • We also did some examples in class and in the assignment • Please refer solutions for assignment 2

  36. University of Phayao The RSA Algorithm – Key Generation • Select p,q p and q both prime • Calculate n = p x q • Calculate • Select integer e • Calculate d • Public Key KU = {e,n} • Private key KR = {d,n}

  37. University of Phayao Example of RSA Algorithm

  38. University of Phayao The RSA Algorithm - Encryption • Plaintext: M<n • Ciphertext: C = Me (mod n)

  39. University of Phayao The RSA Algorithm - Decryption • Ciphertext: C • Plaintext: M = Cd (mod n)

  40. University of Phayao Public Key Algorithm Diffie-Hellman • First introduced by Diffie-Hellman in 1976 • Mathematical functions rather than simple operations on bit patterns • Allows two separate keys • Exchange keys securely • Compute discrete logarithms • Some misconceptions, corrected • NOT more secure than symmetric key • Does NOT Makes symmetric key obsolete • Central agent is needed for both

  41. University of Phayao Diffie-Hellman basics Pick secret, random Y Pick secret, random X gx mod p gy mod p Alice Bob Compute k=(gy)x=gxymod p Compute k=(gx)y=gxymod p

  42. University of Phayao Diffie-Hellman Key Echange

  43. University of Phayao Diffie-Hellman • Key exchange algorithm using public and private values • Based on the discrete logarithm problem • To understand the discrete logarithm problem • Define the primitive root of p to be one whose powers generate all the integers from 1 to (p-1) from some prime number p

  44. University of Phayao DH details • i.e. if a is a primitive root of prime p, • a mod p, a2 mod p, … ,ap-1 mod p are distinct and contain 1 through (p-1) in some order • For b less than p and a, find unique exponent i such that • b = ai mod p 0 <= i <= (p-1)

  45. University of Phayao DH details continued… • i is the discrete logarithm • Denoted inda,p(b) • It is hard to calculate it given ai mod p

  46. Other Public-Key Cryptographic Algorithms University of Phayao • Digital Signature Standard (DSS) • Makes use of the SHA-1 • Not for encryption or key echange • Elliptic-Curve Cryptography (ECC) • Good for smaller bit size • Low confidence level, compared with RSA • Very complex

  47. University of Phayao Digital signatures • A digital signature is an encryption of a document with the creator’s private key • It is attached to a document that validates the creator of the document • Any one can validate it by decrypting the signature with the claimed creator’s public key

  48. University of Phayao Digital signatures on hashes • A more efficient way for a digital signature is by creating an authenticator of the document first (a hash) • Then sign the hash (i.e. encrypt the hash using private key) • If M is the message (or document), Hash(M) = H • sigPV(A)(H) represents sigining H • i.e. encrypting H with A’s private key

  49. University of Phayao Digital Signatures: The basic idea public key ? public key private key Alice Bob

  50. University of Phayao Key management • Distribution of public keys • Well, what’s the issue? • Can’t we just trust Mallory if she claims a key as her public key? Mallory publickey ? publickey private key Alice Bob

More Related