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

Slides:



Advertisements
Similar presentations
Hashes and Message Digests
Advertisements

Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
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.
Cryptography and Network Security Chapter 12
Cryptography and Network Security Hash Algorithms.
Cryptography and Network Security (CS435) Part Ten (Hash and MAC algorithms)
Kemal AkkayaWireless & Network Security 1 Department of Computer Science Southern Illinois University Carbondale CS 591 – Wireless & Network Security Lecture.
Cryptography and Network Security Chapter 11 Fourth Edition by William Stallings.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
CSCE 790: Computer Network Security Chin-Tser Huang University of South Carolina.
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.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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)
Cryptographic Hash Functions July Topics  Overview of Cryptography Hash Function  Usages  Properties  Hashing Function Structure  Attack on.
1 Message Authentication and Hash Functions Authentication Requirements Authentication Functions Message Authentication Codes Hash Functions Security of.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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:
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
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.
Hash and MAC Algorithms Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 12/3/2009 INCS 741: Cryptography 12/3/20091Dr. Monther Aldwairi.
Cryptographic Hash Functions June Topics  Overview of Cryptography Hash Function  Usages  Properties  Hashing Function Structure 
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
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.
Hash and MAC Functions CS427 – Computer Security
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
CSCE 815 Network Security Lecture 8 SHA Operation and Kerberos.
Chapter 4 Message Authentication MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI 1.
Data Security and Encryption (CSE348) 1. Lecture # 18 2.
Cryptographic Hash Functions and Protocol Analysis
Chapter 11 Message Authentication and Hash Functions.
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
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.
1 Chapter 12: Hash and MAC Algorithms Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal, U of Kentucky)
Cryptography and Network Security
Cryptographic Hash Functions Cryptographic Hash Functions 1. Applications of Cryptographic Hash Functions 2. Secure Hash Algorithm 3. Message Authentication.
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.
Hash Algorithms Ch 12 of Cryptography and Network Security - Third Edition by William Stallings Modified from lecture slides by Lawrie Brown CIM3681 :
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
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.
Chapter 12 – Hash Algorithms
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Cryptography and Network Security Chapter 11
Presentation transcript:

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

Chapter 11 – Cryptographic Hash Functions Each of the messages, like each one he had ever read of Stern's commands, began with a number and ended with a number or row of numbers. No efforts on the part of Mungo or any of his experts had been able to break Stern's code, nor was there any clue as to what the preliminary number and those ultimate numbers signified. —Talking to Strange Men, Ruth Rendell

Hash Functions  condenses arbitrary message to fixed size h = H(M)  usually assume hash function is public  hash used to detect changes to message  want a cryptographic hash function computationally infeasible to find data mapping to specific hash (one-way property) computationally infeasible to find data mapping to specific hash (one-way property) computationally infeasible to find two data to same hash (collision-free property) computationally infeasible to find two data to same hash (collision-free property)

Cryptographic Hash Function

Hash Function Uses  Message Integrity Check (MIC) send hash of message (digest) send hash of message (digest) MIC always encrypted, message optionally MIC always encrypted, message optionally  Message Authentication Code (MAC) send keyed hash of message send keyed hash of message MAC, message optionally encrypted MAC, message optionally encrypted  Digital Signature (non-repudiation) Encrypt hash with private (signing) key Encrypt hash with private (signing) key Verify with public (verification) key Verify with public (verification) key

Hash Functions & Message Authentication Symmetric Key Unkeyed Hash a)Message encrypted b) Message unencrypted

Hash Functions & Message Authentication Symmetric Key Keyed Hash a)Message unencrypted d) Message encrypted

Hash Functions & Digital Signatures - PKCS

Other Hash Function Uses  pseudorandom function (PRF) Generate session keys, nonces Generate session keys, nonces Produce key from password Produce key from password Derive keys from master key cooperatively Derive keys from master key cooperatively  pseudorandom number generator (PRNG) Vernam Cipher/OTP Vernam Cipher/OTP S/Key, proof of “what you have” via messages S/Key, proof of “what you have” via messages

More Hash Function Uses  to create a one-way password file store hash of password not actual password store hash of password not actual password e.g., Unix, Windows NT, etc. e.g., Unix, Windows NT, etc. salt to deter precomputation attacks salt to deter precomputation attacks Rainbow tables Rainbow tables  for intrusion detection and virus detection keep & check hash of files on system keep & check hash of files on system e.g., Tripwire e.g., Tripwire

Lamport One-time Passwords  Password safety in distributed system server compromise does not compromise P server compromise does not compromise P interception of authentication exchange does not compromise password either interception of authentication exchange does not compromise password either  Alice picks Password P A Hashes password N times, H N (P A ) Hashes password N times, H N (P A ) Server stores (Alice, N, H N (P A )) Server stores (Alice, N, H N (P A )) Attacker can’t get P A from H N (P A ) Attacker can’t get P A from H N (P A )

Lamport One-time Passwords  Protocol Alice sends “I’m Alice” Alice sends “I’m Alice” Server sends “N-1” Server sends “N-1” Alice sends “X” where X=H N-1 (P A ) Alice sends “X” where X=H N-1 (P A ) Server verifies H(X) = H N (P A ) Server verifies H(X) = H N (P A ) Server updates to (Alice, N-1, X) Server updates to (Alice, N-1, X)  Attacker still can’t get P A or authenticate as Alice

Two Simple Insecure Hash Functions  consider two simple insecure hash functions  bit-by-bit exclusive-OR (XOR) of every block C i = b i1 xor b i2 xor... xor b im C i = b i1 xor b i2 xor... xor b im a longitudinal redundancy check a longitudinal redundancy check reasonably effective as data integrity check reasonably effective as data integrity check  one-bit circular shift on hash value for each successive n-bit block for each successive n-bit block rotate current hash value to left by1bit and XOR blockrotate current hash value to left by1bit and XOR block good for data integrity but useless for security good for data integrity but useless for security

Hash Function Requirements

Attacks on Hash Functions  have brute-force attacks and cryptanalysis  a preimage or second preimage attack find y s.t. H(y) equals a given hash value find y s.t. H(y) equals a given hash value  collision resistance find two messages x & y with same hash so H(x) = H(y) find two messages x & y with same hash so H(x) = H(y)  hence value 2 m/2 determines strength of hash code against brute-force attacks 128-bits inadequate, 160-bits suspect 128-bits inadequate, 160-bits suspect

Birthday Attacks  might think a 64-bit hash is secure  but by Birthday Paradox is not  birthday attack works thus: given user prepared to sign a valid message x given user prepared to sign a valid message x opponent generates 2 m / 2 variations x’ of x, all with essentially the same meaning, and saves them opponent generates 2 m / 2 variations x’ of x, all with essentially the same meaning, and saves them opponent generates 2 m / 2 variations y’ of a desired fraudulent message y opponent generates 2 m / 2 variations y’ of a desired fraudulent message y two sets of messages are compared to find pair with same hash (probability > 0.5 by birthday paradox) two sets of messages are compared to find pair with same hash (probability > 0.5 by birthday paradox) have user sign the valid message, then substitute the forgery which will have a valid signature have user sign the valid message, then substitute the forgery which will have a valid signature  conclusion is that need to use larger MAC/hash

Birthday Attacks y y’ 1 y’ 2 … y’ j … y’ N x≠≠≠≠≠ x’ 1 ≠≠≠≠≠ x’ 2 ≠≠≠≠≠ … x’ i ≠≠≠ = ≠ … x’ N ≠≠≠≠≠ Find i and j such that H(y’ j )=H(x’ i ) Table takes O(N 2 ) time Faster … Sorted lists take O(NlogN) time

Birthday Attacks  What are chances we get a match?  N distinct values, k randomly chosen ones P(N,i) = prob(i randomly selected values from 1..N have at least one match) P(N,i) = prob(i randomly selected values from 1..N have at least one match) P(N,2) = 1/N P(N,2) = 1/N P(N,i+1) = P(N,i)+(1-P(N,i))(i/N) P(N,i+1) = P(N,i)+(1-P(N,i))(i/N)  For P(N,k)>0.5, need k ≈ N 1/2  Need double # bits in hash value

Hash Function Cryptanalysis  cryptanalytic attacks exploit some property of alg so faster than exhaustive search  hash functions use iterative structure process message in blocks (incl length) process message in blocks (incl length)  attacks focus on collisions in function f

Block Ciphers as Hash Functions  can use block ciphers as hash functions using H 0 =0 and zero-pad of final block using H 0 =0 and zero-pad of final block compute: H i = E M i [H i-1 ] compute: H i = E M i [H i-1 ] and use final block as the hash value and use final block as the hash value similar to CBC but without a key similar to CBC but without a key  resulting hash is too small (64-bit) both due to direct birthday attack both due to direct birthday attack and to “meet-in-the-middle” attack and to “meet-in-the-middle” attack  other variants also susceptible to attack

Block Ciphers as Hash Functions Block cipher key length B Pad Message M to multiple of B Break padded M into L blocks L = |M|/B M = M 1 M 2 … M L Use blocks of M as keys in block cipher, iteratively encrypt state value starting with constant H 0 resulting in hash value H = H L = E(M L,….E(M 2,E(M 1,H 0 ))…)

Secure Hash Algorithm  SHA originally designed by NIST & NSA in 1993  was revised in 1995 as SHA-1  US standard for use with DSA signature scheme standard is FIPS , also Internet RFC3174 standard is FIPS , also Internet RFC3174 nb. the algorithm is SHA, the standard is SHS nb. the algorithm is SHA, the standard is SHS  based on design of MD4 with key differences  produces 160-bit hash values  2005 results on security of SHA-1 raised concerns on its use in future applications

Revised Secure Hash Standard  NIST issued revision FIPS in 2002  adds 3 additional versions of SHA SHA-256, SHA-384, SHA-512 SHA-256, SHA-384, SHA-512  designed for compatibility with increased security provided by the AES cipher  structure & detail is similar to SHA-1  hence analysis should be similar  but security levels are rather higher

SHA Versions

SHA-512 Overview

SHA-512 Compression Function  heart of the algorithm  processing message in 1024-bit blocks  consists of 80 rounds updating a 512-bit buffer updating a 512-bit buffer using a 64-bit value Wt derived from the current message block using a 64-bit value Wt derived from the current message block and a round constant based on cube root of first 80 prime numbers and a round constant based on cube root of first 80 prime numbers

SHA-512 Round Function

SHA-3  SHA-1 not yet "broken” but similar to broken MD5 & SHA-0 but similar to broken MD5 & SHA-0 so considered insecure so considered insecure  SHA-2 (esp. SHA-512) seems secure shares same structure and mathematical operations as predecessors so have concern shares same structure and mathematical operations as predecessors so have concern  NIST announced in 2007 a competition for the SHA-3 next gen NIST hash function  Keccak winner Oct 2012 – std in Q2,2014

SHA-3 Requirements  replace SHA-2 with SHA-3 in any use so use same hash sizes so use same hash sizes  preserve the online nature of SHA-2 so must process small blocks (512 / 1024 bits) so must process small blocks (512 / 1024 bits)  evaluation criteria security close to theoretical max for hash sizes security close to theoretical max for hash sizes cost in time & memory cost in time & memory characteristics: such as flexibility & simplicity characteristics: such as flexibility & simplicity

Summary  have considered: hash functions hash functions uses, requirements, securityuses, requirements, security hash functions based on block ciphers hash functions based on block ciphers SHA-1, SHA-2, SHA-3 SHA-1, SHA-2, SHA-3