Chapter3 Public-Key Cryptography and Message Authentication Henric Johnson Blekinge Institute of Technology, Sweden http://www.its.bth.se/staff/hjo/ [email_address]
OUTLINE Approaches to Message Authentication Secure Hash Functions and HMAC Public-Key Cryptography Principles Public-Key Cryptography Algorithms Digital Signatures Key Management
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)
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)
 
One-way HASH function
One-way HASH function Secret value is added before the hash and removed before transmission.
Secure HASH Functions Purpose of the HASH function is to produce a ”fingerprint. 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 For any given block x, it is computationally infeasible to find  with H(y) = H(x). It is computationally infeasible to find any pair (x, y) such that H(x) = H(y)
Simple Hash Function One-bit circular shift on the hash value after each block is processed would improve
Message Digest Generation Using SHA-1
SHA-1 Processing of single 512-Bit Block
Other Secure HASH functions 160 (5 paired rounds of 16) 64 (4 rounds of 16) 80 (4 rounds of 20) Number of steps 2 64 -1 bits Maximum message size 512 bits 512 bits 512 bits Basic unit of processing 160 bits 128 bits 160 bits Digest length RIPEMD-160 MD5 SHA-1
HMAC Use a MAC derived from a cryptographic hash code, such as SHA-1. Motivations: Cryptographic hash functions executes faster in software than encryptoin algorithms such as DES Library code for cryptographic hash functions is widely available No export restrictions from the US
HMAC Structure
Public-Key Cryptography Principles The use of t wo keys has consequences in:  k ey distribution, confidentiality and authentication . The scheme has six ingredients  (see Figure 3.7) Plaintext Encryption algorithm Public and private key Ciphertext Decryption algorithm
Encryption using Public-Key system
Authentication using   Public-Key System
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 echange:  Two sides cooperate two exhange a session key.
Requirements for Public-Key Cryptography Computationally easy for a party B to generate a pair (public key K U b , private key KR b ) Easy for sender to generate ciphertext:  Easy for the receiver to decrypt ciphertect using private key:
Requirements for Public-Key Cryptography Computationally infeasible to determine   private key (KR b ) knowing public key (KU b ) Computationally infeasible to recover message M, knowing KU b  and ciphertext C Either of the two keys can be used for encryption, with the other used for decryption:
Public-Key Cryptographic Algorithms RSA and Diffie-Hellman  RSA  - Ron Rives, Adi Shamir and Len Adleman at MIT, in 1977. RSA is a block cipher The most widely implemented Diffie-Hellman   Echange a secret key securely Compute discrete logarithms
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}
Example of RSA Algorithm
The RSA Algorithm - Encryption Plaintext: M<n Ciphertext: C = M e  (mod n)
The RSA Algorithm - Decryption Ciphertext: C Plaintext: M = C d  (mod n)
Diffie-Hellman Key Echange
Other Public-Key Cryptographic Algorithms 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
Key Management Public-Key Certificate Use

Cryptography and Message Authentication NS3

  • 1.
    Chapter3 Public-Key Cryptographyand Message Authentication Henric Johnson Blekinge Institute of Technology, Sweden http://www.its.bth.se/staff/hjo/ [email_address]
  • 2.
    OUTLINE Approaches toMessage Authentication Secure Hash Functions and HMAC Public-Key Cryptography Principles Public-Key Cryptography Algorithms Digital Signatures Key Management
  • 3.
    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)
  • 4.
    Approaches to MessageAuthentication 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)
  • 5.
  • 6.
  • 7.
    One-way HASH functionSecret value is added before the hash and removed before transmission.
  • 8.
    Secure HASH FunctionsPurpose of the HASH function is to produce a ”fingerprint. 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 For any given block x, it is computationally infeasible to find with H(y) = H(x). It is computationally infeasible to find any pair (x, y) such that H(x) = H(y)
  • 9.
    Simple Hash FunctionOne-bit circular shift on the hash value after each block is processed would improve
  • 10.
  • 11.
    SHA-1 Processing ofsingle 512-Bit Block
  • 12.
    Other Secure HASHfunctions 160 (5 paired rounds of 16) 64 (4 rounds of 16) 80 (4 rounds of 20) Number of steps 2 64 -1 bits Maximum message size 512 bits 512 bits 512 bits Basic unit of processing 160 bits 128 bits 160 bits Digest length RIPEMD-160 MD5 SHA-1
  • 13.
    HMAC Use aMAC derived from a cryptographic hash code, such as SHA-1. Motivations: Cryptographic hash functions executes faster in software than encryptoin algorithms such as DES Library code for cryptographic hash functions is widely available No export restrictions from the US
  • 14.
  • 15.
    Public-Key Cryptography PrinciplesThe use of t wo keys has consequences in: k ey distribution, confidentiality and authentication . The scheme has six ingredients (see Figure 3.7) Plaintext Encryption algorithm Public and private key Ciphertext Decryption algorithm
  • 16.
  • 17.
    Authentication using Public-Key System
  • 18.
    Applications for Public-KeyCryptosystems 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 echange: Two sides cooperate two exhange a session key.
  • 19.
    Requirements for Public-KeyCryptography Computationally easy for a party B to generate a pair (public key K U b , private key KR b ) Easy for sender to generate ciphertext: Easy for the receiver to decrypt ciphertect using private key:
  • 20.
    Requirements for Public-KeyCryptography Computationally infeasible to determine private key (KR b ) knowing public key (KU b ) Computationally infeasible to recover message M, knowing KU b and ciphertext C Either of the two keys can be used for encryption, with the other used for decryption:
  • 21.
    Public-Key Cryptographic AlgorithmsRSA and Diffie-Hellman RSA - Ron Rives, Adi Shamir and Len Adleman at MIT, in 1977. RSA is a block cipher The most widely implemented Diffie-Hellman Echange a secret key securely Compute discrete logarithms
  • 22.
    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}
  • 23.
    Example of RSAAlgorithm
  • 24.
    The RSA Algorithm- Encryption Plaintext: M<n Ciphertext: C = M e (mod n)
  • 25.
    The RSA Algorithm- Decryption Ciphertext: C Plaintext: M = C d (mod n)
  • 26.
  • 27.
    Other Public-Key CryptographicAlgorithms 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
  • 28.