Hash Functions Motivation Hash Functions: collision, pre-images SHA-1

Slides:



Advertisements
Similar presentations
Hash Functions A hash function takes data of arbitrary size and returns a value in a fixed range. If you compute the hash of the same data at different.
Advertisements

Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Digital Signatures and Hash Functions. Digital Signatures.
Foundations of Cryptography Lecture 5 Lecturer: Moni Naor.
22C:19 Discrete Structures Integers and Modular Arithmetic
Foundations of Cryptography Lecture 4 Lecturer: Moni Naor.
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CNS2010handout 10 :: digital signatures1 computer and network security matt barrie.
Lecturer: Moni Naor Foundations of Cryptography Lecture 4: One-time Signatures, UOWHFs.
Announcements: 1. HW6 due now 2. HW7 posted Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions.
Chapter 7-1 Signature Schemes.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Csci5233 Computer Security & Integrity 1 Cryptography: Basics (2)
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
Diffie-Hellman Key Exchange
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Merkle-Hellman Knapsack Cryptosystem Merkle offered $100 award for breaking singly - iterated knapsack Singly-iterated Merkle - Hellman KC was broken by.
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
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
Merkle-Hellman Knapsack Cryptosystem
CPS 290 Computer Security Network Tools Cryptography Basics CPS 290Page 1.
15-499Page :Algorithms and Applications Cryptography I – Introduction – Terminology – Some primitives – Some protocols.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
1 4.1 Hash Functions and Data Integrity A cryptographic hash function can provide assurance of data integrity. ex: Bob can verify if y = h K (x) h is a.
Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
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
Public Key Cryptography
Key Exchange References: Applied Cryptography, Bruce Schneier
CPS 512 Distributed Systems
DTTF/NB479: Dszquphsbqiz Day 26
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Cryptographic Hash Function
Network Tools Cryptography Basics
Introduction to security goals and usage of cryptographic algorithms
A way to detect a collision…
Topic 14: Random Oracle Model, Hashing Applications
Digital Signatures Last Updated: Oct 14, 2017.
Cryptographic Hash Functions Part I
ICS 454 Principles of Cryptography
CS 154, Lecture 6: Communication Complexity
Public Key Cryptography Diffie-Hellman, Discrete Log, RSA
Cryptography: Basics (2)
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
ICS 454 Principles of Cryptography
Digital Signatures.
DTTF/NB479: Dszquphsbqiz Day 27
Classical Ciphers – I Terminology CSCI284 Spring 2004 GWU Shift Cipher
El Gamal and Diffie Hellman
El Gamal and Diffie Hellman
Cryptographic Hash Functions Part I
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Chapter 3 - Public-Key Cryptography & Authentication
Introduction to Modern Cryptography
CSCI284 Spring 2009 GWU Sections 5.1, 5.2.2, 5.3
One Way Functions Motivation Complexity Theory Review, Motivation
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Network Tools Cryptography Basics
Chapter 8 roadmap 8.1 What is network security?
Presentation transcript:

Hash Functions Motivation Hash Functions: collision, pre-images SHA-1 CSCI284 Spring 2009 GWU

The problems crypto addresses Confidentiality/secrecy/privacy How to keep a message secret so it can be read only by a chosen person Use encryption Integrity How to determine a string of symbols has not been changed since it was created ? 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions Integrity Alice sends message x to Bob. She fears Oscar will manipulate it along the way, and Bob will get an incorrect message. She could encrypt it using a key Oscar did not have, but is that overkill when she does not need to prevent Oscar from reading it? But maybe she could tell Bob something else about the message so he would know if something was terribly wrong: parity, last bit, a particular bit, etc. 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

In general, she could use a hash function h: X  Y y = h(x) |X| > |Y| i.e.  x, x’ s.t x  x’ and h(x) = h(x’) Used in storage tables E.g.: h(x) = last bit, parity, smallest prime factor 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions h(x) sent with x Both Bob and Alice can create h(x) given x Alice sends (x, h(x)) Bob receives (x’,y’), he checks if y’ = h(x’). If so, he assumes x’ is what Alice sent 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

In either case, what can the attacker do? If he can compute h(x), he can: try to find x’ s.t. h(x) = h(x’). If he knows h, and can influence Alice, he can try to get her to send an x that she likes such that h(x) = h(x’) for an x’ he likes. If he doesn’t, he hopes for the best. 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Hence require an h “secure” in the following ways: Secure wrt second image requires that the following problem is “difficult”: Given an xX, find x’ X s.t x’  x but h(x’) = h(x) Secure wrt collision requires that the following problem is “difficult”: Find x, x’ X s.t x’  x but h(x’) = h(x) The above should be true even if h(x1), h(x2).. h(xn) are known 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

In general, h is a secure-hash It is also a one-way function: easy to compute in one direction, hard in the other. Is the following h secure wrt second image and collision? h: Zn X Zn  Zn h(x, y) = ax + by mod n h(x, y) = ax2 + by2 mod n 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions Easy? How does one define easy/difficult to compute? Using computational complexity theory By requiring a large time for the computation on any computer given a particular computational model For example, the probabilistic polynomial-time model 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Algorithm Find Pre-Image(h, y, q) choose any X0  X, | X0 | = q for each x  X0 if h(x) = y return (x) endfor return(failure) What is the complexity of this algorithm? What is its probability of success? 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Algorithm Find Second Pre-Image(h, x, q) y  h(x) choose any X0  X\{x}, | X0 | = q-1 for each x0  X0 if h(x0) = y return (x0) endfor return(failure) What is the complexity of this algorithm? What is its probability of success? 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Algorithm Find Collision (h, q) choose any X0  X, | X0 | = q for each x  X0 yx  h(x) endfor for all pairs (x, x’) if yx = yx’ return (x, x’) return(failure) 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Probability of success For a lower bound, can assume that sizes of pre-images are about equal, so that one pre-image is not very large - if it were, it would be very easy to have a collision in that pre-image. M = |Y| probability of no collisions = q-1i=1(1 - i/M) probability of at least one collision: (using e-x/M  1 -x/M) 1 - q-1i=1(1 - i/M)  1 - e-q(q-1)/2M 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions Allowed n, q For a given acceptable collision probability p, what is q in terms of M and p? p = 1 - q-1i=1(1 - i/M)  1 - e-q(q-1)/2M q  (2M ln(1/1-p)) For p = 0.5, q  1.17M if M = 365, q  23 and the probability of 2 people having the same birthday in a group of 23 people is more than 0.5 – Birthday attack/paradox 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

Complexities/Probability of success Find Pre-Image Success Probability: 1-(1-1/M)q  q/M Complexity: (q) Find Second Pre-Image Success Probability: 1-(1-1/M)q-1  q/M Find Collision Success Probability: 1 - q-1i=1(1 - i/M)  1 - e-q(q-1)/2M Complexity: (q2) 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions SHA-1 Pad given string x so that it is of length a multiple of 512 bits. Call this string y = M1||M2||…||Mn Iteratively calculate the hash of y using a hash function (known as the compression function) for 512 bits (hash is of length 160 bits) What is complexity of a birthday attack? 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions

CS284/Spring09/GWU/Vora/Hash Functions SHA-1 contd. current_hash = H0||H1||H2||H3||H4 for i=1, 2, ..n A||B||C||D||E|| = h(Mi, current_hash) H0+=A; H1+=B; … endfor 2/24/2019 CS284/Spring09/GWU/Vora/Hash Functions