file checksum?

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Sep 30 15:44:31 UTC 2013


On Mon, Sep 30, 2013 at 11:13 AM, William Park <opengeometry-FFYn/CNdgSA at public.gmane.org> wrote:
> Hi,
>
> I would like to do some kind of "checksum" on files (full or partial
> content) in order to catch unwanted changes (accidental or malicious).
> How would you do it?
>
> So far, I found
>     - MD/SHA digests from OpenSSL -- I'm worried about speed, and being
>       dependent on yet another library.
>     - crypt() from glibc -- It can do MD5/SHA, but it has to be a single
>       string.  It can't do multiple strings.
>
> Is there user-callable CRC routines in glibc?  Curiously, I can't find
> one, even though I'm told that TCP stack uses it internally.

Well, it's logical that something used in the TCP/IP stack would NOT
be a dependency from GLIBC, as the kernel can't depend on GLIBC.

Note that tripwire is a mature system for doing this sort of thing; it's
sufficiently mature that its mechanisms have been adopted by other
tools too (cfengine, AIDE).

I'd be much more inclined to use some existing implementation
(tripwire, AIDE, cfengine) over "rolling my own", as others have
already struggled through debugging and odd bits of semantics.
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list