Information about Cyclic Redundancy Check

A cyclic redundancy check (CRC) is a type of function that takes as input a data stream of any length and produces as output a value of a certain fixed size. The term CRC is often used to denote either the function or the function's output. A CRC can be used in the same way as a checksum to detect accidental alteration of data during transmission or storage. CRCs are popular because they are simple to implement in binary hardware, are easy to analyze mathematically, and are particularly good at detecting common errors caused by noise in transmission channels. The CRC was invented by W. Wesley Peterson, and published in his 1961 paper.

Introduction

A CRC is an error-detecting code whose computation resembles a long division computation in which the quotient is discarded and the remainder becomes the result, with the important distinction that the arithmetic used is the carry-less arithmetic of a finite field. The length of the remainder is always less than the length of the divisor, which therefore determines how long the result can be. The definition of a particular CRC specifies the divisor to be used, among other things.

Although CRCs can be constructed using any finite field, all commonly used CRCs employ the finite field GF(2), the field of two elements, usually called 0 and 1, comfortably matching computer architecture. The rest of this article will discuss only these binary CRCs, but the principles are more general.

An important reason for the popularity of CRCs for detecting the accidental alteration of data is their efficiency guarantee. Typically, an n-bit CRC, applied to a data block of arbitrary length, will detect any single error burst not longer than n bits (in other words, any single alteration that spans no more than n bits of the data), and will detect a fraction 1-2-n of all longer error bursts. Errors in both data transmission channels and magnetic storage media tend to be distributed non-randomly (i.e. are "bursty"), making CRCs' properties more useful than alternative schemes such as multiple parity checks.

The simplest error-detection system, the parity bit, is in fact a trivial CRC: it uses the two-bit-long divisor 11.

CRCs are not, by themselves, suitable for protecting against intentional alteration of data (for example, in authentication applications for data security), because their convenient mathematical properties make it easy to compute the CRC adjustment required to match any given change to the data.

CRCs and data integrity vs. correctness

While useful for error detection, CRCs cannot be safely relied upon to fully verify data correctness in the face of deliberate (rather than random) changes.

It is often falsely assumed that when a message and its CRC are transmitted over an open channel, then when it arrives if the CRC matches the message's calculated CRC then the message can not have been altered in transit.

This assumption is false because CRC is a poor method of data encryption. In fact, it is not really encryption at all: it is supposed to be used for data integrity checks, but is occasionally assumed to be used for encryption. When a CRC is calculated, the message is preserved (not encrypted) and the constant-size CRC is tacked onto the end (i.e. the message can be just as easily read as before the CRC was created).

Additionally, as the length of the CRC is usually much smaller than the length of the message, it is impossible for a 1:1 relationship between CRCs and messages. So multiple codes will produce the same CRC. Of course, these codes are designed to be different enough such that random (and usually only one or two bit) changes in the codeword will produce a fantastically different CRC, and so the error is likely to be detected.

If deliberate tampering (changes to bits) occurred in the message... then a new, phony CRC could be computed for the new message and replace the real CRC on the end of the packet (created a packet that would be verified by any Data-Link entity). So CRCs can be relied upon to verify integrity but not correctness.

In contrast, an effective way to protect messages against intentional tampering is by the use of a message authentication code such as HMAC.

The mathematics of CRCs

Main article: Mathematics of CRCs


The mechanics of computing an n-bit binary CRC are simple. The bits representing the input are lined up in a row, and the (n+1)-bit pattern representing the CRC's divisor (called a "polynomial" because of the tools used in the mathematical analysis of CRCs) is positioned underneath the left-hand end of the row. Here is the first calculation for computing a 3-bit CRC:

>
11010011101100 <--- input
1011           <--- divisor (4 bits)
--------------
01100011101100 <--- result


If the input bit above the leftmost divisor bit is 1, the divisor is exclusive-ORed into the input (in other words, the input bit above each 1-bit in the divisor is toggled). The divisor is then shifted one bit to the right, and the process is repeated until the divisor reaches the right-hand end of the input row. Here is the last calculation:

>
00000000001110 <--- result of penultimate calculation
          1011 <--- divisor
--------------
00000000000101 <--- remainder (3 bits)


Since the leftmost divisor bit zeroed every input bit it touched, when this process ends the only bits in the input row that can be nonzero are the n bits at the right-hand end of the row. These n bits are the remainder of the division step, and will also be the value of the CRC function (unless the CRC specification calls for some postprocessing).

Mathematical analysis of this division-like process reveals how to pick a divisor that guarantees good error-detection properties. In this analysis, the digits of the bit strings are thought of as the coefficients of a polynomial in some variable x -- coefficients that are elements of the finite field GF(2) instead of more familiar numbers. This "polynomial trick" allows bit strings to be viewed as elements of a ring. A ring is, loosely speaking, a set of elements somewhat like numbers, that can be operated on by an operation that somewhat resembles addition and another operation that somewhat resembles multiplication, these operations possessing many of the familiar arithmetic properties of commutativity, associativity, and distributivity. Many analytical tools commonly used with numbers also work on rings, and this is why the "polynomial" view helps the analysis.

Specifying a CRC

The concept of the CRC as an error-detecting code gets complicated when an implementer or standards committee turns it into a practical system. Here are some of the complications:
  • Sometimes an implementation prefixes a fixed bit pattern to the bitstream to be checked. This is useful when clocking errors might insert 0-bits in front of a message, an alteration that would otherwise leave the CRC unchanged.
  • Sometimes an implementation appends n 0-bits (n being the size of the CRC) to the bitstream to be checked before the polynomial division occurs. This has the convenience that the CRC of the original bitstream with the CRC appended is exactly zero, so the CRC can be checked simply by performing the polynomial division on the expanded bitstream and comparing the remainder with zero.
  • Sometimes an implementation exclusive-ORs a fixed bit pattern into the remainder of the polynomial division.
  • Bit order: Some schemes view the low-order bit of each byte as "first", which then during polynomial division means "leftmost", which is contrary to our customary understanding of "low-order". This seemingly silly convention makes sense when serial-port transmissions are CRC-checked in hardware, because some widespread serial-port transmission conventions transmit bytes least-significant bit first.
  • Byte order: With multi-byte CRCs, there can be confusion over whether the byte transmitted first (or stored in the lowest-addressed byte of memory) is the least-significant byte or the most-significant byte. For example, some 16-bit CRC schemes swap the bytes of the CRC.
  • Omission of the high-order bit of the divisor polynomial: Some writers assume that, since the high-order bit is always 1, and since an n-bit CRC must be defined by an (n+1)-bit divisor, it is unnecessary to mention the divisor's high-order bit.

Commonly used and standardized CRCs

CRCs as used in globally standardized telecommunications systems have not been fully standardized. Most CRCs in current use have some weakness with respect to strength or construction. Standardization of CRCs would allow for better designed CRCs to come into common use.
  • The definition of CRC-12 is disputed, as there are 3 forms of CRC-12 in common use.
  • Both forms of CRC-8 in use have notable weaknesses mathematically.
  • It is assumed that at least other 10 forms of CRC-16 and CRC-32 exist, but no form of CRC-16 or CRC-32 in use is mathematically optimal.
  • CCITT CRCs differ from ITU CRCs (of the same size), as the same entity has standardized checksums more than once but in different eras.
  • The ITU and IEEE have been historically helpful in standardizing checksums used in telecommunications equipment and protocols -- but have provided little to no support in standardization since the end of the Cold War.
  • These hex values of "Initial value" and "Reflected value" are important for some more complicated checksums (like most forms of CRC-32 and CRC-64).
  • CRCs less than CRC-16 do not tend to use Initial or Reflected values.
  • Very often custom versions of checksums are created by changing these values, as it does not alter the overall mechanics (or math) of the checksum algorithm -- and may provide some nominal security features.
NamePolynomialRepresentations: Normal or Reverse (Normal of Reciprocal)
CRC-1 (use: hardware; also known as parity bit)0x1 or 0x1 (0x1)
CRC-4-ITU (ITU G.704, p. 12)0x3 or 0xC (0x9)
CRC-5-ITU (ITU G.704, p. 9)0x15 or 0x15 (0x0B)
CRC-5-USB (use: USB token packets)0x05 or 0x14 (0x9)
CRC-6-ITU (ITU G.704, p. 3)0x03 or 0x30 (0x21)
CRC-7 (use: telecom systems, MMC)0x09 or 0x48 (0x11)
CRC-8-ATM (use: ATM HEC)0x07 or 0xE0 (0xC1)
CRC-8-CCITT (use: 1-Wire bus)0x8D or 0xB1 (0x63)
CRC-8-Dallas/Maxim (use: 1-Wire bus)0x31 or 0x8C (0x19)
CRC-80xD5 or 0xAB (0x57)
CRC-8-SAE J18500x1D or 0xB8
CRC-100x233 or 0x331 (0x263)
CRC-12 (use: telecom systems)0x80F or 0xF01 (0xE03)
CRC-15-CAN0x4599 or 0x4CD1 (0x19A3)
CRC-16-FletcherNot a CRC; see Fletcher's checksumUsed in Adler-32 A & B CRCs
CRC-16-CCITT (X.25, V.41, Bluetooth, PPP, IrDA, BACnet; known as "CRC-CCITT")0x1021 or 0x8408 (0x8811)
CRC-16-IBM (XMODEM, USB, many others; also known as "CRC-16")0x8005 or 0xA001 (0x4003)
CRC-24-Radix-640x864CFB or 0xDF3261 (0xBE64C3)
CRC-32-AdlerNot a CRC; see Adler-32See Adler-32
CRC-32-MPEG20x04C11DB7 or 0xEDB88320 (0xDB710641) Also used in IEEE 802.3
CRC-32-IEEE 802.3 (V.42)0x04C11DB7 or 0xEDB88320 (0xDB710641)
CRC-32C (Castagnoli)0x1EDC6F41 or 0x82F63B78 (0x05EC76F1)
CRC-32K (Koopman)0x741B8CD7 or 0xEB31D82E
CRC-64-ISO (use: ISO 3309)0x000000000000001B or 0xD800000000000000 (0xB000000000000001)
CRC-64-ECMA-182 (as described in ECMA-182 p.63)0x42F0E1EBA9EA3693 or 0xC96C5795D7870F42 (0x92D8AF2BAF0E1E85)


Known to exist, but technologically defunct -- mainly replaced by cryptographic hash functions
  • CRC-128 (IEEE)
  • CRC-256 (IEEE)

Designing CRC polynomials

The selection of generator polynomial is the most important part of implementing the CRC algorithm. The polynomial must be chosen to maximize the error detecting capabilities while minimizing overall collision probabilities.

The most important attribute of the polynomial is its length (the number of the highest nonzero coefficient), because of its direct influence of the length of the computed checksum.

The most commonly used polynomial lengths are
  • 9 bits (CRC-8)
  • 17 bits (CRC-16)
  • 33 bits (CRC-32)
  • 65 bits (CRC-64)
When creating a new CRC polynomial or improving an existing CRC the general mathematical advice is to use an irreducible polynomial that satisfies all polynomical irreducibility constraints from modular arithmetics.
  • Irreducibility in this case means that the polynomial cannot be divided by any polynomial except itself and 1 with zero remainder.
  • Reducible polynomials can still be used, but their error correcting and detecting capabilities will be less effective. Some applications may choose to use reducible polynomials under certain conditions.
The properties of the generator polynomial can be derived from the algorithm definition
  • CRCs with more than one nonzero coefficients are able to detect all single bit errors in the input message.
  • CRCs can be used to detect all double bit errors in the input message shorter than 2k, where k is the length of the longest irreducible part of the polynomial.
  • If the CRC polynomial is divided by x + 1 then no polynomial with odd number of nonzero coefficients can be divided by it. Hence, it can be used to detect odd number of errors in the input message (like single bit parity function).
  • CRC polynomials detect (single) burst errors shorter than the number of the position of the highest polynomial coefficient.

See also

General category Specific Technological References

External links




[ e ] Error correction
Decade of method introduction
1850s-1900s: check digit
1940s-1960s: checksum
1960s: Reed-Solomon
1960s: LDPC codes
1990s: Turbo codes
1990s: Space-time code
Related topics
Information theory Shannon limit
checksum is a form of redundancy check, a simple way to protect the integrity of data by detecting errors in data that are sent through space (telecommunications) or time (storage).
..... Click the link for more information.
Computer hardware is the physical part of a computer, including the digital circuitry, as distinguished from the computer software that executes within the hardware. The hardware of a computer is infrequently changed, in comparison with software and data, which are "soft" in the
..... Click the link for more information.
William Wesley Peterson, PhD (born April 22, 1924 in Muskegon, Michigan) is an American mathematician and computer scientist. He is best known for inventing the Cyclic Redundancy Check (CRC) [1], for which research he was awarded the Japan Prize in 1999.
..... Click the link for more information.
In mathematics, computer science, telecommunication, and information theory, error detection and correction has great practical importance in maintaining data (information) integrity across noisy channels and less-than-reliable storage media.
..... Click the link for more information.
Long Division is an album released in 1995 by the Rustic Overtones.

Track listing

  1. "About a Kid"
  2. "Simple Song"
  3. "Spunk Drive 185"
  4. "Colors of Discipline"
  5. "20 Years"
  6. "Fake Face"
  7. "Dig"
  8. "Feel"
  9. "Pimp"
  10. "Long Division"

..... Click the link for more information.
In abstract algebra, a finite field or Galois field (so named in honor of Évariste Galois) is a field that contains only finitely many elements. Finite fields are important in number theory, algebraic geometry, Galois theory, cryptography, and coding theory.
..... Click the link for more information.
GF(2) is the Galois field (or finite field) of two elements. The two elements are nearly always called 0 and 1. The field's addition operation is given by the table

> 0 1 +--- 0|0 1 1|1 0 re>

and its multiplication operation by the following table.
..... Click the link for more information.
In telecommunication, an error burst is a contiguous sequence of symbols, received over a data transmission channel, such that the first and last symbols are in error and there exists no contiguous subsequence of m correctly received symbols within the error burst.
..... Click the link for more information.
A parity bit is a binary digit that indicates whether the number of bits with value of one in a given set of bits is even or odd. Parity bits are used as the simplest error detecting code.

There are two types of parity bits: even parity bit and odd parity bit.
..... Click the link for more information.
In mathematics, computer science, telecommunication, and information theory, error detection and correction has great practical importance in maintaining data (information) integrity across noisy channels and less-than-reliable storage media.
..... Click the link for more information.
A cryptographic message authentication code (MAC) is a short piece of information used to authenticate a message. A MAC algorithm accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC (sometimes known as a tag).
..... Click the link for more information.
In cryptography, a keyed-Hash Message Authentication Code, or HMAC, is a type of message authentication code (MAC) calculated using a cryptographic hash function in combination with a secret key.
..... Click the link for more information.
message polynomial of this sort, and to find the CRC, we multiply the message polynomial by and then find the remainder when dividing by the degree-n generator polynomial. The coefficients of the remainder polynomial are the bits of the CRC.
..... Click the link for more information.
GF(2) is the Galois field (or finite field) of two elements. The two elements are nearly always called 0 and 1. The field's addition operation is given by the table

> 0 1 +--- 0|0 1 1|1 0 re>

and its multiplication operation by the following table.
..... Click the link for more information.
In mathematics, a ring is an algebraic structure in which addition and multiplication are defined and have properties listed below. The branch of abstract algebra which studies rings is called ring theory.
..... Click the link for more information.
serial port is a serial communication physical interface through which information transfers in or out one bit at a time (contrast parallel port). Throughout most of the history of personal computers, data transfer through serial ports connected the computer to devices such as
..... Click the link for more information.
In computing, endianness is the byte (and sometimes bit) ordering in memory used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory (relative to a given memory addressing scheme) and the transmission order over
..... Click the link for more information.
The ITU Telecommunication Standardization Sector (ITU-T) coordinates standards for telecommunications on behalf of the International Telecommunication Union (ITU) and is based in Geneva, Switzerland.
..... Click the link for more information.
Itu is a municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language.
..... Click the link for more information.
Institute of Electrical and Electronics Engineers

Type Professional Organization
Founded January 1, 1963
Origins Merger of the American Institute of Electrical Engineers and the Institute of Radio Engineers
Key people Leah H.
..... Click the link for more information.
The Cold War was the period of conflict, tension and competition between the United States and the Soviet Union and their respective allies from the mid-1940s until the early 1990s.
..... Click the link for more information.
A parity bit is a binary digit that indicates whether the number of bits with value of one in a given set of bits is even or odd. Parity bits are used as the simplest error detecting code.

There are two types of parity bits: even parity bit and odd parity bit.
..... Click the link for more information.
Itu is a municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language.
..... Click the link for more information.
Itu is a municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language.
..... Click the link for more information.
USB
Universal Serial Bus

Original USB Logo
Year created: January 1996



Width:
Number of devices: 127 per host
Capacity Up to 12Mbit/s (USB 1.0)
Up to 480 Mbit/s (USB 2.
..... Click the link for more information.
Itu is a municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language.
..... Click the link for more information.
MultiMediaCard

A 32 MB MultiMediaCard
Developed by: Siemens AG and SanDisk

The MultiMediaCard (MMC) is a flash memory memory card standard. Unveiled in 1997 by Siemens AG and SanDisk, it is based on Toshiba's NAND-based flash memory, and is therefore
..... Click the link for more information.
Asynchronous Transfer Mode (ATM) is a cell relay, packet switching network and data link layer protocol which encodes data traffic into small (53 bytes; 48 bytes of data and 5 bytes of header information) fixed-sized cells.
..... Click the link for more information.
The Header Error Correction (HEC) is the last field in the Asynchronous Transfer Mode cell consisting of an 8-bit CRC of the cell's header only.

It consists of the remainder of the division of the 32 bits of the header by the polynomial .
..... Click the link for more information.
The ITU Telecommunication Standardization Sector (ITU-T) coordinates standards for telecommunications on behalf of the International Telecommunication Union (ITU) and is based in Geneva, Switzerland.
..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter