Cryptography Lecture 15.

Slides:



Advertisements
Similar presentations
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”
Advertisements

Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
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.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
1 Message authentication codes, modes of operation, and indifferentiability Kan Yasuda (NTT, Japan) ASK 2011 Aug. 31, Singapore.
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.
CS555Spring 2012/Topic 151 Cryptography CS 555 Topic 15: HMAC, Combining Encryption & Authentication.
CS555Spring 2012/Topic 141 Cryptography CS 555 Topic 14: CBC-MAC & Hash Functions.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
B504/I538: Introduction to Cryptography
Message Integrity and Message Authentication
Cryptographic hash functions
Cryptographic Hash Functions
Cryptographic Hash Function
Cryptographic Hash Functions
Topic 14: Random Oracle Model, Hashing Applications
NET 311 Information Security
Digital Signature Schemes and the Random Oracle Model
Cryptography Lecture 3.
Cryptographic Hash Functions Part I
Cryptography Lecture 13.
B504/I538: Introduction to Cryptography
Cryptography Lecture 12.
Cryptography Lecture 4.
ICS 454 Principles of Cryptography
Cryptography Lecture 16.
Cryptography Lecture 19.
Digital Signature Schemes and the Random Oracle Model
Cryptographic Hash Functions
Cryptography Lecture 6.
Cryptography Lecture 10.
CS/ECE 478 Introduction to Network Security
Chapter 11 – Message Authentication and Hash Functions
Cryptography Lecture 24.
Cryptography Lecture 14.
Data Integrity: Applications of Cryptographic Hash Functions
Cryptography Lecture 17.
ICS 454 Principles of Cryptography
Cryptography Lecture 12 Arpita Patra © Arpita Patra.
Cryptographic Hash Functions Part I
Hash-based Primitives Credits: Dr. Peng Ning and Dr. Adrian Perrig
Cryptography Lecture 4.
Cryptography Lecture 8.
Cryptography Lecture 14.
Cryptography Lecture 9.
Cryptography Lecture 12.
Lecture 4.1: Hash Functions, and Message Authentication Codes
Cryptography Lecture 7.
Cryptography Lecture 14.
Hashing Hash are the auxiliary values that are used in cryptography.
Cryptography Lecture 13.
Cryptography Lecture 3.
Cryptography Lecture 9.
Cryptography Lecture 22.
Cryptography Lecture 11.
Cryptography Lecture 16.
Cryptography Lecture 21.
Cryptography Lecture 13.
Cryptography Lecture 18.
Lecture 4: Hash Functions
Cryptography Lecture 25.
Hash Function Requirements
Cryptography Lecture 26.
Blockchains Lecture 4.
Presentation transcript:

Cryptography Lecture 15

Q and A; bring the written answers to TA before the class 1. What is random oracle model? Summarize it. 2. Hash function in the random oracle is powerful. It can be used to build all primitives we have seen so far. What are the constructions briefly? 3. Merkle trees are trade-offs between two extremes. What are the two extremes? Convince yourself why Merkle trees work

Random Oracle Model and Other applications of hash functions

Hash functions are ubiquitous Collision-resistance  “fingerprinting” Used as a one-way function Key derivation

Fingerprinting E.g., file integrity Assuming it is possible to get a reliable copy of H(x) for file x Note: different from integrity in the context of message-authentication codes

Outsourced storage How to outsource files to an untrusted server? x x h=H(x) x H(x)=?h

Outsourced storage x1, …, xn x1, …, xn hi =H(xi) i xi H(xi)=?hi O(n) client storage!

Outsourced storage x1, …, xn x1, …, xn h =H(x1, …, xn) i x1, …, xn H(x1, …, xn)=?h O(n|x|) communication!

Outsourced storage x1, …, xn x1, …, xn h =H(H(x1), …, H(xn)) i xi, h1, …, hn H(h1, …, H(xi), …, hn)=?h |xi| + O(n) communication!

Merkle tree Only store the root! Verify… x1 x2 x2 x3 x4 Only store the root! Verify… O(log n) communication/computation!

Outsourced storage Using a Merkle tree, we can solve the outsourcing problem with O(1) client storage and |x| + O(log n) communication

Secure Deduplication At the server side Hash the content to derive the key k = H(m) Then use the key to encryption m to get C=Ek(m) Same m leads to the same c. Cannot achieve “Chosen distribution attack” security, guaranteeing security only when m is random enough.

Password hashing Server stores H(pw) instead of pw Requires more than one-wayness of H… See later discussion on random oracles Salting… H(”salt”, pwd)

Commitment Scheme M Hiding: M is hidden given C. Binding: C can be only opened to M. M Commit Phase C = M Sender Receiver Reveal Phase Sender M Receiver

Commitment Scheme Use case: auction Commit(m): c=H(r||m) Reveal(c): return r and m

Key derivation Consider deriving a (shared) key from (shared) high-entropy information E.g., biometric data E.g., generating randomness Cryptographic keys must be uniform, but shared data is only high-entropy

Min-entropy Let X be a distribution The min-entropy of X (measured in bits) is H(X) = - log maxx { Pr[X=x] } I.e., if H(X) = n, then the probability of guessing x sampled from X is (at most) 2-n Min-entropy is more suitable for crypto than entropy

Key derivation Given shared information x (sampled from distribution X), derive shared key k=H(x) In what sense can we claim that k is a “good” (i.e., uniformly distributed) cryptographic key?

Recall security goal (To Introduce Random Oracle Model) Main goal is collision resistance Want optimal birthday security Also want preimage resistance, 2nd-preimage resistance Want optimal security here as well “Optimal” measured relative to a random function Why not design H to be a “random function”?

The random-oracle (RO) model Treat H as a public, random function Then H(x) is uniform for any x… …unless the attacker computes H(x) explicitly by querying x

Many applications One canonical example: key derivation

The random-oracle (RO) model Treat H as a public, random function Then H(x) is uniform for any x… …unless the attacker computes H(x)… …but the attacker cannot do that (with high probability) if X has high min-entropy!

The RO model Intuitively Assume the hash function “is random” Models attacks that are agnostic to the specific hash function being used Security in the real world as long as “no weaknesses found” in the hash function

The RO model Formally Choose a uniform hash function as part of the security experiment Attacker can only evaluate H via explicit queries to an oracle Simulate H for the attacker as part of the security proof/reduction

The RO model In practice Prove security in the RO model Instantiate the RO with a “good” hash function Hope for the best…

Pros and cons of the RO model There is no such thing as a public hash function that “is random” Not even clear what this means formally Known counterexamples There are (contrived) schemes secure in the RO model, but insecure when using any real-world hash function Sometimes over-abused (arguably)

Pros and cons of the RO model No known example of “natural” scheme secure in the RO model being attacked in the real world If an attack is found, just replace the hash Proof in the RO model better than no proof at all Evidence that the basic design principles are sound

PRF from Hash Function in the Random Oracle Model Fk(x) = H(k||x) Note that it does not use any computational assumption, but relies on H is a random oracle (which is already very strong).

Hash Functions can do all major cryptographic functions Export law (historically) Encryption forbidden HMAC was designed to circumvent this Not just MAC As shown in building PRF And therefore all sorts of major functions

Ideal-cipher model “Stronger” than the RO model! Model block cipher F: {0,1}n x {0,1}n  {0,1}n as a collection of public, independent, random permutations I.e., for each key k, Fk is a random permutation on {0,1}n

The ideal-cipher model This is more than assuming F is a PRP Fk random even when k is known! (No weak keys) (No related-key attacks) Formally, similar to the RO model In particular, the only way to evaluate F is via explicit oracle queries Attacker allowed to query F and F-1

Building a hash function Two-stage approach Build a compression function (from a block cipher) I.e., collision-resistant hash function for fixed-length inputs Build a full-fledged hash function from a compression function Other approaches are possible