home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
WINDOWS
/
VIRUS
/
WINCRC2
/
WINCRC.DOC
< prev
next >
Wrap
Text File
|
1994-03-01
|
19KB
|
521 lines
WinCRC
Cyclical Redundancy Code
Generator for Windows
Version 1.0
Eric Roe
3137 Briarcliff Avenue
Vestal, New York 13850
Copyright (c) 1994
INTRODUCTION
Welcome to WinCRC version 1.0. WinCRC can generate many of
the most popular CRCs, checksums, and message digests for
your files. This information can be written to a special
'key file', so you can verify your files at a later time.
"What exactly is a CRC?", you might ask. CRCs or Cyclical
Redundancy Codes are a popular method of error control for
digital data -- like a file on your PC. A CRC generator
takes as input a stream of digital data, does some
mathematical footwork on the data, and outputs a number
called (amazingly) the CRC. This number, which is usually
16 or 32 bits in length, can be used to detect any errors
which might occur (or be introduced) into the original
data. How? WinCRC does it by comparison.
Say you want to verify that a certain file has not been
corrupted. If you had generated a CRC for the file at an
earlier date, you could simply generate a CRC for the same
file again -- making sure you used the same CRC method. If
the two CRCs are identical, the file is most likely intact.
I say 'most likely' because there is always a possibility,
usually extremely remote, that an error is not detected.
This method of comparing two CRCs also works with checksums
and message digests.
Checksums and message digests are also used for error
detection. Checksums are quite fast but are not terribly
robust. As their name implies, they are the sum of each
byte of the input data. Since it's easy to get several
different numbers to add to the same sum, checksums can be
fooled with very little effort. Message digests, at 128
bits in length, are extremely secure. It has been theorized
that it is not computationally possible to generate two
files that will have the same message digest. This
security does come at a cost -- it's more time consuming to
generate a message digest than a CRC or checksum.
"OK, so what good does it do me?" A good question. Any
time you move data around there's a chance of an error
creeping in. Most telecommunication software has some form
of built-in error detection. That way if there's a glitch
when you're downloading or uploading a file, the software
can re-send the part that got messed up. The same thing
can happen when you move a lot of data around on your PC.
A very good example is a hard disk defragmenting program.
On a large drive, hundreds of megabytes might be swapped
about. If a single bit in your favorite game gets
inverted... POOF! it might not work. Or, what happens if
there's a power loss when defragmenting? Which, if any,
files might be corrupted? There's the magic of WinCRC.
Use WinCRC to generate a key file for any files you're
concerned about. Then do the defragmentation, tape backup,
or whatever other operation you need to do to your files or
disk. Now when the defrag program is done or you've
restored from tape, use WinCRC to do a file verification.
Any files whose CRCs have changed will be flagged and their
name and error recorded. You can easily pinpoint any
erroneous files and deal with them. If a particular
package has been zapped, you only have to re-install it and
not worry "Maybe something else is messed up too." It
saves a lot of time if you only have to re-install one
package, rather than everything on the drive just to get
peace of mind.
WinCRC version 1.0 can generate the following 16 bit CRCs:
CRC-16 CRC-CCITT SDLC
IBM CRC-16 Reverse CRC-CCITT Reverse
SLDC Reverse IBM Reverse LHA
ARC Zoo LRCC-16
and these 32 bit CRCs:
CRC-32 ETHERNET ZModem
PK-Zip ARJ
It can also generate the following checksums (the number
indicates how many bits wide it is):
Checksum 8 Checksum 16 Checksum 32
and these 128 bit Message Digests:
MD4 MD5 (experimental; see note)
** Note that many of these are actually the same CRC but
with different names. See ALIASES for more information.
USING WINCRC
SELECTING A KEY FILE
WinCRC is most useful when you are using a Key File. When
generating CRCs, WinCRC can write the filename, path, and
CRC to the key file. This same key file can be used to
verify the files. When WinCRC starts, no key file is
selected and '<none>' is shown for the key file. Press the
'KEY FILE' button and the Select Key File dialog will pop
up. By default, files with the extension .KEY are shown.
You can type a new search spec and click 'OK' or hit
<RETURN> and whatever spec you entered will become the new
default for this session.
Select an existing key file or type a name in the Filename
edit control. If the file exists, it will become the
selected key file. If not, you are prompted as to whether
or not you want the file created. Select 'YES' to have the
file created or 'NO' to return to the Select Key File
dialog. Note that the file is NOT created until you
actually do a generate.
Once you have selected a key file, you must check the 'Use
Key File' check box to actually use the file. The Verify
option requires you select a key file and check the Use Key
File option before it becomes available.
WinCRC tests the selected key file to make sure it's valid.
If you're generating CRCs and the key file does not yet
exist, it is created. If the file exists, but is not a
WinCRC key file, CRC generation or verification will not
continue.
Key files are standard ASCII files and can be viewed by
most editors including Windows Notepad, MS-DOS Edit, and
DRDOS Editor.
GENERATING
You can Generate CRCs for files with or without a key file.
If you don't use a key file, the CRC for each file is
generated and you can choose to do the next file or to
quit. The CRC is shown on the 'Message:' line of the
Generating dialog box. When using a key file, the CRC is
not shown.
Before generating any CRCs you'll need to select some files
and also what method you're going to use. The current CRC
method is indicated in the 'Method' drop down combo box.
After selecting what method to use you have to ways to
select some files. You can use the Files listbox to select
file individually, or the Include/Exclude edit controls to
set up a 'File Inclusion Mask.'
WinCRC can generate CRCs for all files that fit a given
specification. The basic logic is to include any files
that: have been selected in the file listbox, or those that
match the Include specification but not an Exclude
specification. The Include/Exclude controls use standard
DOS wildcards and can contain multiple specifications
separated by spaces.
For example, to include all files with .COM and .EXE
extensions type: '*.EXE *.COM' (don't type the single
quotes) in the Include edit control. Remember to put a
space between the two specs. Now if you click 'GENERATE',
CRCs for all .EXE and .COM files will be generated. If you
want to Exclude any files that start with the letter 'A' or
'B', just enter 'A*.* B*.*' in the Exclude line. Now
you'll get all .EXE and .COM files that don't begin with
either A or B. Since files selected in the Files listbox
are always included, you can override the Include/Exclude
specifications for the directory WinCRC is currently in.
If you're using a key file, right after you click
'GENERATE', you will be presented with the Generate Options
dialog box. This dialog contains two check boxes. You can
select to overwrite an existing key file and/or to record
only file (no path) information in the key file. Recording
only file info is useful if you're moving a group of files
and don't know if they'll have the same path specification.
The file SAMPLE.KEY included with this package was
generated without path info in the key file. Note that
because no path info is recorded it's not very useful to
check Include Subdirectories; you'll just end up with alot
of File Not Found errors when you do a Verify.
VERIFYING
To verify files, you must have selected a key file. Check
the Use Key File check box and the 'VERIFY' button will
become active. When you press 'VERIFY', CRCs for all files
in the key file are generated and then compared to the
stored values. If the CRCs don't match or a file can't be
found, the error is printed on the 'Message:' line in the
Verifying dialog. The file in error and the error message
is also written to a file named WINCRC.ERR. Like key
files, WINCRC.ERR is a standard ASCII file. Each time you
use Verify, WINCRC.ERR is overwritten.
WINCRC.ERR is located in the working directory for WinCRC.
You can change the working directory by using the Program
Manager.
During verification, WinCRC will stop when it encounters an
error. You can press 'NEXT' which continues but will stop
with the next error, or you can press 'FINISH' which
continues without stopping until all files have been
verified. It you use the Finish option, you can always
look in WINCRC.ERR to check on any verification errors.
When using Verify with a key file that includes file names
but no path information, you must be in the directory that
contains the files to be verified otherwise WinCRC won't be
able to find the files.
There is one thing to note when using CRCs to verify files.
Many programs maintain configuration files. SYSTEM.INI is
an example of one of Microsoft Window's config files. Some
programs actually write configuration information to their
executable rather than in a separate file. Of course if
the file changes, so does the CRC. In these cases, the file
has not been corrupted, rather the user has changed one or
more of the program's options. To avoid having WinCRC flag
these files, make your changes BEFORE, using WinCRC to
generate CRCs.
CHOOSING A DEFAULT METHOD
When you first run WinCRC, the default method is Checksum
8. WinCRC can maintain a different default method in the
file WINCRC.INI. To choose a new default method choose
'DEFAULT', select whichever method you want, and click
'OK'. Next time you run WinCRC, the method you selected
will be the current one. Note that choosing a new default
method does not alter the current method selected for this
session.
ALIASES
A number of the methods WinCRC uses are known by several
different names. The table below shows the alternate
names.
Method Alias
--------------------------------------------------
CRC-16 ARC, LHA, Zoo
CRC-32 ETHERNET
ZModem PK-Zip, ARJ
CRC-CCITT SDLC, IBM
CRC-CCITT Reverse SDLC Reverse, IBM Reverse
Do not confuse CRC-32 with PK-Zip or ARJ. PK-Zip and ARJ
precondition the CRC before and after generation. CRC-32
does not. If you use CRC-32 you won't get the same CRC
values that PK-Zip or ARJ generate.
KEYBOARD USERS
If you're using a keyboard rather than a mouse, all of the
Window's controls respond in their default fashion. I.e.
to "press" a button, tab to it and then press the space
bar. The one exception it the Directories list box on the
main window. Since there is no button to switch to another
directory, this list box uses the <RETURN> key. Hightlight
the directory you want (using the arrow keys or spacebar)
and then press <RETURN>. WinCRC will switch to the new
directory.
A NOTE ON MD5
As of version 1.0 of WinCRC, I am considering my
implementation of the Message Digest 5 algorithm
experimental. Although the algorithm is similar to MD4, I
didn't have any other working code to verify the MD5
results that WinCRC generates. If you're not getting the
MD5 output that you expected, this is probably the reason.
REGISTRATION
WinCRC is not a free or public domain program. You may use
it for a period of thirty (30) days for evaluation
purposes. To continue using it after that, you must
register the software. The more people who register, the
more incentive I have to update the program and implement
user suggestions. Makes sense, huh?
To register, send a check or money order for US $15.00,
payable to Eric Roe, to the following address:
Eric Roe
WinCRC Registration
3137 Briarcliff Avenue
Vestal, New York 13850-2859
Also, if you have any comments and/or suggestions on how I
can improve WinCRC you can send them to me at the above
address. I can also be reached via e-mail at:
ericroe@aol.com.
DISTRIBUTION
WINCRC.EXE and associated help files and documentation are
Copyright (c) 1994 by Eric Roe, all rights reserved. They
may not be distributed in an incomplete or modified form,
nor can they be sold for profit without prior written
consent of the author.
If this software is to be distributed it must be
distributed as a package consisting of the following files:
WINCRC.EXE
WINCRC.HLP
WINCRC.DOC
WINCRC.ERR
SAMPLE.KEY
REGISTER.DOC
README.1ST
Software dealers and shareware libraries may charge a
minimal copying/disk fee for the above package not to
exceed US $8.00.
DISCLAIMER
This software, WINCRC.EXE and its associated documentation
and help files, is provided on an "as is" basis without
warranty of any kind, express or implied, including, but
not limited to, implied warranties of merchantability,
fitness for a particular purpose, functionality, data
integrity, or data protection. Persons using this software
bear all risk as to the quality and performance of the
software. The author will not be liable for direct or
indirect damages or data loss, even if the author was
informed of the possibility of such damages or data loss.
Suggestions, improvements, diagrams, and other documents or
documentation sent to the author become property of the
author. No reimbursements or remuneration will be made.