GnuPG 与 MySQL
我正在尝试为客户非常安全地保存数据,并将使用 GnuPG。 Web服务器运行Apache/PHP,并使用私钥对数据进行加密,验证后构建SQL语句等,并将其发送到数据库服务器。
数据库服务器仅在内部网络上可用,并且仅由 Web 服务器连接。与网络服务器上的 PK 匹配的公钥将位于数据库服务器上。到目前为止,一切都很好。
现在,问题来了。我不想在数据库服务器上运行 Apache/PHP,但我看不到其他方法来检索数据。我没有找到关于 MySQL 的 PG/GnuPG 实现的文档,但我可能忽略了一些东西。如果我执行一个简单的 select 语句来检索数据,它将被加密,并且公钥将必须驻留在 Web 服务器上,这当然使得 GnuPG 的使用毫无用处。
有人可以分享的任何想法或经验都会有所帮助。
谢谢你! 布莱恩
I'm trying to save data very securely for a client, and will be using GnuPG. The web server is running Apache/PHP and will encrypt the data with a private key, build the SQL statement after validating, etc, and send it to the database server.
The database server is only available on the internal network, and will be connected to by only the web server. A public key matching the PK on the webserver will be on the database server. So far, so good.
Now, the issue. I'd rather not run Apache/PHP on the database server, but I see no other way to retrieve the data. I find no documentation of a PG/GnuPG implementation with MySQL, but I may be overlooking something. If I do a simple select statement to retrieve the data, it will be encrypted and the public key will have to reside on the web server, which of course makes the use of GnuPG useless.
Any ideas or experience that someone can share would be helpful.
Thank you!
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里有点困惑...我没有听说过使用 GnuPG 在数据库中存储数据。
您是否希望开发一些位于数据库服务器上的 mysql 之上的东西,并对进出数据库的数据进行解密/加密?
我使用 GnuPG 发送加密电子邮件,它对此非常有用。我根本不在网络服务器上保存私钥,因为我从不在那里解密。只需一个公钥,这就是加密所需的全部。
GnuPG 似乎不是适合您正在做的事情的工具。基本上,您必须将私钥和公钥保存在 Web 服务器上,使用公钥加密进入数据库的所有数据,并使用私钥解密所有输出的数据。这并不比任何其他加密方法更安全,因为您将私钥存储在 Web 服务器上。
数据库服务器的安全性是这里的问题吗?我认为任何简单的密码加密算法都会比 GnuPG 更有效,并且同样安全,因为您仍然需要存储密码。
现在,当您遇到从 Web 服务器表单通过电子邮件将信用卡数据发送到您的电子邮件帐户的情况时,GnuPG 确实变得有用。
I am a bit confused here... I haven't heard of using GnuPG for storing data in a database.
Are you looking to develop something that sits on top of mysql on the DB server, and decrypts/encrypts data coming into or out of the database?
I use GnuPG to send encrypted emails, and it is extremely useful for that. I don't keep a private key on the web server at all, because I never decrypt there. Only a public key, which is all you need for encrypting.
GnuPG doesn't seem like the right tool for what you are doing. Basically you would have to have to keep the private and public key on the Web Server, encrypt all data going into the DB with the public key, and decrypt all the data coming out with a private key. This is no more secure than any other encryption method, because you are storing the private key on the web server.
Is security on the database server the problem here? I would think any simple passphrase encryption algorithm would be a lot more efficient than GnuPG, and just as secure, because you still have to store the password.
Now when you have a situation like emailing credit card data to your email account from a Web Server Form, GnuPG really becomes useful.