Hash Lab

Checksum

CRC-32

A 32-bit cyclic redundancy check , the classic polynomial-division-over-GF(2) family for detecting accidental data corruption. CRC-32 catches every single-bit error, every two-bit error within a span, all odd-bit-count errors, and burst errors up to 32 bits long. It is not cryptographic , an adversary can construct collisions in milliseconds.

At a glance

Output32 bits (8 hex chars)
OperationPolynomial division in GF(2)
Throughput~5-15 GiB/s with SIMD or hardware acceleration
StatusNon-cryptographic; accidental-corruption detection only

The two common variants

NamePolynomialWhere
CRC-32 (IEEE 802.3)0x04C11DB7Ethernet, ZIP, gzip, PNG, IEEE 1394
CRC-32C (Castagnoli)0x1EDC6F41iSCSI, SCTP, ext4 metadata, Btrfs, x86 CRC32 instruction

Why CRC32C is increasingly preferred

Castagnoli’s polynomial has slightly better error-detection properties for the message sizes typical in storage and network protocols, and Intel’s SSE4.2 CRC32 instruction implements it directly. Modern filesystems and protocol stacks pick CRC-32C for both reasons.

Where it shows up

Not for adversaries

Given a target CRC-32, anyone can append 4 bytes to a message to force any desired CRC. This is by design , CRC is a linear function in GF(2). Never use CRC-32 to authenticate messages; use a real MAC like HMAC instead.

References

Visualize

CRC-32 on your input

11 bytes · 0-bit digest

Hex digest

Bit grid (0 bits, teal = 1, slate = 0)

Byte pixel art (0 bytes, hue = byte value mod 360°)

Avalanche , flipping the lowest bit of the first input byte changed 0 of 0 output bits

Quick quiz

Test yourself on crc-32

10 multiple-choice questions. Pick an answer for each, then submit to see explanations.

  1. Q1.What is the output size of CRC-32?

  2. Q2.What mathematical operation is CRC-32 based on?

  3. Q3.Which CRC-32 polynomial does Ethernet use?

  4. Q4.Castagnoli (CRC-32C) uses which polynomial?

  5. Q5.Is CRC-32 cryptographically secure?

  6. Q6.Why is CRC-32C preferred over IEEE 802.3 CRC-32 in modern storage?

  7. Q7.Which protocol uses CRC-32C as its payload checksum?

  8. Q8.What is a CRC's typical throughput on modern CPUs?

  9. Q9.Can you forge a message with a given CRC-32 by appending 4 bytes?

  10. Q10.Where does CRC-32 NOT belong?

0 of 10 answered