> Anyone know why the decryption fails using gpg when run in a perl script in
> a browser but works if run in a shell? Here's the code sample:
>
> my $cipher = <<TAG;
> -----BEGIN PGP MESSAGE-----
>
> pvbhS8Q22VYPqn+4sitEw0bgTmDhPo6rruzsSJxCHLBUyTPrYaPlmelF2iADCpKD
> IeqIOK0KZwRMHrXrlFir37i+2NzmNzcF4kidPKWuKSQe6ZNWs28=
> =w+vi
> -----END PGP MESSAGE-----
This is not an answer to your question, but might I suggest (plug) using
Crypt::OpenPGP, my pure-Perl OpenPGP implementation? It will decrypt your
message, and it won't require launching an external shell etc.
use Crypt::OpenPGP:
my $pgp = Crypt::OpenPGP->new;
my $pt = $pgp->decrypt( Data => $cipher, Passphrase => $pass );
Here is a page w/ some more information:
http://rhumba.pair.com/ben/perl/openpgp/
If you have any problems let me know by mail.
bye,
Ben