Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 13th, 2003, 01:55 AM
anandm78 anandm78 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 anandm78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Encrypting database in Linux

Hello:
I have a MySQL database on a web server which contains sensitive information. What is the most secure way of maintaining the data secure. Function calls such as Passwd and the MD5 using PHP do require to pass keys. So once the intruder has access to scripts, he would know the keys. Is there an elegant method of achieving this.

Is there source code available for Public-Private Key encryption-decryption available in public domain. Can you please point to a site ?

Thanks,

Reply With Quote
  #2  
Old February 13th, 2003, 12:36 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
"gpg" is available in source code and should have come with your distro. But i would not implement my own. I would use gpg or pgp if it is installed.

But then, thinking about it - the decryption (private) key has to rest on the server, so the whole system of public key cryptography is only slightly more secure than using "normal" XOR or similar...

Sorry, there is no way to really securely encrypt your data there if you do need automated access to it...

...
conclusion: donīt store sensitive information in a database

In case you are still interested in code examples, here is a page that contains JavaScript implementations of SHA1, MD5 and RSA:
http://pajhome.org.uk/crypt/rsa/index.html
it should be possible to port it to php in a few minutes.......... Wondering ........... Wasnī t there a mcrypt library in php that implements exactly this? I am too lazy to look it up right now...
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old February 14th, 2003, 11:57 AM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 42 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
md5 in PHP doesn't require keys. It just md5 encodes the string passed to it.

In some situations you can just re-encode passwords, card numbers etc provided to see if the md5 hashes match.

However, M Hirsch is right. If you don't want to endanger sensitive data, don't put it on a web-connected db.

christo

Reply With Quote
  #4  
Old February 14th, 2003, 09:43 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
At one stage I was playing with the idea of storing CC numbers in a DB. The solution was using GPG. The one way I thought of making it secure was to have an external server (in this case in the office) link into the MySQL DB and read the encrypted data and then decrypt it and pass it to the workstation in the office which is a secured network. That way the webserver only has the public key and the private key is on another server behind a firewall. the details are only available in the office too, so people cannot access them outside for malicious intent. The page was also going to be locked so that only certain users can access it.

We have now gone with automatic CC processing now though,

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Encrypting database in Linux


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway