Storing Social Security Number in MySql

Using PHP and MySql and Dreamweaver CS5

I have a simple online multipage form passing variables via $_SESSION. Pages are using SSL. The only sensitive data is the guests Social Security Number. The form data is being inserted into the table. What is the best way (considering complexity) to encrypt the number in the database? I've used something dealing with a Salt or something before, I will be researching that next.
LVL 16
rbudjAsked:
Who is Participating?
 
ralmadaCommented:
You can use the AES_ENCRYPT in MySQL to store them. That's considering that you might want to decrypt that number in the future. If you want a one way encryption solution, then go for a SHA2 hash function. Check link below:

http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_aes-encrypt
0
 
markterryCommented:
Does this item need to be displayed or just captured? Hashing at the page level rather than the database level lets you transmit data encrypted, rather than sending and receiving unencrypted data from the database. Lots of good programmers use this for passwords, so they are not sent unencrypted.
This is an SSL site overcourse?
0
 
rbudjAuthor Commented:
Thanks. I AM using SSL but the database itself needs to be encrypted. I'm looking further into incorporating AES_ENCRYPT. Thanks again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.