Re: gpg --decrypt



Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:

I'm trying to operate gpg through proc_open. I can encrypt this way,
just fine, but when I try to decrypt I get:

I got it:

$cmd =
'/usr/bin/gpg '.
'--decrypt '.
'--homedir /usr/home/userid/.gnupg '.
'--no-tty '.
'--passphrase-fd 3';

$message = '[encrypted message]';

$pass = '[passphrase]';

$descriptors = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('file', '/usr/home/userid/error.gpg', 'a'),
3 => array('pipe', 'r')
);

$process = proc_open($cmd, $descriptors, $pipes);
list($stdin, $stdout, $stderr, $passpipe) = $pipes;

fputs($stdin, $message);
fclose($stdin);

fputs($passpipe, $pass);
fclose($passpipe);

while (!feof($stdout)) {
$line = fgets($stdout);
echo $line;
}

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
.



Relevant Pages

  • Re: Free Black T-Shirt
    ... > Carved in mystic runes upon the very living rock, the last words of Alan ... > Dicey of rec.arts.sf.tv.babylon5.moderated make plain: ...
    (rec.arts.sf.tv.babylon5.moderated)
  • Re: Date()
    ... Carved in mystic runes upon the very living rock, the last words of Alan ... Adam Harvey of comp.lang.php make plain: ...
    (comp.lang.php)
  • Re: Array Concatenation
    ... > Carved in mystic runes upon the very living rock, the last words of Alan ... > Little of comp.lang.php make plain: ... SPE! ...
    (comp.lang.php)
  • Re: Array Concatenation
    ... > Carved in mystic runes upon the very living rock, the last words of Alan ... > Little of comp.lang.php make plain: ... SPE! ...
    (comp.lang.php)
  • Re: proc_open() Help
    ... Carved in mystic runes upon the very living rock, the last words of Alan ... Little of comp.lang.php make plain: ... > someone give me a quick rundown of how to do something like this? ...
    (comp.lang.php)