Author: | Martin Blais <blais@furius.ca> |
---|---|
Version: | 1.9 |
Abstract
Compare and merge contents of encrypted files relatively safely.
Compare and merge contents of encrypted files relatively safely.
This script wraps around xxdiff, first decrypting the input files to temporary files (for a short time) and running xxdiff on these files. There are two typical uses of this program:
Usage of this program with password caching using gpg-agent makes it much easier to call on multiple files. The user's password given key is asked only once by gpg-agent, kept in memory, and then decryption occurs without user intervention.
The encrypted files are decrypted to temporary files for a short amount of time, and are deleted when xxdiff appears. Note that their deletion is as safe as Python's tempfile module allows it to be (in the author's opinion, safe enough). I left comments in the code to allow a user to review where the files are decrypted so they can judge by themselves if it is safe enough for their use.
We could do much better in terms of safety if we could feed the input files to xxdiff through different file descriptors (not impossible to implement) AND calculate the diffs internally.
(Note that if someone can manipulate which program is used to actually perform the diffs (e.g. modifying an unsuspecting user's resources in ~/.xxdiffrc), they could feed the decrypted files to an arbitrary program.)
xxdiff-encrypted [<options>] <encrypted-file> [<encrypted file> ...]
-h, --help show this help message and exit -xXXDIFF, --xxdiff=XXDIFF specify path to xxdiff program to use -gGPG, --gpg=GPG specify path to gpg program to use -oOUTPUT, --output=OUTPUT require and encrypt merged output. -u, --unmerge split CVS conflicts in single input file and encrypt required output merged file over input -A, --dont-armor Create output file in binary format. -rRECIPIENT, --recipient=RECIPIENT Encrypt for user id name.
Copyright (C) 2003-2004 Martin Blais <blais@furius.ca>. This code is distributed under the terms of the GNU General Public License.