Cryptography: Lecture Notes 19
(1) there exists a PPT that on input x output f(x);
(2) There is a polynomial functions Q such that for every PPT algorithm A, and for sufficiently large k,
Pr
h
f(z) 6= y : x
$
← {0, 1}
k
; y ← f(x) ; z ← A(1
k
, y)
i
≥
1
Q(k)
The difference between the two definitions is that whereas we only require some non-negligible fraction of the
inputs on which it is hard to invert a weak one-way function, a strong one-way function must b e hard to invert
on all but a negligible fraction of the inputs. Clearly, the latter is preferable, but what if only weak one-way
functions exist ? Our first theorem is that the existence of a weak one way function implies the existence of a
strong one way function. Moreover, we show how to construct a strong one-way function from a weak one. This
is important in practice as illustarted by the following example.
Example 2.9 Consider for example the function f : Z × Z 7→ Z where f(x, y) = x · y. This function can be
easily inverted on at least half of its outputs (namely, on the even integers) and thus is not a strong one way
function. Still, we said in the first lecture that f is hard to invert when x and y are primes of roughly the same
length which is the case for a polynomial fraction of the k-bit composite integers. This motivated the definition
of a weak one way function. Since the probability that an k-bit integer x is prime is approximately 1/k, we get
the probability that both x and y such that |x| = |y| = k are prime is approximately 1 /k
2
. Thus, for all k ,
about 1 −
1
k
2
of the inputs to f of length 2k are prime pairs of equal length. It is believed that no adversary
can invert f when x and y are primes of the same length with non-negligible success probability, and under this
belief, f is a weak one way function (as condition 2 in the above definition is satisfied for Q(k) = O(k
2
)).
Theorem 2.10 Weak one way functions exist if and only if strong one way functions exist.
Proof Sketch: By definition, a strong one way function is a weak one way function. Now assume that f is a
weak one way function such that Q is the polynomial in condition 2 in the definition of a weak one way function.
Define the function
f
1
(x
1
. . . x
N
) = f (x
1
) . . . f(x
N
)
where N = 2kQ(k) and each x
i
is of length k.
We claim that f
1
is a strong one way function. Since f
1
is a concatenation of N copies of the function f, to
correctly invert f
1
, we need to invert f(x
i
) correctly for each i. We know that every adversary has a probability
of at least
1
Q(k)
to fail to invert f(x) (where the probability is taken over x ∈ {0, 1}
k
and the coin tosses of the
adversary), and so intuitively, to invert f
1
we need to invert O(kQ(k)) instances of f. The probability that the
adversary will fail for at least one of these instances is extremely high.
The formal proof (which is omitted here and will be given in appendix) will take the form of a reduction; that is,
we will assume for contradiction that f
1
is not a strong one way function and that there exists some adversary
A
1
that violates condition 2 in the definition of a strong one way function. We will then show that A
1
can be
used as a subroutine by a new adversary A that will be able to invert the original function f with probability
better than 1 −
1
Q(|x|)
(where the probability is taken over the inputs x ∈ { 0, 1}
k
and the coin tosses of A). But
this will mean that f is not a weak one way function and we have derived a contradiction.
This pro of technique is quite typical of proofs presented in this course. Whenever such a proof is presented it
is important to examine the cost of the reduction. For example, the construction we have just outlined is not
length preserving, but expands the size of the input to the function quadratically.
2.2.3 Non-Uniform One-Way Functions
In the above two definitions of one-way functions the inverting algorithm is probabilistic polynomial-time.
Stronger versions of both definitions require that the functions cannot be inverted even by non-uniform families