koralarts
koralarts

Reputation: 2112

PGP encryption in PHP (Windows)

I'm having a problem with GPG encrpytion. Can you please help me with it?

It does not encrpyt the message that I want to encrpyt.

Code:

$pgppath = "C:/Program Files (x86)/GNU/GnuPG";
putenv("PGPPATH=$pgppath");
$cmd = "echo '$msg' | '$pgppath'/gpg2.exe -e";
exec($cmd, $encrypted, $errorCode);
echo implode("\n", $encrypted);
mail($to, $subject, $encrypted[0]);

Thanks! I appreciate the help!

Upvotes: 0

Views: 1151

Answers (1)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

Problem may be in '$pgppath'/gpg2.exe, it will be resolved to 'C:/Program Files (x86)/GNU/GnuPG'/gpg2.exe -e

Upvotes: 1

Related Questions