Webscript Problems....Converting from PGP to GPG

Neil Williams linux@codehelp.co.uk
Tue Jul 8 20:52:03 2003


--Boundary-02=_UMxC/Eb4nUt27qf
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Description: signed data
Content-Disposition: inline

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 name@isp.com +force=3D1 2>/dev/null) |
> /usr/bin/mail -s 'Title of subject line' name@isp.com
>
> The GPG command I thought would work is.
> (/usr/bin/gpg -fatr 'name@isp.com' +force=3D1 2>/dev/null) | /bin/mail -s
> 'Title of subject line'
>  name@isp.com

What's the +force all about?=20

Gpg is NOT a port of PGP - the same commands cannot be relied upon to perfo=
rm=20
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 'name@isp.com' 2>/dev/null) |
> /bin/mail -s ''Title of subject line' name@isp.com
>
> ###
> And this command line sends an empty message
> echo 'check this out' | (gpg -fatr 'name@isp.com' 2>/dev/null) |
> /bin/mail -s 'Title of subject line' name@isp.com

gpg would normally look for a file to encrypt

To get the output to understand what is happening, just ditch the 2>dev/nul=
l=20
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=
=20
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 =
get=20
the encrypted output.


=2D-=20

Neil Williams
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
http://www.codehelp.co.uk
http://www.dclug.org.uk

http://www.wewantbroadband.co.uk/


--Boundary-02=_UMxC/Eb4nUt27qf
Content-Type: application/pgp-signature
Content-Description: signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/CxMUiAEJSii8s+MRAtNeAJ9i+GJjGSi07ddgqIVzxOjxM61jIgCgzpl7
NxEQE3ZSg5mgodV6TAwOTdU=
=4RNO
-----END PGP SIGNATURE-----

--Boundary-02=_UMxC/Eb4nUt27qf--