LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-26-2006, 12:51 AM   #1
ahelis
LQ Newbie
 
Registered: Dec 2005
Location: Taipei, Taiwan
Distribution: Redhat 7.0 & WS3,4
Posts: 18

Rep: Reputation: 0
PHP GnuPG encryption/decryption on a production webserver


Hi all,

I did search on this topic and found a troubleshooting thread (hence I used a similar subject line) but my question to those running a production webserver.

I am reviewing a few PHP classes that use the native gpg file as installed on a Linux webserver. I am building an email application and would like to use the public key infrastructure. Common locations for this binary executable are /usr/local/bin/gpg and /usr/bin/gpg but it has been my understanding to never allow a script (PHP in this case) to access a file outside of the public root directory for the webserver.

1. Can using this binary executable be exploited and be a security risk?
2. Can the binary be simply copied into a /scripts/ folder inside the webserver's root directory without compromising the server's security?

I have been researching encryption methods and techniques but I am not sure that developing an encryption scheme is the right choice. It seems that encryption is build into every Linux box out there and there should be an easy way to use what already exists and apply it in a production web application.

If this is the totally wrong approach, then what are other suggestions for open source encryption php software/libraries (for email & text) as used on Apache webservers?
 
Old 05-27-2006, 04:47 PM   #2
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
I actually store all of my really important data outside of the document root. that what the only way it can be accessed are through my php scripts. with all of the web crawlers out there I just don't trust keeping highly confidential data in my document root, even with htaccess.

As for encryption on an apache webserver, why not just run your site over https?
 
Old 05-28-2006, 12:14 AM   #3
ahelis
LQ Newbie
 
Registered: Dec 2005
Location: Taipei, Taiwan
Distribution: Redhat 7.0 & WS3,4
Posts: 18

Original Poster
Rep: Reputation: 0
Hi msound,

Thanks for the feedback. I will try moving the bin file to one folder just above the document root and then access through my script. I already use https to log into my application, but I need to further encrypt the message data while it is stored on the server and during transmission to the intended recipient. From what I have been reading regarding GnuPG, I can also use it to manage the keyring and remove/add keys when a user want to change their security at some regular interval. All that I will need to do then is add a method to decrypt saved messages using the old key, encrypt with the new key and then discard the old key all together.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
right-click encryption/decryption for Gnome? DJOtaku Linux - General 1 09-23-2005 11:40 AM
PHP GnuPG encryption/decryption rblampain Programming 5 08-12-2005 10:10 AM
Hardware real time encryption/decryption in Linux... Akonbobot Linux - Security 2 11-24-2004 01:33 AM
First production webserver setup...need advice shmude Linux - Software 7 08-04-2004 01:21 AM
tar encryption (gnupg problems) wedgeworth Linux - Security 1 07-01-2004 04:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration