473,385 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ANN hashtar 0.1: archival encryption to corruptible media


hashtar is a utility designed for encrypted archiving to media
vulnerable to corruption (eg, CDR, DVDR).

http://nitace.bsd.uchicago.edu:8080/hashtar

Comments, bug reports, suggestions for improvement all welcome.

John Hunter

OVERVIEW

hashtar: an encrypted archive utility designed for secure archiving
to media vulnerable to corruption.

Recursively encrypt the files and directories passed as arguments.
Rather than preserving the directory structure, or archiving to a
single file as in tar, the files are encrypted to a single dir and
named with the hash of their relative path. The file information
(filename, hash, permission mode, uid, gid) is encrypted and stored
in the header of the file itself, and can be used to restore the
original file with dir structure from the archive file.

For example, the command
hashtar.py -cvf tmp.htar finance/
prompts for a password and generates an encrypted recursive archive
of the finance dir in the tmp.htar dir, with filenames mapped like

finance/irs/98/f1040.pdf -> tmp.htar/e5/e5ed546c0bc0191d80d791bc2f73c890
finance/sale_house/notes -> tmp.htar/58/580e89bad7563ae76c295f75aecea030
finance/online/accounts.gz.mcr -> tmp.htar/bb/bbf12f06dc3fcee04067d40b9781f4a8
finance/phone/prepaid1242.doc -> tmp.htar/c1/c1fe52a9d8cbef55eff8840d379d972a

The encrypted files are placed in subdirs based on the first two
characters in their hash name because if too many files are placed
in one dir, it may not be possible to pass all of them as command
line arguments to the restore command. The entire finance dir
structure can later be restored with
hashtar.py -xvf tmp.htar
The advantage of this method of encrypted archiving, as opposed to
archiving to a single tar file and encrypting it, is that this
method is not sensitive to single byte corruption, which becomes
important especially on externally stored archives, such as on CDR,
or DVDR. Any individual file contains all the information needed to
restore itself, with directory structure, permission bits, etc. So
only the specific files that are corrupted on the media will be
lost.

The alternative strategy, encrypting all the files in place and then
archiving to external media, doesn't suffer from single byte
corruption but affords less privacy since the filenames, dir
structure, and permission bits are available, and less security
since a filename may indicate contents and thus expose the archive
to a known plaintext attack.

A match string allows you to only extract files matching a given
pattern. Eg, to only extract pdf and xls files, do
hashtar.py -m pdf,xls -xvf tmp.htar
Because the filenames are stored in the header, only a small portion
of the file needs to be decrypted to determine the match, so this is
quite fast.

Data can be encrypted and decrypted across platforms (tested between
linux and win32 and vice-versa) but of course some information may
be lost, such as uid, gid for platforms that don't support it.

USAGE:
hashtar.py [OPTIONS] files
OPTIONS

-h, --help Show help message and exit
-fDIR, --arcdir=DIR Write hashed filenames to archive dir
-pFILE, --passwdfile=FILE
Get passwd from FILE, otherwise prompt
-mPATTERN, --match=PATTERN
Only extract files that match PATTERN.
PATTERN is a comma separated list of strings,
one of which must match the filename
-u, --unlink Delete files after archiving them
-c, --create Create archive dir
-x, --extract Extract files recursively from archive dir
-v, --verbose Decrypt files recursively

WARNING:

I think this software is suitable to protect your data from your
sister, your boss, and even the nosy computer hacker next door, but
not the NSA.

REQUIREMENTS:

python2.3 - python.org
yawPyCrypto and Flatten - http://yawpycrypto.sourceforge.net/
pycrypto - http://www.amk.ca/python/code/crypto.html

The python dependencies are very easy to install; just do the usual python setup.py install

PLATFORMS:

Tested on linux and win32

AUTHOR:

John D. Hunter <jd******@ace.bsd.uchicago.edu>

LICENSE:

same as python2.3

KNOWN BUGS:

Ignores symbolic links

DEDICATION:

For Erik Curiel, who's life's work I lost when I volunteered to
backup the only copy of his home dir on a CD containing a single
encrypted gzipped tar file, which was subsequently corrupted.

Jul 18 '05 #1
0 1509

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: c3poptuse | last post by:
Supercomputer and encryption and compression @ rate of 96% Take a document then or a 3D matrix document change it two random or binary code or just a program for 0's and 1's and fold it over and...
1
by: Garmt de Vries | last post by:
For a long time, I've used CSS to style my webpages, but only for media "screen" and "print". Now I've started looking into styling them for other media like "projection" and "handheld". I'd be...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
1
by: Vanga Sasidhar | last post by:
Hi All, I am developing a program in Visual Basic .NET 2002. There are some videos in AVI format. For the protection of these AVI files i encrypted my files with the use of DES algorithm in the...
4
by: subeen | last post by:
Hi, I am trying to parse a rss similar to the one found here (in example) http://www.feedforall.com/mediarss.htm <!-- Snipped for Brevity --> <item> <title>FeedForAll's Show Tunes and...
0
by: Konrad | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
0
by: kplazinski | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
0
by: kplazinski | last post by:
Hi everyone. I've got problem with converting xml file to xsd schema. The Xml file looks like: <?xml version="1.0" encoding="iso-8859-2"?> <rss version="2.0"...
1
by: deshaipet | last post by:
As only primary database does archival logging - 1) How should I setup archival logging(LOGARCHMETH1 and LOGARCHMETH2 for Primary and Standby databases in HADR setup ? 2) Should I only use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.