Re: [PHP] Php and GpG
On Monday 23 February 2004 10:49 am, Adam Bregenzer wrote: > On Mon, 2004-02-23 at 08:35, Paul Marinas wrote: > > Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't > > seems to work maybe my php is not compiled with some kind of support. > > You will need to call gpg from your script using either a socket > connection[1], something from the exec family[2], or backticks[3]. I seem to remember someone writing an extension using GPGME, but IIRC GPGME is GPL'd so there may be some licensing issues... worth a look, though > > [1] http://www.php.net/popen > [2] http://www.php.net/ref.exec > [3] http://www.php.net/operators.execution > > -- > Adam Bregenzer > [EMAIL PROTECTED] > http://adam.bregenzer.net/ -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php and GpG
On Mon, 2004-02-23 at 08:35, Paul Marinas wrote: > Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't > seems to work maybe my php is not compiled with some kind of support. You will need to call gpg from your script using either a socket connection[1], something from the exec family[2], or backticks[3]. [1] http://www.php.net/popen [2] http://www.php.net/ref.exec [3] http://www.php.net/operators.execution -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php and GpG
What is the error that you get when you try to use gpgext? --Sam Paul Marinas wrote: > Those anyone know hoh to use php with gpg. I've tryed gpgext, but > doesn't seems to work maybe my php is not compiled with some kind of > support. > > thanks > > > Paul > GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and GpG
Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't seems to work maybe my php is not compiled with some kind of support. thanks Paul GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and GPG SOLVED
Well if the server gets hacked and there able to read the script, I have bigger problems. The pass doesn't matter too much since it's just for passing a single file between two servers, not like it's multiple recipients or anything. Plus the public key isn't even published and the file isn't even stored after it's initially, and instantly decrypted. Adam Voigt [EMAIL PROTECTED] On Thu, 2002-11-07 at 12:15, Evan Nemerson wrote: > You still have to put the password on the command line... Very insecure. I > keep waiting for gpgme so I can work on a --enable-gpgme > > What you have is prolly the best solution right now, though. And good hack w/ > the home directory. > > > > On Thursday 07 November 2002 08:19 am, Adam Voigt wrote: > > Ok, here's what I ended up with, and it worked: > > > > exec("HOME=\"/home/apache\";/bin/echo \"MYPASS\" | /usr/bin/gpg --no-tty > > --passphrase-fd 0 -o /path/to/decrypted/file -d > > /path/to/encrypted/file"); > > > > I had to do the HOME variable setting because according > > to the log file, GPG was looking for it's .gpg settings > > directory in / and it didn't have write permissions to create > > it there, so it kept dying, this way, it finds the directory > > where it is supposed to be. Feew. > > > > Adam Voigt > > [EMAIL PROTECTED] > > -- > Behold, I will corrupt you seed, and spread dung upon your faces. > > -Malachi 2:3 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and GPG SOLVED
You still have to put the password on the command line... Very insecure. I keep waiting for gpgme so I can work on a --enable-gpgme What you have is prolly the best solution right now, though. And good hack w/ the home directory. On Thursday 07 November 2002 08:19 am, Adam Voigt wrote: > Ok, here's what I ended up with, and it worked: > > exec("HOME=\"/home/apache\";/bin/echo \"MYPASS\" | /usr/bin/gpg --no-tty > --passphrase-fd 0 -o /path/to/decrypted/file -d > /path/to/encrypted/file"); > > I had to do the HOME variable setting because according > to the log file, GPG was looking for it's .gpg settings > directory in / and it didn't have write permissions to create > it there, so it kept dying, this way, it finds the directory > where it is supposed to be. Feew. > > Adam Voigt > [EMAIL PROTECTED] -- Behold, I will corrupt you seed, and spread dung upon your faces. -Malachi 2:3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and GPG SOLVED
Ok, here's what I ended up with, and it worked: exec("HOME=\"/home/apache\";/bin/echo \"MYPASS\" | /usr/bin/gpg --no-tty --passphrase-fd 0 -o /path/to/decrypted/file -d /path/to/encrypted/file"); I had to do the HOME variable setting because according to the log file, GPG was looking for it's .gpg settings directory in / and it didn't have write permissions to create it there, so it kept dying, this way, it finds the directory where it is supposed to be. Feew. Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and GPG
I need to use PHP to dencrypt a file with GPG (which was encrypted with a public key generated on the server) I would normally use the exec command to just execute the proper GPG command, but I can't seem to get the password for the key (to decrypt the file) into GPG, I have tried: exec("/usr/bin/gpg --decrypt /path/to/file < /bin/echo \"password\""); AND: exec("/bin/echo \"password\" | /usr/bin/gpg --decrypt /path/to/file"); And neither work, anyone else ever done this successfully? Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php