[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] SHA1 checksums and such...

From: Klamer, Paul
Subject: [Bug-tar] SHA1 checksums and such...
Date: Tue, 22 Jul 2014 12:15:03 -0400

I have an internal version of tar-1.27 which calculates md5, SHA1, SHA256, & SHA512 checksums of all of the files during create and extract. This functionality is essential to archivists and would be a worthwhile addition to the next release.

Unfortunately, I’m not very good at autotools, so I patched the existing Makefiles in the distribution. It builds on RHEL5 and FC19 boxes which I need it on. I don’t have time to get the configure script to  make it any more portable.

I only changed source files, create.c, extract.c, tar.c and common.h, as well as the Makefile (see attached) and added the library OpenSSL and compiled with the -D_FILE_OFFSET_BITS=64.  


The new args are –md5, –sha1, --sha256, --sha512.

It will print any or all of the checksums at once to stdout.

It works for tar creation as well as extraction. So, if you do this:

>tar –cvf foo.tar *.* --sha1 >> foo_create.log

<later that day…>

>tar -xvf foo.tar –sha >> foo_extract.log

>diff  foo_create.log foo_extract.log

You will have verification that all of the checksums match.


We are using it to read LTO tapes from other archives.  

address@hidden junk]# /home/lto/tar-1.27c/src/tar -xvf /dev/nst0 -b 8192 --md5 --sha1


SHA1= 69be91559661a560f6ce41d37efbd1f6417fc820

MD5= af4cb0e42bc37757ec3b37e7d38b15a1


address@hidden junk]# sha1sum AA0200L5/cpb-aacip-293-75r7t00t/data/cpb-aacip-293-75r7t00t.j2k.mxf

69be91559661a560f6ce41d37efbd1f6417fc820  AA0200L5/cpb-aacip-293-75r7t00t/data/cpb-aacip-293-75r7t00t.j2k.mxf


Please consider adding this function to future releases.






Paul Klamer

Video Lab Supervisor

Library of Congress

Packard Campus

19053 Mt. Pony Road

Culpeper, VA  22701

(202) 707-3937


Attachment: common.h
Description: common.h

Attachment: create.c
Description: create.c

Attachment: extract.c
Description: extract.c

Attachment: Makefile
Description: Makefile

Attachment: tar.c
Description: tar.c

reply via email to

[Prev in Thread] Current Thread [Next in Thread]