Skip to content
uencoder
TUTORIAL

How to Use CRC32

Compute CRC32 checksums for fast, non-cryptographic integrity checks.

Problem

You need a fast checksum to detect accidental data corruption, not security-related tampering.

Prerequisites

  • Understanding of checksums vs cryptographic hashes
  • Familiarity with hex output

Steps

  1. 1. Understand CRC32's purpose

    CRC32 is a cyclic redundancy check that detects accidental changes to raw data. It produces a 32-bit (8 hex character) output. It is extremely fast but not collision-resistant against intentional attacks. Use it for error detection, not security.

    Input
    Hello
    Output
    F7D18982
  2. 2. Compute the CRC32

    Feed the data into a CRC32 calculator. The algorithm uses polynomial division over GF(2) to produce the checksum. The same input always yields the same output. It is commonly used in ZIP files, PNG chunks, and network protocols.

    Input
    Hello, World!
    Output
    E4F2D2A2
  3. 3. Verify integrity

    Compare the computed CRC32 with the stored value. If they match, the data is likely intact (CRC32 detects most accidental errors). If they differ, the data is corrupted. Do not use CRC32 to detect intentional tampering, as collisions are trivial to construct.

    Input
    computed == stored?
    Output
    MATCH or MISMATCH

Expected result

A fast 32-bit checksum suitable for detecting accidental corruption but not intentional tampering.

Common errors

Using CRC32 for security
CRC32 is not cryptographically secure. Collisions can be found instantly. Use SHA-256 for tamper detection.
Different CRC32 values for the same data
There are several CRC32 variants (ISO-HDLC, Castagnoli, Koopman). Ensure both sides use the same polynomial.

Troubleshooting

  • If CRC32 values differ across tools, check which polynomial variant each uses.
  • For ZIP files, the CRC32 is stored in the file header for integrity verification.

Security limits

  • CRC32 is NOT a cryptographic hash. It must not be used for authentication, signatures, or tamper detection.
  • All computation is local.

Related tools

Related glossary

Related tasks

Ready to run it?

References