pea - Perl Encryption Assistant
- pea
-
[--man | --help | --version | --delete-log | --encrypt-log] [--username=<gpg username>]
[--directory=<source dir>] [--destination=<destination dir>]
[--pattern=<renaming pattern] [--glob=<glob>] [--keep-files | --debug-keep-all]
[--keep-log | --keep-local-log=<logfile name>] [--verbose]
- Version
-
pea - Perl Encryption Assistant version 0.2.0
Note: this version of pea is still highly experimental.
Use at your own risk.
Please report bugs to: sven-thorsten.fahrbach@gmx.net
- --help
-
Print a brief help message and exit.
- --version
-
Print version information and exit.
- --man
-
Show the pea manpage.
- --username
-
Specify a username for gpg. Note that gpg needs
your username in order to encrypt a file (in fact
it looks for keys associated with the given username).
The username is usually an e-mail address like
foo@bar.net or the name you entered when you had
your key generated. You will of course need to have
a gpg key before you can have your files automatically
encrypted by pea. Use gpg --gen-key to get a key.
- --directory
-
Specify a source directory for pea. The default is
the current working directory.
- --destination
-
Specify a destination directory. On default pea will
try to create a subdirectory pea. If this directory
or the directory specified by you already exists pea
will exit and you will either have to give pea another
directory or remove the old one.
- --pattern
-
Specify a pattern for renaming files. On default pea
will not rename the original files (which is probably
a bad idea since you can still get some information
about the content of the respective file by simply
looking at the file name. If you only want the contents
to get encrypted, this won't probably matter much to you
but if you want to keep your nosy brother from knowing that
you keep a 'highly_confidential_diary.swx' you might not
be entirely happy with the filename
'highly_confidential_diary.swx.gpg'. Of course you can still
rename it yourself after having it encrypted, but hey - I
wouldn't have written this script if I still wanted all the work
to be done by myself).
If you give pea the pattern 'crypt_file' it will generate the
filenames 'crypt_file1' through 'crypt_file[n]' where [n] is
the number of files encrypted. You can also set a starting
point like 'crypt_file01'. This feature is not fully implemented
yet, though, and you are bound to end up with some strange results.
It won't do any harm to your files, however, so you could still
try something like 'crypt_file42' if you already had 'crypt_file1'
through 'crypt_file41' in your destination directory.
- --glob
-
Specify a glob if you only want certain files to be encrypted.
You can give the glob '*.tar' to the program if you only want
to encrypt your tar files.
- --keep-files
-
Set this option if you don't want to delete the original files
after having them encrypted.
- --debug-keep-all
-
Set this option if you don't want to delete any files, neither
the original ones (in the original directory) nor the ones moved
to the new directory.
- --keep-log
-
Writes verbose information to log file pea_log in ~/.pea/. I take
it that you are sensible enough not to keep a log file if you are
dealing with confidential data. Anyway, the directory ~/.pea/ has
the umask 0700, i.e. full access to the owner and none to anybody
else. If in doubt, I suggest to use the option --keep-local-log
(see below).
- --delete-log
-
Deletes the logfile ~/.pea/pea_log and exits.
- --keep-local-log
-
Writes verbose information to a log file specified by you in the
same directory as the encrypted files.
- --encrypt-log
-
Encrypts the log file in ~/.pea/. You have to specify your gpg
username with --username or else you will be prompted for it.
After having the logfile encrypted pea creates a new, empty, one.
- --verbose
-
Print some verbose information.
pea is an acronym for Perl Encryption Assistant. gpg (GNU
Privacy Guard) is a wonderful tool for encrypting files
on the command line but it won't let you process more than
one file at a time. On default it also keeps the original files
that you then have to remove manually. This was the motivation
for writing this script. Please note that this program is still
to be considered highly experimental. A look at the version
number (0.2.0) should give you an idea not to blindly trust it.
pea does work more or less reliably though so that I hope that
it will come in handy now and again.
Under no circumstances use the tool with administrator rights
(at least not in this stage of development).
pea accepts some options which are explained under OPTIONS.
- pea
-
pea used alone assumes that you want to encrypt all file in the
current working directory. It scans the directory using the glob
* (not * .* if you also want to encrypt hidden files, use the
--glob argument explicitly). It then goes on to create the
subdirectory 'pea' and exits if it already exists. It moves the
files from the pwd into the newly created subdirectory and does
not rename them. It then calls gpg for each file and removes the
old, not encrypted files.
- pea --directory=foo --destination=bar glob=``* .*'' --pattern=crypt --username=foo@bar.net --keep-files
-
Looks for all files (including the ones starting with a .) in
directory foo and moves them to directory bar. The files will
be renamed to 'crypt1' through 'crypt[n]' before having them
encrypted by gpg. gpg will also be given the username foo@bar.net.
The original (unencrypted files will not be deleted).
Be reasonably careful when using pea. If you're dealing with
really important files consider making a backup before you
let pea loose on them. Note that this is still an experimental
version. The program should be useful but I do not assume any
liability for the program's work neither do I guarantee that
it will work correctly. You're on the safe side if you make
backup copies of your files before running pea and do not run
it as root.
You can comfortably encrypt a large number of files in one go
using pea but you can't use pea to have them decrypted again.
This is something I might or might not fix in later versions.
Setting starting points for a renaming pattern doesn't work
correctly (see OPTIONS - --pattern).
When calling gpg pea displays an ugly warning message
'Could not call gpg: Illegal seek at ...'. Despite this
message pea *does* call gpg, so, no harm done.
If you find a bug, please report it to
sven-thorsten.fahrbach@gmx.net.
DON'T PANIC.
gpg(1)
Sven-Thorsten Fahrbach
(sven-thorsten.fahrbach@gmx.net)
This program may be used and redistributed under the terms of the BSD License.
Copyright (c) 2005 Sven-Thorsten Fahrbach
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
If you find this program useful and want to contribute something,
I suggest you make a donation to ``Stiftskirche Stuttgart''.
- Bank
-
Landesbank Baden-Württemberg
- Account Number
-
7 294 046
- Bank Number
-
600 501 01
The bank is located in Stuttgart, Germany. Unfortunately I do not
have any experience in tranferring money abroad and so I cannot
tell you how it works exactly if you live outside Germany. No doubt
your bank will be able to advise you.
Note: Unfortunately many people, among them also regular church goers,
leave the community of the church today. The thus resulting lack of
church taxes makes it hard for the congregations to make ends meet. As
a result the churches depend more and more on voluntary financial aid.
Because of that I do urge you to contribute something if you feel that
the program has come in handy. Thank you.
- Sven-Thorsten Fahrbach