Mailing List Archive

gpg from cronjobs
If I want to have process (say from a cronjob) decrypt files with no
interaction, what is the best way ? I have created a keypair for this
purpose and did not put in a passphase. This worked, but I know this
isn't very secure. So I also made a keypair with a passphase, but I
haven't found a way to supply the passphrase on the command line (which
is also insecure).

Any thought on which is the lesser of two evils? Or perhaps a better
solution to this?

Thanks,

Paul
Re: gpg from cronjobs [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 21 Dec 1999, Paul Letta wrote:

> If I want to have process (say from a cronjob) decrypt files with no
> interaction, what is the best way ? I have created a keypair for this

It seems to me that being able to decrypt without interaction defeats (to
a degree) the intent of having it encrypted in the first place. That
being that your interaction is required to decrypt it, and thus reveal its
contents .

> purpose and did not put in a passphase. This worked, but I
know this
> isn't very secure. So I also made a keypair with a passphase, but I
> haven't found a way to supply the passphrase on the command line (which
> is also insecure).

Both true.

>
> Any thought on which is the lesser of two evils? Or perhaps a better
> solution to this?
>
> Thanks,
>
> Paul

I believe there is a batch mode which can read the passphrase from a file.
I suppose you could also tie some scripts together to accomplish this.
Perl by itself might be able to, or perhaps you can use excpect. Either
of these, in fact any solution, will involve either putting the passphrase
in one kind of file or another, or leaving no passphrase on the key.

- -dave


~~~~~~~~~~~~~~~~~~~~~~
dlh@acu.cs.umb.edu
http://www.cs.umb.edu
~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4YEcukk29ehvsO3kRAvLcAKDA63cZ9txxly2T1SDj5PR4TcnArgCglTpa
dlj3s/0e1Qpmt0kPKUm5dYc=
=zmr6
-----END PGP SIGNATURE-----
Re: gpg from cronjobs [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Harvill, at 22:36 on Tue, 21 Dec 1999, wrote:

> I believe there is a batch mode which can read the passphrase from a file.
> I suppose you could also tie some scripts together to accomplish this.
> Perl by itself might be able to, or perhaps you can use excpect. Either
> of these, in fact any solution, will involve either putting the passphrase
> in one kind of file or another, or leaving no passphrase on the key.

Personally, I just say go for the key without a passphrase.

Here's thoughts on the issue:

Normally, the security of your secret keys relies on the usage two things,
the security of your system, and the security of the passphrase in your
head. The passphrase you use for your key really isn't necessary to the
use of OpenPGP; it's just a security mechanism for your protecting your
secret key. Regardless, abiding by convention and using a passphrase to
encrypt your secret key requires that two different things be compromised
before your OpenPGP communication is compromised, and having layring in
security like this gives people a warm feeling all over.

In your case, you are trying to achieve communication using OpenPGP
without securing your private key withou a passphrase. Now, assuming you
were just communicating between two points, this could be just as bad as
using a human-generated secret passphrase; in this example, the secret of
the communication is probably more easily broken by brute-forcing the
shared secret passphrase or breaking into the system. However, in your
case, the security of your OpenPGP communication is reliant soley on the
security of your system, and this could be a very, very, very bad thing,
especially if you have any idea how often various vulnerabilities become
exposed for virtutally ever operating system.

If this is sensitive information, the only hope of really keeping your
system secure is for no users to be on the system, and no daemons are run
on the system; get your information from a 'suck' (e.g., wget), and hope
your wget program is secure; preferably, run it in a tight, tight
environment (I smell chroot).

Of course, if this really isn't that sensitive sensitive enough of
information, you are free to use it on your normal machine without all the
lockdowns of disabling your daemons and users; however, your vunerability
points skyrocket when doing so (especially whlie having local
users). Just keep in mind the security of your communications is is
solely reliant on the ability of someone not being able to break your
system.

- --
Frank Tobin http://www.neverending.org/~ftobin/

"To learn what is good and what is to be valued,
those truths which cannot be shaken or changed." Myst: The Book of Atrus

OpenPGP: 4F86 3BBB A816 6F0A 340F 6003 56FF D10A 260C 4FA3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (FreeBSD)
Comment: pgpenvelope - http://www.uiuc.edu/ph/www/ftobin/resources.html

iEYEARECAAYFAjhgWl0ACgkQVv/RCiYMT6MHawCfaMnBEQrnZtBv4kkLMd+zB/Xe
jfgAn3Ziu+VgvHrF63EKPXAd59fYGfia
=Lueu
-----END PGP SIGNATURE-----
Re: gpg from cronjobs [ In reply to ]
On Tue, Dec 21, 1999 at 10:57:51PM -0600
Frank Tobin wrote:

> Personally, I just say go for the key without a passphrase.

I agree with you.

A thing which might help a little bit in this case is the ability
to remove the passphrase selectively from a secondary key. This way
you can decrypt without a passphrase but still leave your signing key
protected - so in case someone breaks into your system (and you have a
really good passphrase - quite random and written down somewhere) you
can keep the signatures on your key and create a new encryption key.
Well, all messages ever send in the past are now subject to decryption
by the cracker.

Another more "secure" way could be an export-secret-key which replaces
the primary key with a dummy one (at least the secret part of it).

I have to see whether I can implement one of these things. I see
quite a lot of applications which could benefit from it. Frankly
I have a ned for this too.


--
Werner Koch at guug.de www.gnupg.org keyid 621CC013

Boycott Amazon! - http://www.gnu.org/philosophy/amazon.html