C5 LRC, CRC and check digits

Needs: Supporter

Error detection on links and in data: LRC framing, CRC parameters, and why a checksum is not a MAC.

This is a supporter feature. Create a free account, then try every supporter feature free for 7 days.

Sign in Create a free account See plans

What this module covers

Track C · Cryptography

You will be able to

  • Compute an LRC with the STX / ETX framing rules
  • Read CRC parameters and compute CRC-16 and CRC-32
  • Know which CRC each protocol uses
  • Explain why a checksum does not protect against an attacker

The lesson

  1. Why it matters
  2. The concept
  3. Step by step
  4. In the real world
  5. Common mistakes
  6. What to test

In the module

  • The lesson, with diagrams, common mistakes and what to test
  • A worked example you can change: LRC of a frame, and a CRC
  • Practice: 4 kinds of generated exercise, each with a step-by-step solution
  • A quiz of 9 questions

Key terms

Check digit
A digit computed from the others to catch input errors, such as the Luhn digit of a PAN.
Checksum
Any simple value computed over data to detect accidental errors. It gives no protection against deliberate changes; that needs a MAC.
CRC (Cyclic redundancy check)
A check value from polynomial division, such as CRC-16 or CRC-32. It catches far more errors than an LRC.
LRC (Longitudinal redundancy check)
A one-byte check made by XORing bytes together. Used after ETX in framed messages and at the end of stripe tracks.
Rocksoft model
The standard way to describe a CRC by its width, polynomial, initial value, input and output reflection and final XOR. Two CRC-16s with different parameters give different values.

Tools for this module: LRC / CRCLuhn Validator

Read the opening of the lesson →

The lesson, worked example, practice and quiz open with a supporter pass, which you can try free for 7 days.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.