Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best + Strongest method of encryption for databases [closed]

I am storing Paswords and Personal Data in a database. What is the strongest method for encrypting these values for protection.

Also, what is the best method for encryption for Credit Card info in a database? Or should I use something else to store Credit Card Info, not a mysql database??

Thanks.

like image 787
H Bellamy Avatar asked Nov 19 '11 16:11

H Bellamy


People also ask

What is the strongest method of encryption?

AES 256-bit encryption is the strongest and most robust encryption standard that is commercially available today. While it is theoretically true that AES 256-bit encryption is harder to crack than AES 128-bit encryption, AES 128-bit encryption has never been cracked.

Which is better RSA or AES?

The Advance Encryption Standard (AES) cipher text method is a more accurate and elegant cryptographic method. According to testing results and the text files used, it has been concluded that the AES algorithm outperforms the Data Encryption Standard (DES) and RSA algorithms [6,7].


2 Answers

I think storing anything in SQL is fine, just encrypt it first. If you need to identify the data in some way (such as with a unique key for the DB entry) create a randomly generate string, or a secure hash, and store that along side of your encrypted data.

It is probably best to stick with something that is tried and tested. Since it is a DB (presumably for a billing system) it would be good to have fast retrieval. So stay away from asymmetric encryption -- which you should only use to encrypt the symmetric keys if you need to share them with someone.

Some particular strength (say 256 bits) of AES should be fine. I would be happy to know my personal details we secured in this way.

In terms of storing users passwords, it is common practice to generate a salt ( a random string ) and then hash the users password combined with this salt using a secure hash algorithm (RIPEMD, SHA1, MD5).

This prevents a pre-computed dictionary cracker from recovering the passwods since it needs to handle all the random salts as well.

Do not encrypt passwords, only hash them. There is no need to be able to recover the password in cleartext, it only makes your system vulnerable via this one master key. Do not encrypt users data with keys that users can choose, it will make the data unrecoverable in the event of key loss. Provide common ways for users to recover access to their account in the event they lose their passwords.

If you really need to hide usernames, perhaps you should be asking yourself about the data architecture you are using. In general, personal data and especially billing data should not be stored in plain sight, it should be only accessible by trusted parties. These trusted parties will have need to view the content of user names and info, hence encryption is probably unnecessary.

If you are transmitting user info on the open internet, encrypt it.

If you are concerned about the security of user info on your DB server, perhaps consider working with a cloud or data hosting provider who can provide you with some additional physical security for your servers.

Encryption is only part of a robust security policy. Focus especially on the human element of setting up a secure environment in which to conduct your biz. Hand out access to sensitive resources on a need to know basis. Make sure that you arrange for backups or some means of data recovery should all keys be lost.

like image 64
Cris Stringfellow Avatar answered Sep 21 '22 10:09

Cris Stringfellow


Note that encryption isn't the only thing you need to worry about when storing credit card data. There's also strict auditing requirements and a host of other concerns (see the PCI website if you're unfamiliar).

While you can probably manage to get PCI compliance, doing this if you're not really familiar with the necessary security measures can leave you open to huge liabilities. If your system is breached or you are found to be non-compliant, you face serious fines.

Check out payment providers such as Authorize.net for alternative solutions. Specifically, their Customer Information Manager product is worth looking into as they will store secure data such as credit card info on their servers for you.

like image 29
Michael Mior Avatar answered Sep 19 '22 10:09

Michael Mior