0

I am not sure how hashing works exactly, all I know it is impossible to reverse it. All hash types have X amount of characters in them while the phrases and made up words can have an infinite quantity hence infinitely more times than the character counts in a hash. So do hashes repeat themselves?

  • lookup the term: "collision" – schroeder Aug 26 '14 at 22:24
  • Btw, the preimage is not always infinitely large, see the max message size column in the wikipedia table. – user10008 Aug 26 '14 at 22:36
  • @user10008 So for most hash methods it would be 67108863, correct? – Slava Knyazev Aug 27 '14 at 2:28
2

Yes, it's possible because of the limited length, but it has a very little chance. Read a bit about hash collision, for example: http://preshing.com/20110504/hash-collision-probabilities/

1

The thing that you are asking about is called hash collision.

To make it extremely simple let's say your hash has 1 byte (=8 bits). This means that you can assign a distinct hash to at most 2^8 messages. If you had 2^8 + 1 (257) messages you would definitely experience a collision.

Now let's fast forward to todays situation. MD5 for example has 128 bits. This means it can encode 2^128 (3.4028237e+38) messages at most. So if you have a good algorithm (this is very important) your collision rate will be negligible and you will be able to assign a distinct hash to almost every of 2^128 distinct messages.

  • MD5 isn't really a good example of a hash collision free algo – Lucas Kauffman Aug 27 '14 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.