CDCheck 3.0 Help
Help version 1.0    Author: Mitja Perko Copyright (C) 2002 Click here to view the online help
 
CRC

CRC setup window

Creating CRC files
To create a CRC file you must first select the directory in the File Tree for which you wish to create a CRC file. CRC file can be only created for directory with all subdirectories.

After that press "CRC" button to show the CRC setup confimation. Here you can correct the selected directory and specify alternative CRC filename (and directory) for output. If CRC file already exists with this name it will be overwritten! Press Next to start creating CRC file or press Cancel to exit CRC file setup.

CDCheck by default suggests the name of output CRC file. This name is generated as following:
- source is fixed drive DRV (hard drive etc.) => DRV\drive_DRV.CRC
- source is non-fixed drive DRV with volume VOL (cdrom etc.) => DRV\volume_VOL.CRC
- source is non-root directory DIR => DIR\DIR.CRC

Note! CRC file is always created relative to the selected source directory. For automatic detection to work during checking CRC file should be put in the source directory after creation or already created there. However if it cannot be in the source directory (if directory is read only or you do not have enough privileges) you can specify alternative output filename (in different directory) and later use custom CRC option in Checking to use it.

Tip 1: if you do not need the setup confimation dialog you can hold shift down while clicking the button and the crc will start with last options used and selected directory as source directory.

Tip 2: the output CRC filename directory can be set to "default CRC directory" set in "Options" by setting focus to output CRC filename and selecting the first item (pressing key down)

Warning (advanced users): under Win95,98,Me it is not recommended to create CRC files on directories containing directory/filenames with non-locale characters (for example Chinese characters on US version of Win98). These "non-locale files" can be produced only by some other OS and are easy recognizable since they contain '_' character and they cannot be copied by Windows Explorer.

What exactly is CRC and CRC file?
CRC stands for Cyclic redundancy code. It is a code that provides efficient error detection. It is used by many programs (for example Zip compression programs, communication protocols...). There are many variants of this code. In CDCheck CRC-32 algorithm is used to produce CRC-32 code.

CRC-32 is an acronym for the 32 bit Cyclical Redundancy Check algorithm. CRC-32 generally refers to a specific 32 bit CRC formula sanctioned by the CCITT, an international standards body primarily concerned with telecommunications. CRC-32 is used in communications protocols such as HDLC and ZMODEM to verify the integrity of blocks of data being transferred through various media.

CDCheck CRC file is a file that contains CRC-32 code separately for each file in source directory and its subdirectories. For more information on format itself see CRC file format.

How reliable is it?
CRC-32 code is 32 bit number (code) generated by CRC-32 algorithm based on data input (in our case file content). This code is some sort of a "fingerprint". However it differs somewhat from the human fingerprint. It is often said that no two people have identical fingerprints. This can't be the case for our CRC fingerprint. Since there are more than 4,294,967,296 different files in the world, it is a foregone conclusion that some of them must have identical codes.

However, the CRC-32 does have attributes that make it very attractive for the verification of files. These include the following:
- Every bit in the message contributes to the CRC. This means that changing any bit in the message should change the CRC.
- Relatively small changes in the message should always result in changes in the CRC. We want to be sure that it would take an extremely unlikely combination of errors to produce an identical CRC.
- The histogram of output CRC values for input messages should tend to be flat. For a given input message, we want the probability of a given CRC being produced to be nearly equal across the entire range of possible CRCs from 0 to FFFFFFFFh.

These are the goals that the CCITT had in mind when selecting the CRC-32 algorithm. In practice, the chances of inadvertently damaging or modifying a file without modifying the CRC is vanishingly small, so for all practical purposes testing CRC code to detect changes can be considered to be infallible.

However if file would be intentionally damaged (for example by a virus) the CRC could be restored to its previous state. This could be done by using using brute force method to add some bytes to end of the file. So this is one thing it cannot protect you from (although this is almost never done).

ADVANCED: CRC file format
CRC file is written in Unicode text format. To indicate that file is Unicode at the beginning the character FEFFh is written. Further the file consists of two sections. These are header and data.

Header
In header basic information is written about file format version, CRC type and date of file creation. Currently only Date is changing while the rest of the header is fixed. Date must be of form dd.mm.yyyy.
[Info]
Version=1
Format=CRC-32
Date=19.07.2001

Data
In data the CRC information about files is written. Lines following [Data] are of DIR or FILE type. The order of files and directories is determined by the following sort algorithm:
- files in directory are tested first then directories
- files and directories are sorted by name using LANG_ENGLISH and SUBLANG_NEUTRAL.

DIR type: DIR [directory]
[directory] is full relative path of directory where the files following this line are in.

FILE type: [CRC-32] [file name]
[CRC-32] is calculated CRC-32 code of file [file name]

Example:
[Info]
Version=1
Format=CRC-32
Date=19.07.2001

[Data]
DIR Start Menu\Programs\
B1E71BFF CDCheck.lnk
9DF41063 CDMASTER.lnk
DIR Start Menu\Programs\Utils\
4D6985CE Gibby.exe

ADVANCED: CRC implementation
CRC is implemented using concurrent reading and CRC calculation. This is done by writing data from media into intermediate buffer in one thread and reading from buffer and calculating CRC values in other thread. CRC values are written to disk as they are calculated to minimize memory usage.

BACK  FRONT PAGE NEXT

Copyright (C) 2002, Mitja Perko (CDCheck homepage)