>Hash functions are irreversible; a potentially-infinite number of inputs all map to the same output.
I don't think that's pre-image resistance, or else extremely trivial "Hash functions" like
- Line up the input string into a matrix of n columns, XOR every column into a single bit, output the resulting n-bit hash.
Would be pre-image resistant, but it's obviously not. Given an n-bit hash I can trivially generate a message that hashes to it.
Generally, there are at least 3 notions of irreversiblity that might get confused:
- Non-bijectivity : That just means the set of images is smaller than the set of pre-images, so it's impossible (in general) to tell what input produced a given image. If F(x) == 1 for all x in X, it's impossible to tell which x was evaluated in order to get a 1. This is what you described, and it's - by itself - useless security-wise.
- One-way functions : Given x, its reasonably efficient to calculate y = F(x). But given y = F(x), it's prohibitively expensive to recover x = F^-1(y). The function is easy to compute in one direction, and practically impossible in the other. The inverse might very will exist, maybe even infinite inverses exist for every y, but you would need the computational resources of a thousand thousand universe working for a thousand thousand epoch to even get close to finding a single one.
- Trap-door functions : They are special one-way functions that have the property that : given a special piece of information about x or y (an inequality, a prime factor,....), x = F^-1(y) suddenly becomes much easier to compute, maybe even as easy as y = F(x).
I don't think that's pre-image resistance, or else extremely trivial "Hash functions" like
- Line up the input string into a matrix of n columns, XOR every column into a single bit, output the resulting n-bit hash.
Would be pre-image resistant, but it's obviously not. Given an n-bit hash I can trivially generate a message that hashes to it.
Generally, there are at least 3 notions of irreversiblity that might get confused:
- Non-bijectivity : That just means the set of images is smaller than the set of pre-images, so it's impossible (in general) to tell what input produced a given image. If F(x) == 1 for all x in X, it's impossible to tell which x was evaluated in order to get a 1. This is what you described, and it's - by itself - useless security-wise.
- One-way functions : Given x, its reasonably efficient to calculate y = F(x). But given y = F(x), it's prohibitively expensive to recover x = F^-1(y). The function is easy to compute in one direction, and practically impossible in the other. The inverse might very will exist, maybe even infinite inverses exist for every y, but you would need the computational resources of a thousand thousand universe working for a thousand thousand epoch to even get close to finding a single one.
- Trap-door functions : They are special one-way functions that have the property that : given a special piece of information about x or y (an inequality, a prime factor,....), x = F^-1(y) suddenly becomes much easier to compute, maybe even as easy as y = F(x).