1

From what I've researched, SHA's hex encoded string contains the characters [a-fA-F0-9]. If we represent it in Base64, it can contain [a-zA-Z0-9+/].

So the number of possible hash permutations are 22^64 and 59^64 respectively.

My question is, while we have infinite permutations for the input text, if the output hash is finite, then aren't all SHA algorithms meant to collide at some point?

I'm self taught. So please bear if this is a basic thing in cryptography.

1 Answers1

3

My question is, while we have infinite permutations for the input text, if the output hash is finite, then aren't all SHA algorithms meant to collide at some point?

Due to the pigeonhole principle, all hash functions will collide at some point. Since there are more inputs than outputs, the existence of collisions is unavoidable.

The job of a cryptographic hash function is to make finding collisions cost so much that it will never happen, and to make finding preimages prohibitively expensive as well.

Ella Rose
  • 19,971
  • 6
  • 56
  • 103