Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jun 04, 2012 10:36 pm 
Offline
Newbie

Joined: Mon Jun 04, 2012 10:33 pm
Posts: 2
Website: http://lessonshark.com
Location: Atlanta GA
Hello,
Looking for any advice on how to save sensitive data such as Social Security numbers in a database. I am wondering if anyone else needs to do this, and if so, how you do it securely. We are saving this information for the purpose or running a background check and degree verification. Any and all advice is very much appreciated.


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2012 12:48 am 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
SSN and other personal information fall under Federal HIPAA regulations (in the US) and you should check with someone familiar with proper storage and usage procedures for doing that.

_________________
Kevin a.k.a. Dweeber


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2012 8:28 am 
Offline

Joined: Tue Jun 05, 2012 8:20 am
Posts: 1
The usual method is using AES encryption provided by your RDBMS. An example using MySQL could be :

INSERT INTO table(field) VALUES(AES_ENCRYPT('SSN_DATA','KEY'));

This would store the data encrypted with AES within the table. You would need to store the key somewhere safe in order to keep the security model valid. You would then read the data using the following decrypt function:

SELECT AES_DECRYPT(field, 'key') from table WHERE field = AES_DECRYPT(field, 'key');

More on http://dev.mysql.com/doc/refman//5.5/en ... tions.html

You can find a tutorial at :

http://thinkdiff.net/mysql/encrypt-mysq ... echniques/

While AES encryption is secure, it only secure if the key is not compromised and it does not provide a multi-user cryptosystem (ie; an admin with access to multiple users encrypted data).

I hope this answer your question.

Regards,

Max


Last edited by mlabelle on Sat Jun 09, 2012 3:04 pm, edited 2 times in total.

Top
   
 Post subject: Thanks Kevin and Max!
PostPosted: Tue Jun 05, 2012 11:37 am 
Offline
Newbie

Joined: Mon Jun 04, 2012 10:33 pm
Posts: 2
Website: http://lessonshark.com
Location: Atlanta GA
You help is much appreciated. I'll let you know if I or my team have any other questions.


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2012 6:54 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Worth noting is that:

1) The key and data will, by default, be unencrypted between the database client and server (i.e. your application and the database) in the most popular RDBMSes.

1a) This is a sniffing threat as well as a MITM threat.

2) As a symmetric cipher, knowledge of the AES key is a necessary and sufficient condition to either encrypt or decrypt the data. In other words, if a server has the key stored, breaching that server provides enough information to decrypt everything encrypted with that key.

3) There are companies who specialize in securely handling data like this. It's one of those things that is somewhat complex, very specialized, and at a high risk of great catastrophe should a simple, subtle mistake be made. It's like radioactive waste.

If you do decide to roll your own, be sure to run it past your attorney and insurance company, to ensure that you're doing so legally and with adequate financial protection. People tend to get bent out of shape about credit card numbers, which are easily invalidated/replaced and leave little lasting damage; imagine how cranky folks would get if SSNs were leaked.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group