Decryption problems using php

Amol Patil amolp at
Tue Jun 5 06:50:24 CEST 2012


Currenlty I am having problem with the decryption of the file my code is 
like this

     echo shell_exec("echo $passphrase | $gpg --passphrase-fd 0 -o 
$unencrypted_file -d $encrypted_file");

when I checked using echo beforer executing it will shown as below

passphrase|gpg --output 
--passphrase-fd 0 --decrypt 

above command is executed correctly using putty but when I tried to use 
this command using php it is not working.
I have set permission to the directory . But it seems it not working

$gpg = '/usr/bin/gpg';
  $passphrase = 'passphrase';
  //$encrypted_file = 'foo.gpg';
   //$unencrypted_file = 'foo.txt';
    echo shell_exec("echo $passphrase | $gpg --passphrase-fd 0  
$unencrypted_file -d $encrypted_file");

Please assist me to work it correctly. I am facing such problems last 2 
weeks. We are using ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic i686).


*Thanks & regards,*


*Amol Patil *


*+ 91 -- 020 - 3251 7794 *

amolp at <mailto:amolk at> | <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20120605/67767574/attachment.htm>

More information about the Gnupg-users mailing list