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
| Output | 32 bits (8 hex chars) |
|---|---|
| Operation | Polynomial division in GF(2) |
| Throughput | ~5-15 GiB/s with SIMD or hardware acceleration |
| Status | Non-cryptographic; accidental-corruption detection only |
The two common variants
| Name | Polynomial | Where |
|---|---|---|
| CRC-32 (IEEE 802.3) | 0x04C11DB7 | Ethernet, ZIP, gzip, PNG, IEEE 1394 |
| CRC-32C (Castagnoli) | 0x1EDC6F41 | iSCSI, 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
- Ethernet FCS , every frame ends with a 4-byte CRC-32.
- ZIP, gzip, PNG, BZIP2 , per-record / per-chunk integrity.
- iSCSI, SCTP , CRC-32C as the payload checksum.
- ext4, Btrfs, F2FS , metadata block integrity.
- SD cards, USB Mass Storage , transfer integrity.
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
- Greg Cook’s CRC catalogue (the canonical list of CRC parameters)
- Intel , Fast CRC computation using CRC32 instruction (CRC-32C)
- Adler-32 · Fletcher · Internet checksum
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.
Q1.What is the output size of CRC-32?
Q2.What mathematical operation is CRC-32 based on?
Q3.Which CRC-32 polynomial does Ethernet use?
Q4.Castagnoli (CRC-32C) uses which polynomial?
Q5.Is CRC-32 cryptographically secure?
Q6.Why is CRC-32C preferred over IEEE 802.3 CRC-32 in modern storage?
Q7.Which protocol uses CRC-32C as its payload checksum?
Q8.What is a CRC's typical throughput on modern CPUs?
Q9.Can you forge a message with a given CRC-32 by appending 4 bytes?
Q10.Where does CRC-32 NOT belong?