Do encryption algorithms provide really unique results?
Posted
by Mikulas Dite
on Stack Overflow
See other posts from Stack Overflow
or by Mikulas Dite
Published on 2010-06-17T09:07:43Z
Indexed on
2010/06/17
9:13 UTC
Read the original article
Hit count: 181
I was wondering whether md5, sha1 and anothers return unique values.
For example, sha1()
for test
returns a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
, which is 40 characters long. So, sha1 for strings larger than 40 chars must be the same (of course it's scrambled, because the given input may contain whitespaces and special chars etc.).
Due to this, when we are storing users' passwords, they can enter either their original password or some super-long one, which nobody knows.
Is this right, or do these hash algorithms provide really unique results - I'm quite sure it's hardly possible.
© Stack Overflow or respective owner