2012-02-18 12 views
0

私は初めてPHP内からpgp暗号化を実装しようとしていますが、動作させるのは苦労しています。私は誰かが正しい方向に私を指すことができることを願っています。基本的には、私がこれを行う場合:PHP内からのPGP暗号化を使用

$gpg = '/usr/bin/gpg'; 

    $recipient = '[email protected]'; 

    $encrypted_message = shell_exec("echo 'a_string_here' | $gpg -e -r $recipient"); 

    echo $encrypted_message; 

それは正常に動作します。 [email protected]の公開鍵と秘密鍵がサーバーにインストールされています。しかし、私がこれを行うと、null変数が得られます

$gpg = '/usr/bin/gpg'; 

    $recipient = '[email protected]'; 

    $encrypted_message = shell_exec("echo 'a_string_here' | $gpg -e -r $recipient"); 

    echo $encrypted_message; 

[email protected]には1つの公開鍵しかインストールされていません。もちろん、私はあなたがこの記事を見てみることができ、事前

答えて

関連する問題