用于存储个人详细信息的类,包括。银行账户信息,PHP (Mcrypt) 格式 - 这样可以吗?如何改进?

发布于 2024-10-15 06:23:49 字数 434 浏览 5 评论 0原文

我的任务是编写一个加密函数,让我的老板可以轻松地加密各种数据以进入数据库。这将包括信用卡详细信息银行帐户信息。 我以前从未在 PHP 中使用过加密,所以有点担心。

以下是我迄今为止在 O'reilly 的 Essential PHP Security 的帮助下所做的工作: http://pastebin.com/7L2GxPNJ

IV实际上似乎没有做任何事情,这让我担心。这是为什么呢?

如果有人可以查看这段代码并检查一下,我将非常感激。我和一位朋友交谈过,他认为最好在 PHP 连接到的另一台服务器上编写为守护进程,但这还不能完成 - 我只是在关注订单。

目前来看,有什么可以改进的地方吗? IV号有什么关系?

谢谢。

I've been given the task of writing an encryption function that'll let my boss easily encrypt various bits of data to go into a database. This will include credit card details bank account information.
I've never used encryption within PHP before so am a touch worried.

Here's what I've done so far with the help of O'reilly's Essential PHP Security:
http://pastebin.com/7L2GxPNJ

The IV doesn't actually seem to do anything, which concerns me. Why's that?

Would appreciate it very much if someone could look through this code and check it out. I've spoken to a friend who reckons it'd be better off written as a daemon on another server that PHP would then connect to, however that can't be done yet - I'm just following orders.

For the moment, are there any improvements that could be made? What's the deal with the IV?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咆哮 2024-10-22 06:23:49

IV 实际上似乎没有做任何事情,这让我担心。这是为什么?

初始化向量相当重要 - 特别是在加密大量小数据片段时。如果加密数据没有被 IV 修改,就会出现问题。如果您将加密密钥与加密数据存储在同一文件系统上,那么这只是隐蔽性的安全性。

The IV doesn't actually seem to do anything, which concerns me. Why's that?

An initialization vector is rather important - particularly when encrypting lots of small fragemnts of data. Somethnig is amiss if the encrypted data is not modified by the IV. And if you're storing the encryption key on the same filesystem as the encrypted data, it's just security by obscurity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文