Firstly, some definitions;
Pre-image resistant: given a hash value $h$ find a message $m$ such that $h=Hash(m)$. Consider storing the hashes of passwords on the server. Eg. an attacker will try to find a valid password to your account.
Second Pre-image resistant: given a message $m_1$ is should be computationally infeasible to find another message $m_2$ such that $m_1 \neq m_2$ and $Hash(m_1)=Hash(m_2)$. Producing a forgery of a given message.
Collision resistance : if it is hard to find two inputs that hash to the same output $a$ and $b$ such that $H(a)= H(b)$, $a \neq b.$
0) 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.
Another way to see this is the pigeonhole principle. The input size is larger than the hash size, Therefore there exist at least one hash value contains more than one message.
So, there is no uniqueness. But finding another one, a collision, must be computationally infeasible.
- a) As far as I understand, hashes are just long alphanumeric strings.
Hash outputs are bits, just bits. How you represent them or transmit them is up to the developer.
- b) If one computes hashes across all documents, keys, information, files, etc, over and over again- its simply a matter of time until the same combination comes up again for the different information
What you said is called a hash collision. By definition of hash, it is inevitable but the finding one must be computationally infeasible. But if your hash function is considered as weak or a new attack occurs you must change it as for MD5 or SHA-1.
$$H:\{0,1\}^* \rightarrow \{0,1\}^l$$
As one can see, for $2^l$ possible hash output there are finitely (since we cannot process infinitely) many possible inputs. The SHA3-512 has only $l=512$ output bits. If the message space is just 1024 bits, then for a given hash value $h$ there are $ 2^{1024}/2^{512}$ possible input values that have $h$ as the hash value.
Picking one at random, you will have $1/2^{512}$ probability to match the hash as long as the hash function behaves randomly. There is an interesting random hash collision on MD4 on e-mule.
- c) This might be an impractical test given size and possibility, yes, but is it this that makes hashes powerful, that its practically impossible to recreate a hash that for any foreseeable endeavor its fine or is there some element that I'm missing that reduces even that extremely low probability to zero
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.
- Is there any design constraint that prevents a very powerful computer to back-calculate the original data from a hash? Or is it simply that the design is so complex that its simply a futile exercise to dream of such a large computer required for this task?
Hash functions are by design are not invertible functions 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.
If somehow you find an image that works for the hash value, there is no way to determine that this is the original one, the pre-image.
If your powerful entity is Quantum Computer, don't worry. D. J. Bernstein;
Anyone afraid of quantum hash 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
- Whats stopping a hacker or malicious middle man to hack open the software program or library that creates this "hash" and then use that library to create hashes of his own or mislabel some target company's hash with his own pointing to their version of the file? Especially since many applications, languages, and developers use hashing independently. Whichever is most weakly secured, we can use that to take on the rest?
Nothing except the hardness of finding a collision. If somehow an attacker is able to find a collision they can execute it. As recently, an identical-prefix collision attack
for SHA-1 performed in PDF files to create malicious valid PDFs.