Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.

Slides:



Advertisements
Similar presentations
Lecture 5: Cryptographic Hashes
Advertisements

Digital Signatures and Hash Functions. Digital Signatures.
Information Security Principles & Applications Topic 4: Message Authentication 虞慧群
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown and edited by Archana Chidanandan Cryptographic Tools.
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.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
CSE331: Introduction to Networks and Security Lecture 21 Fall 2002.
Chapter 4  Hash Functions 1 Overview  Cryptographic hash functions are functions that: o Map an arbitrary-length (but finite) input to a fixed-size output.
Information Security and Management 11
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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.
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.
Lecture 4 Cryptographic Tools (cont) modified from slides of Lawrie Brown.
1 Message Authentication and Hash Functions Authentication Requirements Authentication Functions Message Authentication Codes Hash Functions Security of.
CRYPTOGRAPHIC DATA INTEGRITY ALGORITHMS
Network Security Essentials Fifth Edition by William Stallings Fifth Edition by William Stallings.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:
© Neeraj Suri EU-NSF ICT March 2006 DEWSNet Dependable Embedded Wired/Wireless Networks MUET Jamshoro Computer Security: Principles and Practice Slides.
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.
Information Security Principles Assistant Professor Dr. Sana’a Wafa Al-Sayegh 1 st Semester ITGD 2202 University of Palestine.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
Fall 2002CS 395: Computer Security1 Chapter 11: Message Authentication and Hash Functions.
Message Authentication and Hash Functions Chapter 11.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 2 “Cryptographic Tools”.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 2 – Cryptographic.
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
Data Security and Encryption (CSE348) 1. Lecture # 18 2.
Cryptographic Hash Functions and Protocol Analysis
Lecture 2: Introduction to 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)
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
Cryptography and Network Security
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
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.
Information and Network Security Dr. Hadi AL Saadi Message Authentication and Hash Functions.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Cryptographic Hash Functions & Digital Signatures
Cryptographic Hash Functions
Cryptographic Hash Function
Cryptographic Hash Functions
Presented by: Dr. Munam Ali Shah
Cryptographic Hash Functions Part I
Cryptography and Network Security Chapter 11
ICS 454 Principles of Cryptography
Cryptography and Network Security Chapter 11
ICS 454 Principles of Cryptography
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Hash Function Requirements
Presentation transcript:

Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown

Cryptographic Hash Functions u A hash function maps a message of an arbitrary length to a m-bit output (160 bits -512 bits) h = H(M) – Output h known as the fingerprint or the message digest – If the message digest is transmitted securely, then changes to the message can be detected –The principal object of a hash function is data integrity. –usually assume hash function is public u A hash is a many-to-one function, so collisions can happen. u To check the integrity of a message M' at a later time,compute h' = H(M') and verify that h = h'.

Hash function example u To see the change in the hash code produced by an innocuous (practically invisible) change in a message, h –Message: "A hungry brown fox jumped over a lazy dog" –SHA1 hash code: a8e7038cf ce4a2f582640f2aa5caf12d2 –Message: "A hungry brown fox jumped over a lazy dog" –SHA1 hash code: d617ba80a8bc883c1c3870af12a516c4a30f8fda u The only di ff erence between the two messages shown above is the extra space between the words “hungry” and “brown” in the second message

Preimage and Collisions u For hash value h = H(x), x is preimage of h u H is a many-to-one mapping; h has multiple preimages u Collision occurs if x ≠ y and H(x) = H(y) u Collisions are undesirable u How many preimages for given hash value? –If H takes b-bit input block, 2 b possible messages –For n-bit hash code, where b > n, 2 n possible hash codes –On average, if uniformly distributed hash values, then each hash value has 2 b-n preimages

Requirements for Cryptographic Hash Functions Compression: h reduces M to a fixed size. For any M, H(M) is easy to compute. u preimage resistant (one-way): –For any value h, it is computationally infeasible to find M such that h = H(M). u 2-nd preimage resistant (weak collision resistant): –For any values h and M such that h = H(M), it is computationally infeasible to find M'≠ M such that h = H(M'). u collision resistant (strong collision resistant): –It is computationally infeasible to find any pair M1, M2 such that H(M1) = H(M2).

Table 11.1 Requirements for a Cryptographic Hash Function H (Table can be found on page 323 in textbook.)

Authentication and Encryption u Sometimes desirable to avoid encryption when performing authentication – Encryption in software can be slow –Encryption in hardware has financial costs – Encryption hardware can be ineficient for small amounts of data – Encryption algorithms may be patented, increasing costs to use

Other Hash Function Uses u Uses of hash function –message authentication, –digital signatures, –one-way password file -store hash of password not actual password –intrusion/virus detection - keep & check hash of files on system –pseudorandom function (PRF) or pseudorandom number generator (PRNG)

Message Authentication Code (MAC) u Also known as a keyed hash function u Typically used between two parties that share a secret key to authenticate information exchanged between those parties u Combining hash function and encryption produces same result as MAC; but MAC algorithms can be more efficient than encryption algorithms ( which figure in slide#6 that illustrates that ?) Takes as input a secret key and a data block and produces a hash value (MAC) which is associated with the protected message If the integrity of the message needs to be checked, the MAC function can be applied to the message and the result compared with the associated MAC value An attacker who alters the message will be unable to alter the associated MAC value without knowledge of the secret key

Digital Signature u Operation is similar to that of the MAC u The hash value of a message is encrypted with a user’s private key u Anyone who knows the user’s public key can verify the integrity of the message u An attacker who wishes to alter the message would need to know the user’s private key u Implications of digital signatures go beyond just message authentication

Other Hash Function Uses Commonly used to create a one-way password file When a user enters a password, the hash of that password is compared to the stored hash value for verification This approach to password protection is used by most operating systems Can be used for intrusion and virus detection Store H(F) for each file on a system and secure the hash values One can later determine if a file has been modified by recomputing H(F) An intruder would need to change F without changing H(F) Can be used to construct a pseudorandom function (PRF) or a pseudorandom number generator (PRNG) A common application for a hash-based PRF is for the generation of symmetric keys

* Resistance required if attacker is able to mount a chosen message attack Table 11.2 Hash Function Resistance Properties Required for Various Data Integrity Applications

Two Simple Insecure Hash Functions u consider two simple insecure hash functions u bit-by-bit exclusive-OR (XOR) of every block –reasonably effective as data integrity check u one-bit circular shift on hash value –good for data integrity but useless for security

Bit-by-Bit Exclusive OR C i = b i1 xor b i2 xor b i3 xor ::: b im u C i is ith bit of hash code, 1 ≤ i ≤ n u m is number of n-bit blocks in input u bij is ith bit in jth block  Probability data error result in unchanged hash value: 2 –n u With structured data, ectiveness decreases

Attacks on Hash Functions Brute-Force Attacks u Does not depend on the specific algorithm, only depends on bit length u In the case of a hash function, attack depends only on the bit length of the hash value u Method is to pick values at random and try each one until a collision occurs Cryptanalysis u An attack based on weaknesses in a particular cryptographic algorithm u Seek to exploit some property of the algorithm to perform some attack other than an exhaustive search

SHA u Secure Hash Algorithm, developed by NIST u Standardized by NIST in FIPS 180 in 1993 u Improvements over time: SHA-0, SHA-1, SHA- 2,SHA-3 u SHA-1 (and SHA-0) are considered insecure; no longer recommended u SHA -2 known as SHA-224, SHA-256, SHA-384, and SHA-512. u SHA-3 in development, competition run by NIST

SHA Versions

SHA-512 Overview

12.24 Words Figure A message block and the digest as words

12.25 What is the number of padding bits if the length of the original message is 2590 bits? Example Solution We can calculate the number of padding bits as follows: The padding consists of one 1 followed by 353 0’s.

12.26 Do we need padding if the length of the original message is already a multiple of 1024 bits? Example Solution Yes we do, because we need to add the length field. So padding is needed to make the new block a multiple of 1024 bits.

Summary u Applications of cryptographic hash functions –Message authentication –Digital signatures –Other applications u Requirements and security –Security requirements for cryptographic hash functions –Brute-force attacks –Cryptanalysis