Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.

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.
Digital Signatures and Hash Functions. Digital Signatures.
Outline Project 1 Hash functions and its application on security Modern cryptographic hash functions and message digest –MD5 –SHA.
Information Security Principles & Applications Topic 4: Message Authentication 虞慧群
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
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.
Announcements:Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions and SHA-1 Hash Functions.
Hashes and Message Digest Hash is also called message digest One-way function: d=h(m) but no h’(d)=m –Cannot find the message given a digest Cannot find.
Cryptography and Network Security Hash Algorithms.
Kemal AkkayaWireless & Network Security 1 Department of Computer Science Southern Illinois University Carbondale CS 591 – Wireless & Network Security Lecture.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
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.
1 Cryptography and Network Security (Various Hash Algorithms) Fourth Edition by William Stallings Lecture slides by Lawrie Brown (Changed by Somesh Jha)
1 Message Authentication and Hash Functions Authentication Requirements Authentication Functions Message Authentication Codes Hash Functions Security of.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
© Neeraj Suri EU-NSF ICT March 2006 DEWSNet Dependable Embedded Wired/Wireless Networks MUET Jamshoro Computer Security: Principles and Practice Slides.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
HASH Functions.
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.
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.
1 Hashes and Message Digests. 2 Hash Also known as –Message digest –One-way function Function: input message -> output One-way: d=h(m), but not h’(d)
Fall 2002CS 395: Computer Security1 Chapter 11: Message Authentication and Hash Functions.
Chapter 21 Public-Key Cryptography and Message Authentication.
Brand-New Hash Function   BeeM A. Satoh SCIS2006 SHA-1 Broken! Prof. Xiaoyun Wang.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 2 – Cryptographic.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
1 Hash Functions. 2 A hash function h takes as input a message of arbitrary length and produces as output a message digest of fixed length
Hash and Mac Algorithms. Contents Hash Functions Secure Hash Algorithm HMAC.
Slide 1 EJ Jung Hash Functions. Integrity checks.
Cryptographic Hash Functions and Protocol Analysis
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.
Authentication. Goal: Bob wants Alice to “prove” her identity to him Protocol ap1.0: Alice says “I am Alice” Failure scenario?? “I am Alice”
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Cryptography and Network Security (CS435) Part Nine (Message Authentication)
Intro to Cryptography Lesson Introduction
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
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.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
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.
Chapter 12 – Hash Algorithms
Cryptographic Hash Functions
Cryptographic Hash Functions
Cryptographic Hash Functions Part I
Cryptographic Hash Functions
Cryptographic Hash Functions
Cryptographic Hash Functions Part I
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Hashing Hash are the auxiliary values that are used in cryptography.
Lecture 4: Hash Functions
Hash Function Requirements
Presentation transcript:

Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC

Hash Functions ●Compute message digest of data of any size ●Fixed length output: bits ●Easy to compute H(m) ●Given H(m), no easy way to find m ●One-way function ●Given m 1, it is computationally infeasible to find m 2 ≠m 1 s.t. H(m 2 ) = H(m 1 ) ●Weak collision resistant ●Computationally infeasible to find m 1 ≠m 2 s.t. H(m 1 ) = H(m 2 ) ●Strong collision resistant

Hash Functions ●Compute message digest of data of any size ●Fixed length output: bits ●Easy to compute H(m) ●Given H(m), no easy way to find m ●One-way function ●Given m 1, it is computationally infeasible to find m 2 ≠m 1 s.t. H(m 2 ) = H(m 1 ) ●Weak collision resistant ●Computationally infeasible to find m 1 ≠m 2 s.t. H(m 1 ) = H(m 2 ) ●Strong collision resistant Requirements for a practical application of a hash function

Hash Functions ●Compute message digest of data of any size ●Fixed length output: bits ●Easy to compute H(m) ●Given H(m), no easy way to find m ●One-way function ●Given m 1, it is computationally infeasible to find m 2 ≠m 1 s.t. H(m 2 ) = H(m 1 ) ●Weak collision resistant ●Computationally infeasible to find m 1 ≠m 2 s.t. H(m 1 ) = H(m 2 ) ●Strong collision resistant The one way property

Hash Functions ●Compute message digest of data of any size ●Fixed length output: bits ●Easy to compute H(m) ●Given H(m), no easy way to find m ●One-way function ●Given m 1, it is computationally infeasible to find m 2 ≠m 1 s.t. H(m 2 ) = H(m 1 ) ●Weak collision resistant ●Computationally infeasible to find m 1 ≠m 2 s.t. H(m 1 ) = H(m 2 ) ●Strong collision resistant Hash functions are unique to each message

Hash Functions

●Compute message digest of data of any size ●Fixed length output: bits ●Easy to compute H(m) ●Given H(m), no easy way to find m ●One-way function ●Given m 1, it is computationally infeasible to find m 2 ≠m 1 s.t. H(m 2 ) = H(m 1 ) ●Weak collision resistant ●Computationally infeasible to find m 1 ≠m 2 s.t. H(m 1 ) = H(m 2 ) ●Strong collision resistant

Hash Functions

Hash Function Weaknesses The Birthday Paradox Pigeonhole Principle

Hash Function Weaknesses n = number of pigeons m = number of holes n = m There is one pigeon per hole n > m Then at least one hole must have more than one pigeon Pigeonhole Principle

Hash Function Weaknesses The Birthday Paradox How many people do you need in a room before you have a greater than 50% chance that two of them will have the same birthday? Assume 365 birthdays (our containers) % chance that two people in the room have the same birthday: 100% requires 366 people (the pigeonhole principle)

Hash Function Weaknesses ●Compute probability of different birthdays ●Random sample of n people (birthdays) taken from k (365) days ●k n samples with replacement ●(k) n =k(k-1)…(k-n+1) sample without replacement ●Probability of repetition: ●p = 1- (k) n /k n ≈ n(n-1)/2k = 0.5 if n=√k The Birthday Paradox

Hash Function Weaknesses 1-(k) n /k n = the probability that a pair share the same birthday If k = 365, n = 19 If there are 19 people in a room, there is a good chance that two of them share the same birthday! The Birthday Paradox

Hash Function Weaknesses Hash Functions: ●There are many more ‘pigeons’ than ‘pigeonholes’ ●Many inputs will be mapped to the same output. That is, many input messages will have the same hash. Conclusion: The longer the length of the hash, the fewer collisions.

Determining Hash Length

Hash Size Quiz If the length of hash is 128 bits, then how many messages does an attack need to search in order to find two that share the same hash? Choose the correct answer:

Secure Hash Algorithm ●Developed by NIST, specified in the Secure Hash Standard, originally 1993 ●Revised as SHA-1 in 1995 ●160 bit hash ●NIST specified SHA2 algorithms in 2002 ●Hash value lengths of 256, 384, and 512 ●Similar to SHA-1

Comparison of SHA Parameters

Message Processing

Hash Based Message Authentication ●Cryptographic hash functions generally execute faster ●Library code is widely available ●SHA-1 was not designed for use as a MAC because it does not rely on a secret key ●Issued as RFC2014 ●Has been chosen as the mandatory-to-implement MAC for IP security ●Used in other Internet protocols such as Transport Layer Security (TLS)

Hash Based Message Authentication

HMAC Security ●Security depends on the cryptographic strength of the underlying hash function ● It’s much harder to launch successful collision attacks on HMAC because of secret key

Hash Function Quiz Check the statements that are True: The one-way hash function is important not only in message authentication but also in digital signatures SHA processes the input one block at a time but each block goes through the same processing HMAC is secure provided that the embedded hash function has good cryptographic strengths such as one- way and collision resistant

Hashes Lesson Summary ●Hash length should be at least 128 ●2^(64) message to find collision ●SHA1: 160-bit hash; SHA2: 256/384/512-bit hash ●Message processed/hashed block by block, result to next ●HMAC: hash the message with a secret key ●Message authentication