One-way functions and hash codesA one-way function is defined as a function f such that for every x in the domain of f, f(x) is easy to compute; but for virtually all y in the range of f, it is computationally infeasible to find an x such that y=f(x). In addition one requires that it is hard to find a second pre-image: given an x and the corresponding value of f(x), it should be hard to find an x' different from x which has the same image under f.