Lecture 4.1: Hash Functions, and Message Authentication Codes

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

ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Computer Science 654 Lecture 1 : Hash Functions Professor Wayne Patterson Howard University Spring 2010 (Stamp Chapter 5)
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
Hash functions a hash function produces a fingerprint of some file/message/data h = H(M)  condenses a variable-length message M  to a fixed-sized fingerprint.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
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.
Hash Functions 1 Hash Functions Hash Functions 2 Cryptographic Hash Function  Crypto hash function h(x) must provide o Compression  output length is.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
1 Chapter 11: Message Authentication and Hash Functions Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal,
Hash Functions A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M) Principal object is.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Lecture 3.4: Public Key Cryptography IV CS 436/636/736 Spring 2013 Nitesh Saxena.
EE515/IS523 Think Like an Adversary Lecture 4 Crypto in a Nutshell Yongdae Kim.
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.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
1 Network Security Lecture 5 Hashes and Message Digests Waleed Ejaz
Lecture 4.2: Hash Functions: Design* CS 436/636/736 Spring 2012 Nitesh Saxena * some slides borrowed from Gene Tsudik.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Modern Cryptography.
Chapter 11 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Class 3 Cryptography Refresher II CIS 755: Advanced Computer Security Spring 2014 Eugene Vasserman
Lecture 5.1: Message Authentication Codes, and Key Distribution
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2014 Nitesh Saxena.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
Understanding Cryptography by Christof Paar and Jan Pelzl These slides were prepared by Christof Paar and Jan Pelzl Chapter 12.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
Message Authentication and Hash Functions
CSCE 715: Network Systems Security
Cryptographic Hash Functions
Cryptographic Hash Function
CSCE 715: Network Systems Security
Cryptographic Hash Functions
Cryptographic Hash Functions Part I
Cryptography Lecture 13.
MAC: Message Authentication Code
Cryptographic Hash Functions
ICS 454 Principles of Cryptography
Cryptography: Basics (2)
Message Authentication and Hash Functions
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
ICS 454 Principles of Cryptography
Lecture 4.1: Hash Functions: Introduction
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Computer Security CS 526 Topic 5
Cryptography Lecture 14.
Hashing Hash are the auxiliary values that are used in cryptography.
Cryptography Lecture 13.
Cryptography Lecture 13.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Lecture 4: Hash Functions
Hash Function Requirements
CRYPTOGRAPHY & NETWORK SECURITY
Blockchains Lecture 4.
Presentation transcript:

Lecture 4.1: Hash Functions, and Message Authentication Codes 4/17/2019 Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2016 Nitesh Saxena

Course Administration 4/17/2019 Course Administration HW1 submitted; being graded Solution will be emailed

Course Administration 4/17/2019 Course Administration HW2 will be posted by coming Monday Covers Public Key Cryptography/Hash Functions Due 11am Mar 07 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Course Administration 4/17/2019 Course Administration Traveling to a conference next week NDSS, in San Diego http://www.internetsociety.org/events/ndss-symposium-2016 Students presenting a paper there Won’t come back in time to teach next week The TA will cover on my behalf She will talk about some of our research related to security Must attend 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Outline of Today’s lecture 4/17/2019 Outline of Today’s lecture Hash Functions Properties Birthday Paradox Generic Design Message Authentication Codes Based on block cipher designs Based on hash functions 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Cryptographic Hash Functions 4/17/2019 Cryptographic Hash Functions Requirements of cryptographic hash functions: Can be applied to data of any length. Output is fixed length, usually very short Relatively easy to compute h(x), given x Function is deterministic Infeasible to get x, given h(x). One-wayness property Given x, infeasible to find y such that h(x) = h(y). Weak-collision resistance property Infeasible to find any pair x and y (x ≠ y) such that h(x) = h(y). Strong-collision resistance property or just collision resistance 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Some Applications of Hash Functions 4/17/2019 Some Applications of Hash Functions In general, can be used as a checksum for large amounts of data Password hashing Digital signatures Message authentication codes (will study later) Used also in RSA-OAEP, and many other cryptographic constructions 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 Hash Output Length How long should be the output (n bits) of a cryptographic hash function? To find collision - randomly select messages and check if hash matches any that we know. Throwing k balls in N = 2n bins. How large should k be, before probability of landing two balls in the same becomes greater than ½? Birthday paradox - a collision can be found in roughly sqrt(N) = 2(n/2) trials for an n bit hash In a group of 23 (~ sqrt(365)) people, at least two of them will have the same birthday (with a probability > ½) Hence n should be at least 160 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 Birthday Paradox Probability that hash values of k random messages are distinct is (that is, no collisions) is: 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Generic Hash Function – Merkle-Damgard Construction 4/17/2019 Generic Hash Function – Merkle-Damgard Construction This design for H() is collision-resistant given that h() is collision resistant Intuitively, this is because there is a avalanche effect – even if the inputs differ in just 1 bit, the outputs will be completely different IV is a known public constant 4/17/2019 Lecture 4.1: Hash Functions, and MACs

An Illustrative Example from Wikipedia 4/17/2019 An Illustrative Example from Wikipedia 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Practical Examples SHA-1 MD5 Output 160 bits B’day attack requires 280 calls Faster attacks 269 calls http://infosec.sdu6.edu.cn/uploadfile/papers/Finding%20Collisions%20in%20the%20Full%20SHA-1.pdf MD5 Output is 128 bits, so B’day attack requires 264 calls only Faster attacks to find a collision: http://eprint.iacr.org/2004/199.pdf Better use stronger versions, such as SHA-256 Although, these attacks are still not practical – they only find two random messages that collide

Lecture 4.1: Hash Functions, and MACs 4/17/2019 Further Reading Stallings Chapter 11 HAC Chapter 9 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Message Authentication Codes 4/17/2019 Message Authentication Codes Provide integrity as well as authentication Send (m, MAC); MAC is created on m using the key shared between two parties Has to be deterministic to enable verification Unlike encryption schemes We want MAC to be as small and as secure as possible Can not provide non-repudiation Why not? 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 MAC – Functions KeyGen – outputs a key MAC – creates a checksum on m using key K Verify – validates whether the checksum on m is computed correctly Just create MAC and compare 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Security Notion for MAC 4/17/2019 Security Notion for MAC Very similar to the security notion for a digital signature scheme Existential forgery under (adaptively) chosen message attack 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Can encryption be used as a MAC? 4/17/2019 Can encryption be used as a MAC? No, not in general Intuitively because encryption achieves properties different from MAC See a counter-example: One-time pad as a MAC – bad idea! However, you can use 3-DES or AES as a building block for MAC 4/17/2019 Lecture 4.1: Hash Functions, and MACs

MAC Based on Block Cipher in the CBC mode – CBC-MAC 4/17/2019 MAC Based on Block Cipher in the CBC mode – CBC-MAC 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 CBC-MAC Note that this is deterministic IV = [0] Unlike CBC encryption Only the last block of the output is used as a MAC This is secure under CMA attack For pre-decided fixed-length messages Intuitively because of the presence of an avalanche effect 4/17/2019 Lecture 4.1: Hash Functions, and MACs

HMAC: MAC using Hash Functions 4/17/2019 HMAC: MAC using Hash Functions Developed as part of IPSEC - RFC 2104. Also used in SSL etc. Key based hash but almost as fast as non-key based hash functions. Avoids export restrictions unlike DES based MAC. Provable security Can be used with different hash functions like SHA-1,MD5, etc. 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 HMAC Block size b bits. K+ - K padded with bits on the left to make b bits. ipad – 0110110 (ox36) repeated b/8 times. opad – 1011100 (0x5c) repeated b/8 times. Essentially HHMACK = H[(K+ xor opad) || H[(K+ xor ipad) || M]] 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 Security of HMAC Security related to the collision resistance of the underlying hash function http://www.cse.ucsd.edu/~mihir/papers/hmac.html 4/17/2019 Lecture 4.1: Hash Functions, and MACs

HMAC – An Efficient Implementation 4/17/2019 4/17/2019 Lecture 4.1: Hash Functions, and MACs

Lecture 4.1: Hash Functions, and MACs 4/17/2019 Further Reading Stallings Chapter 12 (MAC) HAC Chapter 9 (MAC) 4/17/2019 Lecture 4.1: Hash Functions, and MACs