PHP 中的 PGP 加密 (Windows)
我遇到了 GPG 加密问题。你能帮我吗?
它不会加密我想要加密的消息。
代码:
$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]);
谢谢!我很感激你的帮助!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题可能出在 '$pgppath'/gpg2.exe 中,它将被解析为 'C:/Program Files (x86)/GNU/GnuPG'/gpg2.exe -e
Problem may be in '$pgppath'/gpg2.exe, it will be resolved to 'C:/Program Files (x86)/GNU/GnuPG'/gpg2.exe -e