Questions tagged [one-way-function]

A function which is easy to compute but hard to invert (i.e. find preimages for). The existence of one-way functions implies the possibility of many useful cryptographic schemes. No one-way functions have so far been proven to exist, but many likely candidates exist.

A one-way function is a function which is easy to compute but hard to invert: given the output $f(x)$ of the function for some randomly chosen unknown input $x$, it should not be feasible to find an input $y$ (which may or may not equal $x$) such that $f(y) = f(x)$.

Formally, a function $f: \{0,1\}^* \to \{0,1\}^*$ is one-way if it can be computed by a polynomial-time algorithm, and if, for every polynomial-time randomized algorithm $A$, every polynomial $p$ and all sufficiently large $n$,

$$ \mathrm{Pr}[\; f(A(f(x))) = f(x) \mid x \in \lbrace 0,1 \rbrace^n \;] < \frac{1}{p(n)} $$

i.e. the probability the any algorithm $A$ can find a preimage for $f(x)$, where $x$ is a string of length $n$, tends to zero faster than the reciprocal of any polynomial $p$.

No functions have been proven to be one-way, and indeed even the existence of one-way functions is an open problem. However, there do exist so-called "universal one-way functions", which are known to be one-way if one-way functions exist at all.

If one-way functions do exist, this implies the existence of various useful cryptographic tools, including pseudorandom generators, pseudorandom function families, commitment schemes, message authentication codes, digital signatures and IND-CCA2 secure encryption schemes. It would also imply a positive answer to the open problem of whether P ≠ NP.

Despite the lack of any existence proof, various functions are commonly believed to be likely to be one-way (and these functions underlie much of modern cryptography). Some examples include the multiplication of large primes, modular exponentiation and various cryptographic hash functions.

Closely related to one-way functions are so-called trapdoor one-way functions, which are easy to compute but hard to invert unless one knows a secret key used to construct the function. (Obviously, constructing the function from the key must itself be a one-way process as defined above.) Trapdoor one-way functions are the foundation of public-key cryptography.

See also: , , ,

301 questions
29
votes
5 answers

Other than password hashes, are there other uses for non-reversible crypto

Hashing is useful for checking that an input matches expectations without giving away the stored expected version - so confirming passwords etc. But are there other use cases? In general, cryptographic storage so data is retrievable seems to be the…
Rory Alsop
  • 675
  • 1
  • 13
  • 24
28
votes
6 answers

Are there hash algorithms with variable length output?

I understand that for example MD5 produces a 128 bit hash value from a given text of variable size. My question is if there is a hash-like algorithm that will produce a hash value where one can specify the length of the outcome? So one would specify…
Thomas
  • 1,184
  • 5
  • 16
  • 33
28
votes
2 answers

What is a hard-core predicate?

I read this article on Wikipedia: Hard-core predicate. Still I don't understand what exactly is a hard-core predicate. Is it possible to put this in simple English terminology, and perhaps with a simple example?
Kai
22
votes
6 answers

Are there cryptographic hash functions that can be computed using only paper and pen without leaking any information about the plaintext?

I am looking for a cryptographic hash function that can be computed by a human using only paper and pen without ever leaking any information about the plaintext on the paper. The cryptographic hash function should be computable by an algorithm…
Vincent Yu
  • 392
  • 4
  • 12
19
votes
1 answer

Overview of relations between cryptographic primitives?

Is there a web page that gives a graphical (or, alternatively, a textual) overview of known implications and separations between cryptographic primitives? More specifically, I am looking for something like the following, but more comprehensive and…
18
votes
5 answers

Is it easy to crack a hashed phone number?

I want to SHA256 hash phone numbers in order to hide them. Is this a good idea? Are there any other ways I could make this safe?
15
votes
3 answers

Lamport signature: How many signatures are needed to forge a signature?

Lamport signature: Signing the message Note that now Alice's private key is used and should never be used again. The other 256 random numbers that she did not use for the signature she must never publish or use. Preferably she should delete them;…
Sup3rgnu
  • 369
  • 2
  • 7
13
votes
3 answers

Is SHA-256 irreversible for each input?

There are more inputs to the SHA-256 function than outputs, so it must be a many-to-one function by the Pigeonhole Principle. However, that doesn't automatically imply that it send more than one input to each of its outputs. For instance, Squaring…
12
votes
2 answers

How to show that a one-way function proves that P ≠ NP?

According to this, the existence of a one-way function proves P ≠ NP. What is the proof of this? One way to show this is that if P = NP, then any function is easy to invert. P and NP are about decision problems though, not computation…
Christopher King
  • 839
  • 5
  • 20
10
votes
1 answer

Can I use the ChaCha core as a 256-bit to 256-bit one-way function?

I'm looking to implement Lamport signatures as a little fun project, and I need a fast one way function that maps $\{0,1\}^{256} \rightarrow \{0,1\}^{256}$. I was wondering whether I could safely use the ChaCha core for that, by setting the input as…
orlp
  • 4,355
  • 21
  • 31
9
votes
1 answer

Proof that $g(x) = f(x) || f(f(x))$ is a OWF when $f$ is a OWF

Assume that $f$ is a one-way function (OWF), and let $\mathbin\|$ denote string concatenation. Consider the function $g$ defined by $g(x) = f(x) \mathbin\| f(f(x))$. It is easy to prove that $g$ is a OWF as well, assuming that $f$ is length…
Incredible
  • 249
  • 1
  • 3
9
votes
1 answer

One way function built from AES?

I'm implementing a Hash based signature algorithm and this paper recommends the use of $F(X,\mathit{salt})=\operatorname{AES}_\mathit{salt}(X)\oplus X$ as a hard one way function. The salt plays the same role here as it does in password hashing and…
Richard Thiessen
  • 1,751
  • 9
  • 14
9
votes
2 answers

Is $f(x)\oplus x$ a one-way function?

Given that $f$ is a OWF and $|f(x)|=|x|$ for all $x$, is $g(x)=f(x)\oplus x$ necessarily also a OWF?
Pqqwetiqe
  • 193
  • 1
  • 3
9
votes
1 answer

Is the AES Key Schedule weak?

After reading this paper entitled Key Recovery Attacks of Practical Complexity on AES Variants With Up To 10 Rounds, I was left wondering why AES's key schedule is invertible. In the paper, the authors use a related-key-attack to recover the round…
user1449
9
votes
3 answers

How hard is to invert the function that computes the middle-bits of (x^2)?

I'm designing a function f that should be moderately hard to invert and very fast to evaluate in a modern CPU. The function will be used in a proof-of-work function. I've read that the middle-bits of multiplication are the harder bits to obtain, so…
SDL
  • 1,927
  • 13
  • 25
1
2 3
20 21