Rajoo Sharma said:
I am wondering if MD5 hashes always unique? Like unique in the whole
world! What are the use of these hashes other than crypting and
decyping information?
Firstly, as others noted, a hash function's output has fixed length, but
takes arbitrary strings as input, so naturally there will be collisions,
but the odds are so small that for a secure hash function you can
consider this effectively impossible.
But that takes us to the second point about MD5: It is not secure.
Collisions can be constructed for it easily. You should use a hash
function from the SHA-2 family (like SHA-256) or RIPEMD160, for which
such a construction is currently not possible.
Although hash functions can be used to encrypt stuff, this is rarely
done. Rather you would use cipher algorithms like AES, because they are
more flexible (see cipher modes) and usually also faster.
In the future, you should ask cryptography-related questions in
sci.crypt, where some knowledgable people from the cryptographic
community hang around.
Greets,
Ertugrul.