Are there any reversible hash function?

1.7k Views Asked by At

I read about hash function and I know that there can be some $x$ values which lead to the same $y$ ($x$ is the parameter of the hash function, $y$ is the result).

Is there a way, given a $y$ and a hash function to find some $x$ value which related to this $y$?

For example, if $hash_1(x_1)=y_1$, $hash_1(x_2)=y_1$, then given a $y_1$ and a hash function called $hash_1$, I will get $x_1$ (or $x_2$).

In other words, are there some sort of reversible hash function?

1

There are 1 best solutions below

3
On

If (as is almost always the case in computing applications) the domain of the hash function is a finite set, or at least some finite subdomain is known that will produce all possible $y$ values, it is in principle possible to find an $x$ by a brute-force search. Of course that may not be feasible in practice if the domain is large. Whether more efficient methods exist will depend on the particular hash function.

For cryptographic applications, one wants a hash function that is easy to compute but difficult to reverse: a one-way hash function.