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 encrp开发者_开发百科yt.
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!
Problem may be in '$pgppath'/gpg2.exe, it will be resolved to 'C:/Program Files (x86)/GNU/GnuPG'/gpg2.exe -e
精彩评论