Webscript Problems....Converting from PGP to GPG
Tue Jul 8 20:52:03 2003
Content-Description: signed data
On Tuesday 08 Jul 2003 5:09 am, Todd G. Hewett wrote:
> Howdy Folks,
> I am trying to get a perlscript working using GPG as opposed to the
> PGP50i it is currently working with.
> The PGP Command is...
> (/usr/local/bin/pgpe -fatr firstname.lastname@example.org +force=3D1 2>/dev/null) |
> /usr/bin/mail -s 'Title of subject line' email@example.com
> The GPG command I thought would work is.
> (/usr/bin/gpg -fatr 'firstname.lastname@example.org' +force=3D1 2>/dev/null) | /bin/mail -s
> 'Title of subject line'
What's the +force all about?=20
Gpg is NOT a port of PGP - the same commands cannot be relied upon to perfo=
the same functions or even exist at all in one compared to the other.
> The following command line input sends an email fine.
> echo 'check this out' | (gpg -ater 'email@example.com' 2>/dev/null) |
> /bin/mail -s ''Title of subject line' firstname.lastname@example.org
> And this command line sends an empty message
> echo 'check this out' | (gpg -fatr 'email@example.com' 2>/dev/null) |
> /bin/mail -s 'Title of subject line' firstname.lastname@example.org
gpg would normally look for a file to encrypt
To get the output to understand what is happening, just ditch the 2>dev/nul=
and this should appear:
gpg: can't open check this out: No such file or directory
gpg: check this out: encryption failed: file open error
In a Perl script I use:
echo "$msg" | gpg -a --always-trust $homedir --batch -r $keyid -e 2>&1
$msg is a variable containing the message
I use --always-trust only because this is a remote application that already=
uses user authentication.
$keyid is another variable holding the verified keyid of the recipient.
> I am hoping there is something obvious that someone can help me with here.
I can't see an option gpg -f in man gpg.
Other than that, you need to redirect stderr to stdout (2>&1 ) in order to =
the encrypted output.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----