Checksums and non-cryptographic hashes

CRC-32

Polynomial checksums for detecting accidental errors, from CRC-3 to CRC-82

standard Safe API Not cryptographic

About CRC-32

CRC-32 is one of 113 Cyclic redundancy checks (CRC) variants in the NextSSL registry, a checksum / non-cryptographic hash. It produces a 4-byte (32-bit) output. Its registry entry cites ISO 3309, ITU-T V.42 and CRC catalogue CRC-32/ISO-HDLC. It is also known as crc32-iso-hdlc. NextSSL lists it in the standard tier and exposes it through the safe API.

Overview

A cyclic redundancy check is an error-detecting code computed as the remainder of polynomial division over GF(2). CRCs are used everywhere data is stored or transmitted, from Ethernet frames and ZIP files to storage controllers and radio links. They are not cryptographic and provide no protection against deliberate modification.

A CRC treats the message as a polynomial with binary coefficients, multiplies it by x^n and divides by a fixed generator polynomial of degree n; the n-bit remainder is the check value. In practice it is computed with shift registers or lookup tables. A full CRC definition also fixes the initial register value, whether input and output bits are reflected, and a final XOR value, which is why many incompatible CRCs share the same width and polynomial.

NextSSL includes over a hundred CRC definitions matching the reveng CRC catalogue, from 3-bit to 82-bit widths: CRC-8 variants for automotive and smart-card buses, CRC-16 variants such as XMODEM, MODBUS, KERMIT and USB, CRC-32 as used by Ethernet, ZIP and PNG (ISO-HDLC), CRC-32C (Castagnoli, used by iSCSI, ext4 and SCTP), and CRC-64 variants including ECMA-182, XZ and NVMe. The identifiers follow the catalogue names.

A well-chosen CRC detects all burst errors shorter than its width and all errors with fewer bits than its Hamming distance for messages up to a certain length, which is why the choice of polynomial is tuned per application. CRC-32C has hardware instructions on modern x86 and ARM processors. Longer CRCs catch more errors.

History

1961–1961
  1. Cyclic redundancy checks published by W. Wesley Peterson

How it works

  1. Initialise an n-bit register to a defined value
  2. Shift message bits in, XORing the polynomial when the top bit is set
  3. Optionally reflect bits and apply a final XOR
  4. Output the n-bit remainder

Security notes

CRCs are not cryptographic. They are linear, so an attacker can modify data and adjust the CRC to match, or choose data with any desired CRC, with trivial effort. Use a MAC or authenticated encryption when integrity against an attacker is needed.

Typical uses

Detecting transmission and storage errorsFile-format and protocol checksums (ZIP, PNG, Ethernet)Hash-table and sharding keys where adversaries are absent

Sizes

FieldBytesMeaning
out4Output

Use it

from nextssl_demo import NextSSL

ns = NextSSL()              # safe API: safe and standard tiers
value = ns.call("checksum", "crc32", None, b"123456789")[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Similar names

Looking for something else?

Frequently asked questions

What is CRC-32?

CRC-32 is a checksum in the Cyclic redundancy checks (CRC) family. A cyclic redundancy check is an error-detecting code computed as the remainder of polynomial division over GF(2). It is also known as crc32-iso-hdlc.

What are the CRC-32 sizes?

In NextSSL, CRC-32 uses: output 4 bytes.

Who designed CRC-32 and when?

CRC-32 belongs to the Cyclic redundancy checks (CRC) family, first published in 1961 by W. Wesley Peterson. Its origin: reveng CRC catalogue; ISO 3309; ITU-T V.42; ECMA-182; RFC 3720.

Which standards define CRC-32?

CRC-32 is referenced by ISO 3309, ITU-T V.42, CRC catalogue CRC-32/ISO-HDLC.

Is CRC-32 safe to use?

CRC-32 is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.

What other Cyclic redundancy checks (CRC) variants are there?

NextSSL also registers crc-10-atm, crc-10-cdma2000, crc-10-gsm, crc-11-flexray, crc-11-umts, crc-12-cdma2000 and more in the Cyclic redundancy checks (CRC) family.