Cryptography Lecture 14
Other applications of hash functions
Hash functions are ubiquitous Collision-resistance “fingerprinting” Outsourced storage Used as a “random oracle” Used as a one-way function Password hashing Key derivation
Fingerprinting E.g., hash-and-MAC E.g., virus scanning E.g., deduplication 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
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 This implies collision resistance (if output is large enough) Much stronger than collision resistance
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 Different from a PRF Choose a uniform hash function as part of the security experiment Attacker can only evaluate H via explicit queries to an oracle Simulate H as part of the security proof Different from a PRF There is no key here
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 would mean, formally Known counterexamples There are (contrived) schemes secure in the RO model, but insecure when using any real-world hash function
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
Many applications of random oracles Password hashing Key derivation Will see many more in the context of public-key cryptography
Password hashing Server stores H(pw) instead of pw (Ignore “salting” here) Recovering pw from H(pw) in q tries should be as hard as guessing pw in q tries Even if the distribution of pw is nonuniform
Key derivation Consider deriving a (shared) key k from (shared) high-entropy information x E.g., biometric data 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 standard (Shannon) 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., uniform) cryptographic key? If H is a random oracle, then H(x) is uniform as long as the attacker does not query x to H …but the attacker cannot do that (with high probability) if X has high min-entropy!