Cryptographic hash functions

Slides:



Advertisements
Similar presentations
Lecture 5: Cryptographic Hashes
Advertisements

CSC 774 Advanced Network Security
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”
CSC 774 Advanced Network Security
A Framework for Secure Data Aggregation in Sensor Networks Yi Yang Xinran Wang, Sencun Zhu and Guohong Cao The Pennsylvania State University MobiHoc’ 06.
SIA: Secure Information Aggregation in Sensor Networks Bartosz Przydatek, Dawn Song, Adrian Perrig Carnegie Mellon University Carl Hartung CSCI 7143: Secure.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
DSAC (Digital Signature Aggregation and Chaining) Digital Signature Aggregation & Chaining An approach to ensure integrity of outsourced databases.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
DSAC (Digital Signature Aggregation and Chaining) Digital Signature Aggregation & Chaining An approach to ensure integrity of outsourced databases.
CS526Topic 5: Hash Functions and Message Authentication 1 Computer Security CS 526 Topic 5 Cryptography: Cryptographic Hash Functions And Message Authentication.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Indexing and Hashing (emphasis on B+ trees) By Huy Nguyen Cs157b TR Lee, Sin-Min.
Cong Wang1, Qian Wang1, Kui Ren1 and Wenjing Lou2
David Evans CS150: Computer Science University of Virginia Computer Science Class 31: Cookie Monsters and Semi-Secure.
EE515/IS523 Think Like an Adversary Lecture 4 Crypto in a Nutshell Yongdae Kim.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
Slide 1 EJ Jung Hash Functions. Integrity checks.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
SIA: Secure Information Aggregation in Sensor Networks B. Przydatek, D. Song, and A. Perrig. In Proc. of ACM SenSys 2003 Natalia Stakhanova cs610.
Merkle trees Introduced by Ralph Merkle, 1979 An authentication scheme
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Modern Cryptography.
1 Message authentication codes, modes of operation, and indifferentiability Kan Yasuda (NTT, Japan) ASK 2011 Aug. 31, Singapore.
Lecture 5.1: Message Authentication Codes, and Key Distribution
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.
Hashes Lesson Introduction ●The birthday paradox and length of hash ●Secure hash function ●HMAC.
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 11 Message Integrity and Message Authentication.
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.
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.
Hashing (Message Digest) Hello There Hashing (Message Digest)
Topic 26: Discrete LOG Applications
Message Integrity and Message Authentication
Security of Message Digests
Computer Security CS 526 Topic 4
A secure and traceable E-DRM system based on mobile device
Cryptographic Hash Functions
Cryptographic Hash Function
COSC160: Data Structures Linked Lists
Digital signatures.
Cryptographic Hash Functions
Topic 14: Random Oracle Model, Hashing Applications
Computer Security CS 526 Topic 4
Chapter Trees and B-Trees
Chapter Trees and B-Trees
Introduction to modern cryptology
The Hash Function Dr. Ron Eaglin.
Cryptographic Hash Functions Part I
Cryptography Lecture 13.
B504/I538: Introduction to Cryptography
Cryptography Lecture 19.
Cryptographic Hash Functions
Cryptography Lecture 14.
Data Integrity: Applications of Cryptographic Hash Functions
Cryptographic Hash Functions Part I
Cryptography Lecture 14.
Lecture 4.1: Hash Functions, and Message Authentication Codes
COMPUTER NETWORKS PRESENTATION
Computer Security CS 526 Topic 5
Cryptography Lecture 14.
Cryptography Lecture 13.
Cryptography Lecture 13.
Cryptography Lecture 15.
Path Oram An Extremely Simple Oblivious RAM Protocol
Cryptography Lecture 26.
Blockchains Lecture 4.
Presentation transcript:

Cryptographic hash functions

Definition of hash function 𝐻≔ {ℎ 1 ,…, ℎ 𝑚 } ℎ 𝑖 : 0,1 𝑛 → 0,1 ℓ(𝑛) Compression : ℓ 𝑛 <𝑛 𝐺𝑒𝑛 1 𝑠 picks an index between 1 and m.

Collision resistance i 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) 𝑥,𝑥′ 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 = ℎ 𝑖 (𝑥′)

Second-collision resistant 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) 𝑥 ∈ 𝑅 0,1 𝑠 𝑖,𝑥 𝑥′ 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 = ℎ 𝑖 (𝑥′)

Preimage resistance 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) y ∈ 𝑅 0,1 ℓ(𝑠) 𝑖,𝑦 𝑥 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 =𝑦

Comparison between different security 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) 𝑥 ∈ 𝑅 0,1 𝑠 𝑖←𝑔𝑒𝑛({ 1} 𝑠 ) y ∈ 𝑅 0,1 ℓ(𝑠) 𝑖,𝑥 𝑖,𝑦 𝑥,𝑥′ 𝑥′ 𝑥 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 = ℎ 𝑖 (𝑥′) 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 = ℎ 𝑖 (𝑥′) 𝑤𝑖𝑛𝑠 if ℎ 𝑖 𝑥 =𝑦 𝑡𝑎𝑟𝑔𝑒𝑡−𝑐𝑜𝑙𝑙𝑖𝑠𝑖𝑜𝑛 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑝𝑟𝑒𝑖𝑚𝑎𝑔𝑒 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑡 𝑐𝑜𝑙𝑙𝑖𝑠𝑖𝑜𝑛 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑡

Birthday attack What is the probability that in a class of 23 people there are at least two people with the same birthday. Answer: more than 50% chance General question: Suppose you sample m values from n values, what is the probability that there exists at least two values that are the same. Answer: if 𝑚= 𝑛 then probability is about one-half

Proof of the birthday attack If you store 𝑛 output with a given input the probability that a new input gets sent to a previously visited output is 1/ 𝑛 The probability that 𝑛 elements all get mapped to fresh output is 1− 1 𝑛 𝑛 ≥1/𝑒

Mac using hash functions 𝑚 𝐻 𝑖 𝑚𝑎𝑐 𝑘

HMAC Global constants 𝑣 1 , 𝑣 2 Gen Auth(m) 𝑠←𝐺𝑒𝑛 1 𝑠 𝑘 ∈ 𝑅 0,1 𝑠 𝑠←𝐺𝑒𝑛 1 𝑠 𝑘 ∈ 𝑅 0,1 𝑠 Auth(m) 𝑤 1 ←(𝑘⊕ 𝑣 2 ,𝑚) 𝑤 2 ← 𝐻 𝑠 𝑤 1 𝑤 3 ←(𝑘⊕ 𝑣 1 , 𝑤 1 ) 𝑡←𝐻( 𝑤 3 )

Random oracle heuristic Assume that a hash function acts as a random function Allows us to prove security for efficient schemes Unsound but Only for contrived example Never broken for practical schemes

Applications of hash functions Virus fingerprinting Deduplication Password hashing File changes/integrity

Virus fingerprinting Hash the virus using the hash function To lookup a virus, simply look at the output of the function and see if it maps to a known virus False positives imply collision

Deduplication Avoid storing the same thing in memory many times Uses hash function to index values so that we don’t need to copy the same thing many times.

File changes / integrity To keep track of changes, we keep a list of hash for every function The output of the hash function can be much shorter than the size of the files

Proper way to hash passwords Naïve way to hash passwords ℎ←𝐻(𝑝𝑤𝑑) Same password hashed to same value Correct way to hash a password 𝑟 ∈ 𝑅 0,1 𝑛 ℎ←𝐻 𝑟,𝑝𝑤𝑑 (𝑟,ℎ)

Bad way to hash passwords (xkcd)

Hash tree Goal Client has constant overhead Server holds client’s database 𝑥 1 ,…, 𝑥 𝑛 Client requests 𝑥 𝑖 Server sends 𝑥′ 𝑖 How can client verify that 𝑥′ 𝑖 = 𝑥 𝑖 with only logarithmic overhead

Hash tree 𝐿𝑒𝑎 𝑓 𝑖 = 𝐻𝑎𝑠ℎ(𝐹𝑖𝑙 𝑒 𝑖 ) Non-leaf node 𝐿𝑒𝑎 𝑓 𝑖 = 𝐻𝑎𝑠ℎ(𝐹𝑖𝑙 𝑒 𝑖 ) Non-leaf node Hash(Hash(node.left) || Hash(node.right)) Client only need to store the root To prove that a given file is correct, the server only needs to send the client hashes of nodes that follow the path from the given leaf to the root node.