Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecturer: Moni Naor Foundations of Cryptography Lecture 3: One-way on its Iterates, Authentication.

Similar presentations


Presentation on theme: "Lecturer: Moni Naor Foundations of Cryptography Lecture 3: One-way on its Iterates, Authentication."— Presentation transcript:

1 Lecturer: Moni Naor Foundations of Cryptography Lecture 3: One-way on its Iterates, Authentication

2 Recap of last week’s lecture One-way functions are essential to the two guard identification problem. –Important idea: simulation Examples of one-way functions –Subset sum, discrete log, factoring Weak one-way functions –Constructing strong one-way functions from weak one-way functions –Important ideas: hardness amplification ; reduction

3 From Weak to Strong One-way Functions Given – a function f that is guaranteed to be a weak one-way Let p(n) be such that Prob[A[f(x)]  f -1 (f(x)) ] ≤ 1-1/p(n) – can we construct a function g that is (strong) one-way? An instance of a hardness amplification problem Simple idea: repetition. For some polynomial q(n) define g(x 1, x 2,…, x q(n) )=f(x 1 ), f(x 2 ), …, f(x q(n) ) To invert g need to succeed in inverting f in all q(n) places –If q(n) = p 2 (n) seems unlikely (1-1/p(n)) p 2 (n) ≈ e -p(n) –But how to we show? Sequential repetition intuition – not a proof.

4 Want: Inverting g with low probability implies inverting f with high probability Given a machine B that inverts g want a machine B’ – operating in similar time bounds – inverts f with high probability Idea: given y=f(x) plug it in some place in g and generate the rest of the locations at random z=(y, f(x 2 ), …, f(x q(n) )) Ask machine B to invert g at point z Probability of success should be at least (exactly) B ’s Probability of inverting g at a random point Running B Once is not enough How to amplify? –Repeat while keeping y fixed –Put y at random position (or sort the inputs to g )

5 Proof of Amplification for Repetition of Two Concentrate on two-repetition: g(x 1, x 2 ) = f(x 1 ), f(x 2 ) Goal: show that the probability of inverting g is roughly squared the probability of inverting f just as would be sequentially Claim: Let  (n) be a function that for some p(n) satisfies 1/p(n) ≤  (n) ≤ 1-1/p(n) Let ε (n) be any inverse polynomial function Suppose that for every polynomial time A and sufficiently large n Prob[A[f(x)]  f -1 (f(x)) ] ≤  (n) Then: for every polynomial time B and sufficiently large n Prob[B[g(x 1, x 2 )]  g -1 (g(x 1, x 2 )) ] ≤  2 (n) + ε(n)

6 Proof of Amplification for Two Repetition Given a better than  2 +ε algorithm B for inverting g construct the following B’ for inverting f : B’(y): Inversion algorithm for f –Repeat t times Choose x’ at random and compute y’=f(x’) Run B(y,y’). Check the results If correct: Halt with success –Output failure Inner loop Helpful for constructive algorithm

7 Probability of Success Define S={y=f(x) | Prob[Inner loop successful| y ] > β } Since the choices of the x’ ’s are independent of each other Prob[B’ succeeds|y  S] > 1-(1- β ) t Taking t= n/ β means that when y  S, then almost surely B’ will succeed in inverting it Hence want to show that Prob[y  S] >  (n) –Probability is over the choice of x

8 The success of B Fix the random bits of B. Define P={(y 1, y 2 )| B succeeds on (y 1,y 2 )} y1y1 y2y2 P P= P ⋂ {( y 1,y 2 )| y 1,y 2  S} ⋃ P ⋂ {( y 1,y 2 )| y 1  S} ⋃ P ⋂ {( y 1,y 2 )| y 2  S} Well behaved part Want to bound P by a square Behaves as in independent choices

9 S is the only success... But Prob[B[y 1, y 2 ]  g -1 (y 1, y 2 ) | y 1  S ] ≤ β and similarly Prob[B[y 1, y 2 ]  g -1 (y 1, y 2 ) | y 2  S ] ≤ β So Prob[(y 1, y 2 )  P and y 1,y 2  S ] ≥ Prob[(y 1, y 2 )  P ] - 2 β ≥  2 + ε - 2 β Setting β =ε/3 we have Prob[(y 1, y 2 )  P and y 1,y 2  S ] ≥  2 + ε /3

10 Contradiction But Prob[(y 1, y 2 )  P and y 1,y 2  S ] ≤ Prob[y 1  S ] Prob[y 2  S ] = Prob 2 [y  S ] So Prob[y  S ] ≥ √(α 2 + ε/3) > α

11 Is there an ultimate one-way function? aka `universal’ Do not know : P≠NP implies the existence of one-way functions, Can we show a specific function f so that if some one-way exists, then f is one-way? If f 1 :{0,1} * → {0,1} * and f 2 :{0,1} * → {0,1} * are guaranteed to: –Be polynomial time computable –At least one of them is one-way. then can construct a function g:{0,1} * → {0,1} * which is one- way: g(x 1, x 2 ) = (f 1 (x 1 ),f 2 (x 2 )) Robust Combiner Can generalizes to a 1 -out- m combiner

12 The Construction If a 5n 2 time one-way function is guaranteed to exist, can construct an O(n 2 log n) one-way function g : – Idea: enumerate all Turing Machines and make sure they run at most 5n 2 steps g(x 1, x 2,…, x log (n) )=M 1 (x 1 ), M 2 (x 2 ), …, M log n (x log (n) ) – Eventually : get to the TM of the one-way function If a one-way function is guaranteed to exist, then there exists a 5n 2 time one-way: – Idea: concentrate on the prefix, ignore the rest n’ where n=p(n’) A function that takes that much time to compute

13 Ultimate one-way function conclusions Original proof due to L. Levin Be careful what you wish for Problem with resulting one-way function: –Cannot learn about behavior on large inputs from small inputs –Whole rational of considering asymptotic results is eroded! Construction does not work for non-uniform one-way functions Notion of robust combiner seems fundamental –See “Robust Combiners for Oblivious Transfer and Other Primitives” by Harnik, Kilian, Naor, Reingold and Rosen, Eurocrypt 2005

14 Distributionally One-Way Functions A function f:{0,1}*  {0,1}* is one-way if: –it is computable in poly-time –the probability of successfully finding an inverse in poly-time is negligible (on a random input) A function f :{0,1}*  {0,1}* is distributionally one-way if: –it is computable in poly-time –No poly-time algorithm can successfully find a random inverse (on a random input) Distribution on inverting algorithm far from uniform on the pre-images Theorem [Impagliazzo Luby 89]: distributionally one-way functions exist iff one-way functions exists Example: function from two guards problem

15 Identification - many times Alice would want to send an `approve’ message to Bob many times. They want to prevent Eve from interfering –Bob should be sure that Alice indeed approved each time. How to specify? Alice Bob Eve

16 Specification of the Problem Alice and Bob communicate through a channel C Bob has an external counter C (# of times Alice approved) Eve completely controls the channel Requirements: CIf Alice wants to approve and Eve does not interfere – Bob increases the counter C CThe number of times Alice approves is a bound the value of counter C CIf Alice wants to approve and Eve does interfere - no requirements from the counter C until there is a quiescent period – A time that Alice wants to approve and Eve does not interfere Not the only possible specification! Can mandate that an approval was sent since the last time counter increased

17 Solution to the many time identification problem Let k be an upper bound on the number of identifications If Alice and Bob share in the setup phase k passwords Each time Alice want to `approve’ she sends the next unused password. –In the i th time: y i Bob compare with the next password on the list Can they do it with sharing less than k passwords? y 1, y 2, …, y k

18 Giving y instead of x may turn out to be dangerous… Compressing the list Assume that –f is a one-way function –Let k be an upper bound on the number of identifications Setup phase: Alice chooses x  {0,1} n, defines a sequence Where y i =f (k-i) (x) Gives Bob x When Alice wants to approve for the i th time: send the special symbol $ followed by i and y i =f (k-i) (x) Bob stores x; Set C Ã 0 If Bob gets a $ followed by symbols on channel –denote them (j,z) ; –Compare j to C; reject if j ≤ C. –Check whether z=f (k-j) (x) If equal Set C Ã j y 1, y 2, … y k =x

19 Is it secure? Need care in choosing f Should be difficult to invert any one of the iterated instances of f

20 One-way on its iterates A function f: {0,1} n → {0,1} n is called one-way on its iterates, if f is a polynomial-time computable function for every probabilistic polynomial-time algorithm A, every polynomial p( ¢ ), and all sufficiently large n ’s: for all k ≤ p(n) Prob[A[f (k) (x)]  f -1 (f (k) (x)) ] ≤ 1/p(n) Where x is chosen uniformly in {0,1} n and the probability is also over the internal coin flips of A From homework: not all one-way functions are one-way on their iterates Every one-way permutation is one-way on its iterates Subset sum function one-way on its iterates –If it one-way then it is one-way of its iterates If you start at a random point and iterate – still random

21 Example: the squaring function (Rabin) f(x,N)= (x 2 mod N,N) Quadratic residue mod a prime: If s and r satisfy s=r 2 mod P then s is called a quadratic residue modulo P If P is a prime then: – s=r 2 mod P has exactly two solutions mod P if 0<s<P. Can denote +/-r – quadratic residues: multiplicative subgroup with (P-1)/2 elements. –If P=1 mod 4 then -1 is a quadratic residue mod P. Both square-roots are either quadratic residues or non residues –If P=3 mod 4 then -1 is a non-quadratic residue mod P. One square-roots is a quadratic residue, the other not. Squaring mod P is a permutation on the quadratic residues! Computing square-roots: if r=s (p+1)/4 mod P square, then r 2 =s (p+1)/2 =s∙s (p-1)/2 = +/- s mod P If N=P∙Q then s is a quadratic residue modulo N if and only it is a quadratic residue for both P and Q If N=P∙Q where P,Q = 3 mod 4 - called Blum Integers –Each quadratic residue has 4 square-roots –Exactly one of which is quadratic residue in itself –Squaring mod N is a permutation on the quadratic residues!

22 Finding Square-roots and factoring are equivalent If know the factorization of N=P∙Q, then can compute square-roots If there is a procedure that computes square-roots correctly for non-negligible fraction – can boost it –Random self reducibility If we know (r,t) such that – s=r 2 =t 2 mod N –r =t mod P –r ≠ t mod Q Then we can factor by computing GCD(t-r,N) Homework: show how to use a square-root computing routine to factor while preserving the probability of success.

23 A one-way on its iterates function To fully specify the function – need a starting procedure for generating – N=P∙Q where P,Q=3 mod 4 –Easy to specify given deterministic primality testing (even probabilistic is sufficient) density of primes –A quadratic residue mod N Easy by generating a random square Resulting function – one-way on its iterates

24 Giving y instead of x may turn out to be dangerous… Back to the compressing the list Assume that –f is a one-way function –Let k be an upper bound on the number of identifications Setup phase: Alice chooses x  {0,1} n, defines a sequence Where y i =f (k-i) (x) Gives Bob x When Alice wants to approve for the i th time: send the special symbol $ followed by i and y i =f (k-i) (x) Bob stores x; Set C Ã 0 If Bob gets a $ followed by symbols on channel –denote them (j,z) ; –Compare j to C; reject if j ≤ C. –Check whether z=f (k-j) (x) If equal Set C Ã j y 1, y 2, … y k =x

25 Security of scheme If scheme can be broken: There is the first time where Eve sent a false value z as y i By the specification of the protocol: –If Eve substitutes a value y i which was sent by Alice with her own z – she is caught Hence first false z is also an attempt to forge: Alice approved only i- 1 times but Eve convinced Bob to accepts i times If probability of breaking is at least 1/p(n) There is a j ≤ k where Eve does this with probability at least 1/kp(n) Important idea: Existence of a large step Two possible evil actions: Substitute a correct value Invent a value, forge To forge: Eve must invert y i-1

26 …Security of scheme For this j: can break the (k-j-1) th iterate of f with probability at least 1/kp(n) – Given y j-1 = f (k-j-1) (x) compute y 1 =f (j-1) (y j-1 ), y 2 =f (j-2) (y j-1 ), …, y j-2 =f(y j-1 ), y j-1 and simulate the adversary for j rounds Can send the expect values from Alice –Adversary sees exactly the same distribution as in real life Forging at step j must be done by inverting y j-1 Hence probability adversary succeeds in forgery at step j is at least 1/kp(n) From such a success: can invert the (k-j-1) th iterate of f on x

27 Problems with the scheme Need to know an upper bound k on the number of identifications Need to perform work proportional to k before first identification (what if it flops) Total work (in all k sessions) by Alice: O(k 2 ) –For Bob, if stores last value: O(k) –If Alice stores all k values y j : total work (in all k sessions) only O(k) – Homework : how can Alice store O(log k) values and perform amortized O(log k) work More problems: –need to maintain state, both Alice and Bob (in addition to the counter) –What happens when there are two verifiers

28 Possible Pitfalls: why give x and not y If Bob does not check from scratch Alternative protocol: Bob knows y 0 =f (k) (x) To verify at step i : Bob computes f (i) (z) and compares to y 0 then: Eve might substitute y j with a value z which she can invert in subsequent sessions. –If possible to find “ easy siblings ” could be dangerous – Homework: show that there is a function f that is One-way on its iterates Given x it is easy to find x' such that f(x)=f(x’) and it is easy to invert f on x’

29 Question Is it possible to have a protocol based on a function that it one-way on its iterates without bob maintaining a state?

30 Want a scheme with unlimited use If we have a function that only Alice can compute but both Bob and Charlie can verify Alice can compute for session number i the value f(i) Problem: interleaving of verifiers – can replay Solution: challenge response –Verifier chooses a random nonce r and asks to see f(r) To be continued!

31 The authentication problem one-time version Alice would want to send a message m  {0,1} n to Bob They want to prevent Eve from interfering –Bob should be sure that the message m’ he receives is equal to the message m Alice sent Alice Bob Eve m

32 Specification of the Problem Alice and Bob communicate through a channel N Bob has an external register R  N (no message) ⋃ {0,1} n Eve completely controls the channel Requirements: R Completeness : If Alice wants to send m  {0,1} n and Eve does not interfere – Bob has value m in R Soundness : If Alice wants to send m and Eve does interfere –RN –R is either N or m (but not m’ ≠ m ) RN –If Alice does not want to send a message R is N Since this is a generalization of the identification problem – must use shared secrets and probability or complexity Probabilistic version: N for any behavior from Eve, for any message m  {0,1} n, the probability that Bob is in state m’ ≠ m or N is at most ε

33 Authentication using hash functions Suppose that – H= {h| h: {0,1} n → {0,1} k } is a family of functions – Alice and Bob share a random function h  H –To authenticate message m  {0,1} n Alice sends (m,h(m)) –When receiving (m’,z) Bob computes h(m’) and compares to z RIf equal, moves register R to m’ R NIf not equal, register R stays in N What properties do we require from H –hard to guess h(m’) - at most ε But clearly not sufficient: one-time pad. –hard to guess h(m’) even after seeing h(m) - at most ε Should be true for any m’ –Short representation for h - must have small log|H| –Easy to compute h(m) given h and m

34 Universal hash functions Given that for h  H we have h: {0,1} n → {0,1} k we know that ε≥2 -k A family where this is an equality is called universal 2 Definition : a family of functions H= {h| h: {0,1} n → {0,1} k } is called Strongly Universal 2 or pair-wise independent if: – for all m 1, m 2  {0,1} n and y 1, y 2  {0,1} k we have Prob[h(m 1 ) = y 1 and h(m 2 ) = y 2 ] = 2 -2k Where the probability is over a randomly chosen h  H In particular Prob[h(m 2 ) = y 2 | h(m 1 ) = y 1 ] = 2 -k Theorem : when a strongly universal 2 family is used in the protocol, Eve’s probability of cheating is at most 2 -k

35 Constructing universal hash functions The linear polynomial construction: fix a finite field F of size at least the message space 2 n –Could be either GF[2 n ] or GF[P] for some prime P ≥ 2 n The family H of functions h: F → F i s defined as H= {h a,b (m) = a∙m + b | a, b  F} Claim : the family above is strongly universal 2 Proof: for every m 1 ≠m 2, y 1, y 2  F there are unique a, b  F such that a∙m 1 +b = y 1 a∙m 2 +b = y 2 Size: each h  H represented by 2n bits

36 Constructing universal hash functions The inner product construction: fix a finite field F of size at least the target space 2 k –Could be either GF[2 k ] or GF[P] for some prime P ≥ 2 k Let n= ℓ ∙ k Treat each message m  {0,1} n as an (ℓ +1) -vector over F where the first entry is 1. Denote by (m 0, m 1, …,m ℓ ) The family H of functions h: F ℓ → F defined by all (ℓ+1) -vectors a=(a 0, a 1, …,a ℓ ) H= {h a (m)= ∑ i=0 ℓ a i ∙m i | a 0, a 1, …,a ℓ  F} Claim : the family above is strongly universal 2 Proof: for every (m 0, m 1, …,m l ), (m’ 0, m’ 1, …,m’ l ) y 1, y 2  F there are the same number of solutions to ∑ i=0 ℓ a i ∙m i = y 1 ∑ i=0 ℓ a i ∙m’ i = y 2 Size: each h  H represented by n+k bits

37 Lower bound on size of strongly universal hash functions Theorem : let H= {h| h: {0,1} n → {0,1} } be a family of pair-wise independent functions. Then |H| is Ω(2 n ) More precisely, to obtain a d -wise independence family |H| should be Ω(2 n └ d/2 ┘ ) Theorem : see N. Alon and J. Spencer, The Probabilistic Method Chapter 15 on derandomization, proposition 2.3

38 An almost perfect solution By allowing ε to be slightly larger than 2 -k we can get much smaller families Definition : a family of functions H= {h| h: {0,1} n → {0,1} k } is called δ- Universal 2 if for all m 1, m 2  {0,1} n where m 1 ≠ m 2 we have Prob[h(m 1 ) = h(m 2 ) ] ≤ δ Properties: Strongly-universal 2 implies 2 -k - Universal 2 Opposite not true: the function h(x) = x …

39 An almost perfect solution Idea : combine a family of δ- Universal 2 functions H 1 = {h| {0,1} n → {0,1} k } with a Strongly Universal 2 family H 2 = {h| {0,1} k → {0,1} k } Consider the family H where each h  H is {0,1} n → {0,1} k and is defined by h 1  H 1 and h 2  H 2 h(x) = h 2 (h 1 (x)) As before Alice sends m, h(m) Claim : probability of cheating is at most δ + 2 -k Proof: when Eve sends m’, y’ we must have m ≠ m ‘ but either –y’ = h(m), which means that Eve succeeds with probability at most δ + 2 -k Collision in h 1 Or in h 2 Or –y’ ≠ h(m) which means that Eve succeeds with probability at most 2 -k Collision in h 2 Size: each h  H represented by log |H 1 |+ log |H 2 |

40 Constructing almost universal hash functions The polynomial evaluation construction {0,1} n → {0,1} k : fix a finite field F of size at least the target space 2 k –Could be either GF[2 k ] or GF[P] for some prime P ≥ 2 k Let n= ℓ∙ k Treat each (non-zero) message m  {0,1} n as a degree (ℓ-1) -polynomial over F. Denote by P m. The family H of functions h: F ℓ → F is defined by all elements in F : H= {h x (m)= P m (x)| x  F} Claim : the family above is δ- Universal 2 for δ= (ℓ-1)/2 k Proof: the maximum number of points where two different degree (ℓ-1) polynomials agree is ℓ-1 Size: each h  H represented by k bits m

41 Composing universal hash functions Concatenation Let H where each h  H is {0,1} n → {0,1} k be a family of δ- Universal 2 functions Consider the family H’ where each h’  H’ is {0,1} 2n → {0,1} 2k and where h’(x 1,x 2 ) = h(x 1 ), h(x 2 ) for some h  H Claim : the family above is δ- Universal 2 Proof: let x 1, x 2 and x’ 1, x’ 2 be a pair of inputs. If x 1 ≠ x’ 1 collision must occur in first part h(x 1 )=h( x’ 1 ) Else, x 2 ≠ x’ 2 and collision must occur in second part h(x 2 )=h( x’ 2 ) In either case the probability is at most δ

42 Composing universal hash functions Composition Let H 1 = {h| h:{0,1} n 1 → {0,1} n 2 } with H 2 = {h| h: {0,1} n 2 → {0,1} n 3 } be families of δ- Universal 2 functions Consider the family H where each h  H is {0,1} n 1 → {0,1} n 3 is defined by h 1  H 1 and h 2  H 2 h(x) = h 2 (h 1 (x)) Claim : the family above is 2 δ- Universal 2 Proof: the collision must occur either at the first hash function or the second hash function. Each event happens with probability at most δ and we apply the union bound n2n2 n1n1 n3n3

43 The Tree Construction h1h1 h2h2 h3h3 Set n= ℓ ∙k. E ach h i :{0,1} 2k → {0,1} k is chosen independently from a δ - Universal family H. The result is a family of functions {0,1} n → {0,1} k which is tδ - Universal t is the number of levels in the tree Size: t log |H| m Can construct functions from huge domains

44 Homework Given ε,n what is the number of bits needed to specify an authentication scheme? Bonus : Can interaction help? –Can the number of shared secret bits be smaller than in a unidirectional scheme –Can the number of shared bits depend on ε only?

45 What about the public-key problem? Recall: Bob and Charlie share the set-up phase information Is it possible to satisfy the requirements: R – Completeness : If Alice wants to send m  {0,1} n and Eve does not interfere – Bob has value m in R – Soundness : If Alice wants to send m and Eve and Charlie do interfere RNR is either N or m (but not m’ ≠ m ) RNIf Alice does not want to send a message R is N Who chooses which m Alice will want to approve? –Adversary does. This is a chosen message attack As before: complexity to the rescue


Download ppt "Lecturer: Moni Naor Foundations of Cryptography Lecture 3: One-way on its Iterates, Authentication."

Similar presentations


Ads by Google