Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRC32 vs CRC32C?

Tags:

hash

checksum

What is the difference of CRC32 and CRC32C? I know CRC32 for a long time, but just heard CRC32C today. Are they basically the same method (i.e. both results in the same hash for a given data)?

like image 645
Wirawan Purwanto Avatar asked Oct 17 '14 16:10

Wirawan Purwanto


People also ask

What is a CRC32?

CRC32 is an error-detecting function that uses a CRC32 algorithm to detect changes between source and target data. The CRC32 function converts a variable-length string into an 8-character string that is a text representation of the hexadecimal value of a 32 bit-binary sequence.

Why is CRC32 not secure?

CRC32 was designed for detecting damaged files, not hashing. And as Mark mentioned it wont protect your files from modification, since hackers can still modify them at will by just inserting a properly crafted 32bit value after the change.

Is CRC32 faster than MD5?

CRC32 IS much faster than MD5, when a cryptographic library is properly implement.

Is CRC32 fast?

It's reasonably fast (375 MByte/s on my computer) and comes with only a small memory overhead. Often the look-up table isn't pre-computed at runtime but rather stored as a large table in the C code.


1 Answers

The CRC32 found in zip and a lot of other places uses the polynomial 0x04C11DB7; its reversed form 0xEDB88320 is perhaps better known, being often found in little-endian implementations.

CRC32C uses a different polynomial (0x1EDC6F41, reversed 0x82F63B78) but otherwise the computation is the same. The results are different, naturally. This is also known as the Castagnoli CRC32 and most conspicuously found in newer Intel CPUs which can compute a full 32-bit CRC step in 3 cycles. That is the reason why the CRC32C is becoming more popular, since it allows advanced implementations that effectively process one 32-bit word per cycle despite the three-cycle latency (by processing 3 streams of data in parallel and using linear algebra to combine the results).

like image 163
DarthGizka Avatar answered Sep 28 '22 04:09

DarthGizka