One-way function

566pages on
this wiki
Add New Page
Talk0 Share

In computer science, a one-way function is a function that is easy to compute on every input, but hard to invert given the image of a random input. Here "easy" and "hard" are to be understood in the sense of computational complexity theory, specifically the theory of polynomial time problems. Not being one-to-one is not considered sufficient of a function for it to be called one-way (see Theoretical Definition, below).

The existence of such one-way functions is still an open conjecture. In fact, their existence would prove that the complexity classes P and NP are distinct, thus resolving the foremost unsolved question of theoretical computer science.[1]Template:RpTemplate:Page needed

In applied contexts, the terms "easy" and "hard" are usually interpreted relative to some specific computing entity; typically "cheap enough for the legitimate users" and "prohibitively expensive for any malicious agents". One-way functions, in this sense, are fundamental tools for cryptography, personal identification, authentication, and other data security applications. While the existence of such functions too is an open conjecture, there are several candidates that have withstood decades of intense scrutiny. Some of them are essential ingredients of most telecommunications, e-commerce, and e-banking systems around the world.

Theoretical definitionEdit

A function f: {0, 1}* → {0, 1}* is one-way if f can be computed by a polynomial time algorithm, but for every randomized polynomial time algorithm A,

Pr[f(A(f(x))) = f(x)] < 1/p(n)

for every polynomial p(n) and sufficiently large n, assuming that x is chosen from the uniform distribution on {0, 1}n and the randomness of A.

Note that, by this definition, the function must be "hard to invert" in the average-case, rather than worst-case sense; while in most of complexity theory (e.g., NP-hardness) the term "hard" is meant in the worst-case. Template:Dubious

Note also that just making a function "lossy" (not one-to-one) does not make it a one-way function. In this context, inverting a function means identifying some preimage element of a given value, which does not require the existence of an inverse function. For example, f(x) = x2 is not invertible (for example f(2) = f(-2) = 4) but is also not one-way, since given any value, you can compute one of its preimage elements in polynomial time by taking its square root.

Related conceptsEdit

A trapdoor one-way function or trapdoor permutation is a special kind of one-way function. Such a function is hard to invert unless some secret information, called the trapdoor, is known.

A one-way permutation is a one-way function that is also a permutation — that is, a one-way function that is both injective and surjective. One-way permutations are an important cryptographic primitive, and it is not known that their existence is implied by the existence of one-way functions.

A collision-free hash function f is a one-way function that is also collision-resistant; that is, no randomized polynomial time algorithm can find a collision - values x, y such that f(x) = f(y) - with non-negligible probability.[2]

Theoretical implications of one-way functionsEdit

If f is a one-way function, then the inversion of f would be a problem whose output is hard to compute (by definition) but easy to check (just by computing f on it). Thus, the existence of a one-way function implies that P≠NP. However, it is not known whether P≠NP implies the existence of one-way functions.

The existence of a one-way function implies the existence of many other useful concepts, including:

Candidates for one-way functionsEdit

Following are several candidates for one-way functions (as of April 2009). Clearly, it is not known whether these functions are indeed one-way; but extensive research has so far failed to produce an efficient inverting algorithm for any of them.

Multiplication and factoringEdit

The function f takes as inputs two prime numbers p and q in binary notation and returns their product. This function can be computed in O(n2) time where n is the total length (number of digits) of the inputs. Inverting this function requires finding the factors of a given integer N. The best factoring algorithms known for this problem run in time 2^{O({(\log N)^{1/3} (\log \log N})^{2/3})}, which is only pseudo-polynomial in \log N, the number of bits needed to represent N.

This function can be generalized by allowing p and q to range over a suitable set of semiprimes. Note that f is not one-way for arbitrary p,q>1, since the product will have 2 as a factor with probability 3/4.

Modular squaring and square rootsEdit

The function f takes two positive integers x and N, where N is the product of two primes p and q, and outputs the remainder of x2 divided by N. Inverting this function requires computing square roots modulo N; that is, given y and N, find some x such that x2 mod N = y. It can be shown that the latter problem is computationally equivalent to factoring N (in the sense of polynomial-time reduction) The Rabin cryptosystem is based on the assumption that this Rabin function is one-way.

Discrete exponential and logarithmEdit

The function f takes a prime number p and an integer x between 0 and p−1; and return the remainder of 2x divided by p. This discrete exponential function can be easily computed in time O(n3) where n is the number of bits in p. Inverting this function requires computing the discrete logarithm modulo p; namely, given a prime p and an integer y between 0 and p−1, find x such that 2x = y. As of 2009, there is no published algorithm for this problem that runs in polynomial time. The ElGamal encryption scheme is based on this function.

Cryptographically secure hash functionsEdit

There are a number of cryptographic hash functions that are fast to compute like SHA 256. Some of the simpler versions have fallen to sophisticated analysis, but the strongest versions continue to offer fast, practical solutions for one-way computation. Most of the theoretical support for the functions are more techniques for thwarting some of the previously successful attacks.

Other candidatesEdit

Other candidates for one-way functions have been based on the hardness of the decoding of random linear codes, the subset sum problem (Naccache-Stern knapsack cryptosystem), or other problems.

Universal one-way functionEdit

There is an explicit function which has been demonstrated to be one-way if and only if one-way functions exist.[3] Since this function was the first combinatorial complete one-way function to be demonstrated, it is known as the "universal one-way function". The problem of determining the existence of one-way functions is thus reduced to the problem of proving that this specific function is one-way.


  1. Oded Goldreich (2001). Foundations of Cryptography: Volume 1, Basic Tools, (draft available from author's site). Cambridge University Press. ISBN 0-521-79172-3.
  2. Russell, A. Necessary and Sufficient Conditions for Collision-Free Hashing. Journal of Cryptology vol. 8, no. 2., pp. 87-99. 1992.
  3. Template:Cite journal

Further readingEdit

See alsoEdit

de:Einwegfunktion es:Funciones de un solo sentido fr:Fonction à sens unique ko:일방향함수 he:פונקציה חד-כיוונית ja:一方向性関数 pl:Funkcja jednokierunkowa ru:Односторонняя функция simple:One-way function uk:Одностороння функція

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.