[vox-tech] shell script challenge

Jeff Newmiller vox-tech@lists.lugod.org
Wed, 7 Aug 2002 22:42:38 -0700 (PDT)


On Wed, 7 Aug 2002, GNU Linux wrote:

> On Wed, Aug 07, 2002 at 08:35:16PM -0700, Micah Cowan wrote:
> >  > md5 is a better way to go than checksums.
> > 
> > Er... no. MD5 *is* a checksum.
> 
> No, it's a message digest :)
> Yeah, I guess it is a checksum.
> 
> The "checksums" that people usually think of, aren't they CRC checksums?

The term "checksum" used to mean "add all the bytes in a block of data
modulo some convenient number of bits to obtain a small number
representative of the data in the block". This "check value" has the
undesirable characteristics of yielding no differences or only one bit
difference in the final value for most one bit errors, and many two-bit
errors yield no change in the final value. By contrast, the cyclic
redundancy check (crc) has the desirable behavior of yielding drastically
different values as each successive bit error occurs. Similar behavior
is characteristic of good cryptographic signatures as well.

"Checksum" has (in the last decade or so?) acquired a more general and
less precise definition as any algorithm, not just integer addition, used
to generate a hash based on a large number of bits.  I don't know if this
is what people "usually think of", but some people do.

In general, I prefer the to reserve the term "checksum" for the older,
more precise definition, and use more precise terms such as "CRC" for a
specific type of calculation, or "hash" in the more general case.  I
prefer this because the older meaning of "checksum" implies an algorithm
that is very poor at detecting many common types of data corruption, and I
would not want to accidentally convey that implication if I actually meant
something that did a significantly better job.  I, too, sometimes "misuse"
the term "checksum", but only in the context of a specific protocol if the
documentation for that protocol uses that term and yet defines it clearly
as a better hash function.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------