CRCs: A High-Level Overview 2024-03-16

Hey! What are CRCs, or Cyclic Redundancy Checks? I’ll be writing a really high-level overview of what CRC is and how it functions.

What is CRC?

CRC stands for Cyclic Redundancy Check, a powerful yet straightforward technique for verifying the integrity of data. Its primary purpose is to ensure that there were no unintended changes in data during transmission or storage.

How does it work?

At its core, CRC works by performing a sequence of mathematical operations applied to the data prior to transmission. These operations produce a short, fixed-size block of data known as a codeword, derived from the original data. This codeword travels with the original data to its intended destination. Upon arrival, the same mathematical procedures are reapplied to compute a new codeword. If the data remains unchanged during transmit, this newly calculated codeword will match the original one sent. If the data has changed, the values should be different. Though this is not true for all cases due to some limitation of its design.

Limitations of CRC

While CRC is highly effective at catching errors, such as single-bit errors, double-bit errors, and errors in bursts (a sequence of altered bits), there are cases where CRC might not detect an error.

Codeword Collision

Since fixed-length codewords are generated regardless of the input data size, it inherently can yield identical CRC values from two distinct data blocks. As the data length increases, the probability that two different data blocks will produce the same CRC value (collision) also increases.

Non-recoverable

CRC is purely an error detection mechanism. It doesn’t provide any means to correct the detected errors. Additional mechanisms must be in place such as requesting a retransmission if an error is found.

Vulnerable to attacks

CRC is not designed to verify whether or not the data has been tampered with. An attacker with the knowledge of the CRC algorithm and polynomial used in its calculation could theoretically modify the data in a way that maintains the same CRC value, thereby eluding error detection. Therefore, CRC should not be used for security purposes.

Hope this brief intro into CRCs was helpful!