Search code examples
hashdistributioncrchash-collision

Distribution of CRC checksums


I am investigating about the collision propability of CRC checksums when they are used as a hashes. I know how to calculate the collision propability for hash algorithms that are evenly distributed (which means the chance to get all possible checksums for random input data is the same).

What I do not know (and I couldn't find in the web):

  1. Are CRC checksums generally [not] evenly distributed?
  2. Does the distribution depend from the polynomial?
  3. Does the distribution depend from the input data size?

P.S.: I am aware of the restrictions when using CRCs as hashes, so this is not part of this question.


Solution

  • Aside from malicious intent (you can force any CRC you like by changing bits in the message), CRCs are evenly distributed over all values. The polynomial does not matter, so long as it is a valid CRC polynomial, and the input only needs to be the size of the CRC or larger.