php 在我公司的 MySQL 数据库中加密客户信息的最佳方法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9265877/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best Way to Encrypt Customer Information in My Company's MySQL DB?
提问by eysikal
So long story short, our company recently had an intrusion wherein our MySQL DB was dumped and stolen. The execs are really nervous now and in addition to upping other security measures, they are intent on encrypting all customer information (email address, home address, names, and the like) in the DB.
长话短说,我们公司最近发生了一次入侵,其中我们的 MySQL 数据库被转储和窃取。高管们现在真的很紧张,除了加强其他安全措施外,他们还打算对数据库中的所有客户信息(电子邮件地址、家庭地址、姓名等)进行加密。
I am unsure of where to begin on this. We run a PHP app. Obviously, this is going to create some additional overhead that we'd like to minimize. Another concern is going to be the difficulty in changing the code wherever the new encrypted fields are used.
我不确定从哪里开始。我们运行一个 PHP 应用程序。显然,这会产生一些我们希望最小化的额外开销。另一个问题是在使用新加密字段的地方更改代码的难度。
This strikes me as an unnecessary precaution, but management seems firm on it.
这在我看来是一种不必要的预防措施,但管理层似乎对此很坚定。
What type of encryption algorithm/method would be best for this use case?
哪种类型的加密算法/方法最适合此用例?
回答by
There is a very good writeup on how to do this with MySQL here: http://thinkdiff.net/mysql/encrypt-mysql-data-using-aes-techniques/.
这里有一篇关于如何使用 MySQL 执行此操作的非常好的文章:http: //thinkdiff.net/mysql/encrypt-mysql-data-using-aes-techniques/。
You'll want to use AES with 256bit keys, as that is the prevailing best-practice/standard right now. 256bit AES keys are considered to be of sufficient size to be secure against modern computing power.
您将希望将 AES 与 256 位密钥一起使用,因为这是目前流行的最佳实践/标准。256 位 AES 密钥被认为具有足够的大小来保护现代计算能力。
It's a good idea, regardless of if you think it's overkill or not, to encrypt your database. Even if the data isn't horribly sensitive, the loss of customer records can be very embarrassing to your company, at the very least, and could adversely affect customer confidence and people's willingness to hand over their data in the future. Encrypting the full contents of your database may not be industry-standard right now but trends are moving that way and it cannot hurt you to adopt a stronger security posture. If nothing else, think of it as another entry in your Defense-In-Depth implementation.
无论您是否认为对数据库进行加密,这是一个好主意。即使数据不是非常敏感,客户记录的丢失至少也会让您的公司非常尴尬,并且可能会对客户的信心和人们未来交出数据的意愿产生不利影响。加密数据库的全部内容现在可能不是行业标准,但趋势正在朝着这个方向发展,采用更强大的安全态势不会伤害您。如果不出意外,请将其视为深度防御实施中的另一个条目。
I would also recommend you check this article out - http://www.symantec.com/connect/articles/secure-mysql-database-design- as it provides a good, fairly basic, introduction to secure database system design that should give you some pointers on other things to check for your application.
我还建议您查看这篇文章 - http://www.symantec.com/connect/articles/secure-mysql-database-design- 因为它提供了一个很好的、相当基本的安全数据库系统设计介绍,应该给出你有一些关于其他事情的指示来检查你的应用程序。