Hashing (Message Digest). ............ ............ Hello There Hashing (Message Digest)

Slides:



Advertisements
Similar presentations
Lecture 5: Cryptographic Hashes
Advertisements

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”
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.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
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.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Csci5233 Computer Security & Integrity 1 Cryptography: Basics (2)
Hashing (Message Digest) Hello There.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
CRYPTOGRAPHIC DATA INTEGRITY ALGORITHMS
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.
Csci5233 Computer Security1 GS: Chapter 6 Using Java Cryptography for Authentication.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
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.
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.
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)
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
1 Network Security Lecture 5 Hashes and Message Digests Waleed Ejaz
Lecture 8 Overview. Secure Hash Algorithm (SHA) SHA SHA SHA – SHA-224, SHA-256, SHA-384, SHA-512 SHA-1 A message composed of b bits.
Cryptographic Hash Functions and Protocol Analysis
Lecture 2: Introduction to Cryptography
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Modern Cryptography.
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.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
Lecture 22 Network Security (cont) CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from Jim Kurose,
Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
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.
Chapter 12 – Hash Algorithms
Information and Computer Security CPIS 312 Lab 9
DTTF/NB479: Dszquphsbqiz Day 26
Message Integrity and Message Authentication
Information Security message M one-way hash fingerprint f = H(M)
Cryptographic hash functions
Cryptographic Hash Functions
Cryptographic Hash Function
Network Security.
PPP – Point to Point Protocol
Introduction to security goals and usage of cryptographic algorithms
A way to detect a collision…
Cryptographic Hash Functions
Information Security message M one-way hash fingerprint f = H(M)
Cryptography Lecture 13.
Cryptographic Hash Functions
SSL (Secure Socket Layer)
Information Security message M one-way hash fingerprint f = H(M)
Cryptography: Basics (2)
Network Security.
Cryptographic Hash Functions Part I
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Lecture 4.1: Hash Functions, and Message Authentication Codes
Cryptography Lecture 14.
Hashing Hash are the auxiliary values that are used in cryptography.
Cryptography Lecture 13.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Security: Integrity, Authentication, Non-repudiation
Hash Function Requirements
CRYPTOGRAPHY & NETWORK SECURITY
Chapter 8 roadmap 8.1 What is network security?
Blockchains Lecture 4.
Presentation transcript:

Hashing (Message Digest)

Hello There Hashing (Message Digest)

What not Hashing (Message Digest)

Hash Function – One way Needed properties for cryptographically secure hash: 1. Computationally infeasible to find the message that has given the hash 2. Should be highly improbable for two messages to hash to the same number (and to find two messages with the same hash). Message substitution computationally feasible otherwise

Hash Function – One way Why worry about two messages with same hashes? Application: integrity check, message substitution is possible Example: possible to find two different messages that have opposite meanings. AA gets assigned to write an firing employee that AA likes. will have hash integrity check. It will be checked by boss and then signed before being sent. I am writing {this memo} to {demand | request | inform you} that {Fred | Mr. Jones} {must} be {fired | terminated} {at once | immediately}. As the {July 11 | 11 July} {memo | memorandum} {from | issued by} {personnel | HR | Human Relations} states, to meet {our | the corporate} {quarterly | third quarter} budget {target | goal}, {we must.. I am writing {this letter | this memo | this memorandum | } to {officially} commend {Fred | Mr. Jones} for this {courage and independent thinking | independent thinking and courage}. {He | Fred | Mr. Jones} {clearly | } understands {the need | how} to get {the | his} job {done | accomplished} {at all costs | by whatever means necessary}, and {knows...

Hash Function – One way Appearance to a cracker: 1. Looking at output, any bit should be 1 about ½ the time Each output should have about ½ of its bits set to 1 3. Any two outputs should be uncorrelated no matter how similar the inputs are

Hash Function – One way Birthday Problem: Assume a hash function H that pretty much randomly maps an integer input to an integer output. Suppose the number of output values for H is k. Pick n input integers randomly. How large should n be so that the probability that at least one pair of input integers map to the same output is 1/2? Answer: Pr(some pair of inputs map to the same number) > ½ if n > √ 2k For k=365 days, n = 27

Hashing (Message Digest) Secret The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back

Hashing (Message Digest) The little brown fox jumped over the lazy dog's back Output

Hashing (Message Digest) Java: class SecureRandom – produces a cryptographically secure random number class MessageDigest – produces a hash of a number of bytes depending on the algorithm used (SHA, MD5, etc.) Cryptographically secure random number: 1. Given the first k bits of a CSPRN there is no efficient algorithm that will predict with probability better than 1/2 what the next bit will be 2. If information about a state of the computation is revealed at some point, it should be infeasible to produce the output bits that has been produced up to that point. If someone indexes into a published random sequence of bits – this point is violated.

Hashing - Authentication S S Client Server

Hashing - Authentication S S Client Challenge R Server

Hashing - Authentication S S Client Hash(S | R) Server

Hashing - Authentication S S Client Check Hash(S | R)? Server

Hashing - Authentication S S Client Challenge P Server

Hashing - Authentication S S Client Hash(S | P) Server

Hashing - Authentication S S Client Check Hash(S | P)? Server

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)).

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)). Unfortunately, attacker can append a message since s/he knows Hash(S | M) and the Hash algorithm.

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)). Unfortunately, attacker can append a message since s/he knows Hash(S | M) and the Hash algorithm. Try Hash(M | S). But then if the digest for two messages is the same, the MAC for both messages is the same – doesn't smell right.

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)). Unfortunately, attacker can append a message since s/he knows Hash(S | M) and the Hash algorithm. Try Hash(M | S). But then if the digest for two messages is the same, the MAC for both messages is the same – doesn't smell right. Try using only ½ of the bits of the digest – then attacker cannot append a message so easily – but the digest should be longer to compensate.

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)). Unfortunately, attacker can append a message since s/he knows Hash(S | M) and the Hash algorithm. Try Hash(M | S). But then if the digest for two messages is the same, the MAC for both messages is the same – doesn't smell right. Try using only ½ of the bits of the digest – then attacker cannot append a message so easily – but the digest should be longer to compensate. Try Hash(S | M | S).

Hashing - Message Integrity Try same as authentication except concatenate the message with the secret and pad (send Hash(S | M)). Unfortunately, attacker can append a message since s/he knows Hash(S | M) and the Hash algorithm. Try Hash(M | S). But then if the digest for two messages is the same, the MAC for both messages is the same – doesn't smell right. Try using only ½ of the bits of the digest – then attacker cannot append a message so easily – but the digest should be longer to compensate. Try Hash(S | M | S). HMAC, the winner: 1. Concatenate secret to front of message 2. Take the hash 3. Concatenate the secret to the front of the hash 4. Take the hash : Hash(S 1 | Hash(S 2 | M)) where S 1 and S 2 are derived from S

Hashing - Message Integrity HMAC, the winner: 1. Concatenate secret to front of message 2. Take the hash 3. Concatenate the secret to the front of the hash 4. Take the hash : Hash(S 1 | Hash(S 2 | M)) S 1 = S ⊕ constant 1, S 2 = S ⊕ constant 2 Reason: It has been shown that HMAC has the following properties: 1. It is infeasible to find two inputs that yield the same output 2. An attacker that does not know S cannot compute the proper digest involving S and M even if the attacker knows the digest involving S and M i for any M i such that M i is not the same as M Provided: the underlying hash function is secure (has the same properties)

Hashing - Encryption Secret The little brown fox jumped over the lazy dog's back Initialization Vector To receiver ⊕

Hashing - Encryption Secret The little brown fox jumped over the lazy dog's back ⊕

Hashing - Encryption Secret The little brown fox jumped over the lazy dog's back To receiver ⊕

Hashing - Encryption Secret The little brown fox jumped over the lazy dog's back ⊕

Hashing - Encryption Secret The little brown fox jumped over the lazy dog's back ⊕ To receiver