CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication.

Slides:



Advertisements
Similar presentations
Hash Function. What are hash functions? Just a method of compressing strings – E.g., H : {0,1}*  {0,1} 160 – Input is called “message”, output is “digest”
Advertisements

Encipherment Using Modern Symmetric-Key Ciphers. 8.2 Objectives ❏ To show how modern standard ciphers, such as DES or AES, can be used to encipher long.
CMSC 414 Computer (and Network) Security Lecture 4 Jonathan Katz.
CS555Topic 191 Cryptography CS 555 Topic 19: Formalization of Public Key Encrpytion.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
1 Message Integrity CS255 Winter ‘06. 2 Message Integrity Goal: provide message integrity. No confidentiality. –ex: Protecting public binaries on disk.
CMSC 456 Introduction to Cryptography
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings Lecture slides by Lawrie Brown/Mod. & S. Kondakci.
CS526Topic 5: Hash Functions and Message Authentication 1 Computer Security CS 526 Topic 5 Cryptography: Cryptographic Hash Functions And Message Authentication.
CS555Spring 2012/Topic 41 Cryptography CS 555 Topic 4: Computational Approach to Cryptography.
Computer Security CS 426 Lecture 3
CRYPTOGRAPHIC DATA INTEGRITY ALGORITHMS
Lecture 2: Message Authentication Anish Arora CSE5473 Introduction to Network Security.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
CS555Topic 211 Cryptography CS 555 Topic 21: Digital Schemes (1)
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Message Authentication Code July Message Authentication Problem  Message Authentication is concerned with:  protecting the integrity of a message.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
Confidentiality Confidentiality is maintained so long as private keys are secure. Authenticity is possible via public-key encryption by encrypting messages.
Integrity via Encryption with Redundancy  Question: Encryption is not ideal for authentication. But, can we gain security advantages if we add recognizable.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
CS426Fall 2010/Lecture 61 Computer Security CS 426 Lecture 6 Cryptography: Message Authentication Code.
A Quick Tour of Cryptographic Primitives Anupam Datta CMU Fall A: Foundations of Security and Privacy.
Lecture 2: Introduction to Cryptography
Class 3 Cryptography Refresher II CIS 755: Advanced Computer Security Spring 2014 Eugene Vasserman
Giuseppe Bianchi Message Authentication: hash functions and hash-based constructions.
Lecture 5.1: Message Authentication Codes, and Key Distribution
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
CS555Spring 2012/Topic 71 Cryptography CS 555 Topic 7: Stream Ciphers and CPA Security.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CS555Spring 2012/Topic 81 Cryptography CS 555 Topic 8: Pseudorandom Functions and CPA Security.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Cryptography Lecture 8 Arpita Patra © Arpita Patra.
Cryptography Lecture 9 Arpita Patra © Arpita Patra.
Message Authentication Codes CSCI 5857: Encoding and Encryption.
Cryptography Lecture 10 Arpita Patra © Arpita Patra.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 13.Message Authentication.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
Cryptography Lecture 6 Arpita Patra. Quick Recall and Today’s Roadmap >> MAC for fixed-length messages >> Domain Extension for MAC >> Authenticated Encryption:
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions.
@Yuan Xue 285: Network Security CS 285 Network Security Message Authentication Code Data integrity + Source authentication.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
Computer Security CS 526 Topic 4
Computer Security CS 526 Topic 4
Cryptography Lecture 9.
Cryptography Lecture 19.
Topic 7: Pseudorandom Functions and CPA-Security
Cryptography Lecture 12 Arpita Patra © Arpita Patra.
Cryptography Lecture 11.
Topic 13: Message Authentication Code
Lecture 4.1: Hash Functions, and Message Authentication Codes
Computer Security CS 526 Topic 5
Presentation transcript:

CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication

CS555Spring 2012/Topic 152 Outline and Readings Outline Hash Family NMAC and HMAC CCA-secure encryption Combining encryption & authentication Readings: Katz and Lindell: : 4.7,4.8,4.9

CS555Spring 2012/Topic 153 Hash Family (Called Hash Function in the Textbook) A hash family H is a function K  X  Y –X is a set of possible messages –Y is a finite set of possible message digests –K is the keyspace –For each s  K, there is a hash function h s  H. –Here, it is typically assumed that s is made public Unlike when we analyze a PRF Hash functions in practice (SHA-1, SHA-2) can be viewed as hash family, where the IV is viewed as the key

Collision Resistant Hash Family A Hash family is collision resistant if no adversary has negligible advantage in the following experiment: –A key s is generated. –Adversary is given s, and needs to find a collision on h s,that is find x1, x2 such that h s (x1)=h s (x2) A random hash function is chosen, and the adversary needs to produce a collision on that Advantage of using the concept of collision resistant hash family instead of a collision resistant hash function –Now it makes sense to assume that there is no adversary algorithm can produce collision. –Why it does not make sense to say that there exists no algorithm to produce a collision on a fixed hash function? CS555Spring 2012/Topic 154

Constructing MAC from Collision Resistant Hash Functions Let h be a collision resistant hash function MAC k (M) = h(k || M), where || denote concatenation –Okay as fixed-length MAC –Insecure when variable-length messages are allowed –Because of the Merkle-Damgard construction for hash functions, given M and t=h(K || M), adversary can compute M’ by appending to M some new data blocks, and then h(K||M’) CS555Spring 2012/Topic 155

Idea of NMAC (Nested MAC) Given a compression function f, and a hash function h constructed with f using the Merkle-Damgard method, NMAC defines MAC k1,k2 (m)=f(k1|| h(k2||m)). –Technically, both f and h are parameterized by a randomly chosen s, however, we ignore it NMAC is secure if both (1) h produces no collision, and (2) f(k||m) is a secure fixed-length MAC. –f(k||m) is a secure MAC means that adversary cannot compute f(k||m’) even after obtaining f(k||m 1 ), f(k||m 2 ), … Not implied by f being collision resistant, but in general safely assumed to be true for practical hash functions –Proof. A forgery against f(k1|| h(k2||m’)) means that either h(k2||m’) = h(k2||m i ) for a queried m i, which means h is not collision resistant; or one computes f(k1||d= h(k2||m’)), for a new value d, which means that f is not a secure MAC. CS555Spring 2012/Topic 156

CS555Spring 2012/Topic 157 HMAC: A Derivative of NMAC K + is the key padded (with 0) to B bytes, the input block size of the hash function ipad = the byte 0x36 repeated B times opad = the byte 0x5C repeated B times. Essentially NMAC. Differs in that NMAC uses independent k1 and k2, HMAC uses two keys that are computed from one key Proven to be PRF if compression function is PRF. If used with a secure hash functions (e.g., SHA-256) and according to the specification (key size, and use correct output), no known practical attacks against HMAC exists HMAC K [M] = Hash[(K +  opad) || Hash[(K +  ipad)||M)]]

CS555Spring 2012/Topic 158 HMAC Overview

Constructing CCA-Secure Encryption Construction CCA-secure encryption scheme. –Uses a CPA-secure encryption scheme, and a secure MAC. –In key generation, generates k 1 for encryption, and k 2 for MAC. –To encrypt a message m, computes ciphertext  c=Enc k1 (m), t=MAC k2 (c 1 )  The ciphertext of the scheme is a pair (c,t) –To decrypt a ciphertext  c, t , first check whether Vrfy k2 (c,t)=1; if yes, outputs Dec k1 (c); if not, outputs  That is, decline to decrypt if the MAC does not verify This is CCA-secure because the adversary gets nothing from the decryption oracle, unless the adversary can break the MAC first CS555Spring 2012/Topic 159

CS555Spring 2012/Topic 1510 Encryption and Authentication Three ways for encryption and authentication –Authenticate-then-encrypt (AtE), used in SSL a = MAC(x), C=E(x,a), transmit C –Encrypt-then-authenticate (EtA), used in IPSec C=E(x), a=MAC(C), transmit (C,a) –Encrypt-and-authenticate (E&A), used in SSH C=E(x), a=MAC(x), transmit (C,a) Which way provides secure communications when embedded in a protocol that runs in a real adversarial network setting?

Encryption Alone May Be Insufficient for Privacy If an adversary can manipulate a ciphertext such that the observable behavior (such as success or failure of decryption) differs depending on the content of plaintext, then information about plaintext can be leaked To defend against these, should authenticate ciphertext, and only decrypt after making sure ciphertext has not changed Encrypt-then-authenticate (EtA) is secure –C=E(x), a=MAC(C), transmit (C,a) CS555Spring 2012/Topic 1511

CS555Spring 2012/Topic 1512 Encryption Alone May Be Insufficient for Privacy: An Artificial Example Given a secure stream cipher (or even one-time pad) E, Consider encryption E* –E*[x] = E[encode[x]] encode[x] replaces 0 with 00, and 1 with either 01 or 10. –How to decrypt? –E*[x] is secure Using E* may not provide confidentiality in some usage –Consider the case an adversary flips the first two bits of E*[x] –When the bits are 01 or 10, flipping results in no change after decrypt –When the bits are 00, flipping result in decryption failure –Learning whether decryption succeeds reveal first bit

CS555Spring 2012/Topic 1513 AtE and E&A are insecure Authenticate-then-encrypt (AtE) is not always secure –a = MAC(x), C=E(x,a), transmit C –As first step is decryption, its success or failure may leak information. –AtE, however, can be secure for some encryption schemes, such as CBC or OTP (or stream ciphers) Encrypt-and-authenticate (E&A) is not secure –C=E(x), a=MAC(x), transmit (C,a) –MAC has no guarantee for confidentiality

CS555Spring 2012/Topic 1514 Coming Attractions … Private key management and the Public key revolution Reading: Katz & Lindell: Chapter 9