- How do Hashes really ensure uniqueness?
As David gave his answer, no they don't' ensure uniqueness. To see this consider a simple hash (imitating the only compression);
$$H':\{0,1\}^{20} \rightarrow \{0,1\}^{1}$$
$$x \mapsto x \pmod 2$$
By the definition; all the even numbers have $0$ as a hash value and odd numbers have $1$ as a hash value. So, there is no uniqueness. But finding another one ,a collison, must be computationally infeasible.
- a) As far as I understand, hashes are just long alphanumeric strings.
In the designs of hash functions is it required that finding a pre,second-image and collision must be computationally infeasible. But there is always a negligible chance of the attacker to find one, as in the MD4 case.
Hash functions are by design are not invertible funtions as permutations. They achive this by2
- Bit dependency: each bit of the output is dependent of the every bit of input.
- Avalanching : a single bit change in the input must change $\approx$ half of the bits randomly.
- Non-linearity: prevent from attacking linear systems solving techniques.
The attacker must find either a preimage or secondary-preimage.
A powerful entity can search all possible inputs to match the given hash. These examples rainbow table,hashcat may be not as powerful as you imagine but they are on the edge of computing.
Anyone afraid of quantum hashcollisionhash collision algorithms already has much more to fear from non-quantum hash-collision algorithms.
The quantum computers reduced the complexity of hash collision from $2^{b/2}$ to $2^{b/3}$. The non-quantum computers already achieved
$2^{b/3}$ with smaller time, The Rho Machine.1,2
Nothing except the hardness of finding a collision. If somehow the attackers arean attacker is able to find a collision as in the malicious valid PDF creating inthey can execute it. As recently, an identical-prefix collision attack
for SHA-1, they can execute it performed in PDF files to create malicious valid PDFs.