发送加密文件(zip 或 txt) - 通过 PHP - 可在 Windows PC 上打开
我需要通过电子邮件向用户发送一些最少的数据(但必须加密)。
他们需要深度学习附件并使用某种易于使用的软件(PC / MAC)对其进行解密......这里有什么想法吗?
我的第一个想法是制作一个加密的 zip 文件,可以使用 7zip 或 winzip 打开......但我发现这对于典型的 PHP/Linux 应用程序来说是不可能发生的。
I have a need to send some minimal data via email to users (but it must be encrypted).
They would need to DL the attachment and decrypt it with some kind of easy to use software (PC / MAC)... any ideas here?
My first thought is to make an encrypted zip file that they can open with 7zip or winzip... but I have found that it can't happen with a typical PHP/Linux app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 mcrypt 和 Blowfish 加密消息。您可以找到许多 Blowfish 加密/解密程序,例如... http://www.di -mgt.com.au/mysecret.html
测试:
我链接的程序需要这样的输入文件(您可以轻松地将其设置为电子邮件中的那样)。
You can use mcrypt and Blowfish to encrypt message. You can find many encrypt/decrypt programs for Blowfish eg... http://www.di-mgt.com.au/mysecret.html
Test:
The program I've linked needs input file like this (you can easily make it like that in email).
这不是一个解决方案,您可以将档案存储在服务器上,并通过电子邮件链接发送到 php 页面,该页面可以获取特定的 zip 并在用户使用基本身份验证登录后将其发送给用户。因此,只有知道密码的用户才能执行该脚本并下载文件。
你怎么认为?
Isn't a solution for you to store the archives on the server, and send by email link to php page that can fetch specific zip and send it to the user after the user login with basic authentication. So only the users that know the password can execute that script and download the file.
What do you think?
典型的 PHP 应用程序不会发生什么情况?您当然可以压缩文件: http://php.net/manual/en/book.zip .php
What can't happen with a typical PHP app? You can certainly zip files: http://php.net/manual/en/book.zip.php
我使用 GNUPG: http://www.gnupg.org/
您需要访问您的网络服务器才能安装或者如果已安装,则添加您的密钥环。
然后您可以将其与 exec 调用或 GNUPG PECL 扩展一起使用。
这样做的问题是,用户必须使用您用来加密它的相同电子邮件地址($gpgrecipient)创建密钥,并且他们必须在您加密它之前执行此操作,并将其上传到公钥服务器(该软件将执行此操作)。然而,该软件非常简单,而且是跨平台的。
对于我的 php 加密脚本,我使用:
这仅加密电子邮件的一部分,我使用 Thunderbird 和 enigmail 检索该电子邮件。
您可以将其更改为输入文件,并将其附加到电子邮件中。
您甚至可能会找到一个准系统的 gnupg 应用程序,它创建密钥并将其上传到公共服务器、解密文件等等。
如果数据确实敏感,我认为 GnuPG 是一个不错的选择。
对于处理在线预订来说,只需要转到您控制的一封电子邮件,这比您需要的要好得多,但我想我会把它扔在那里。
I use GNUPG: http://www.gnupg.org/
You will need access to your webserver to either install it, or if it is installed, to add your keyring.
Then you can either use it with an exec call, or the GNUPG PECL extension.
The problem with this, is that the user has to create a key using the same email address ($gpgrecipient) that you use to encrypt it, and they have to do it BEFORE you encrypt it, and upload it to a public key server(which the software will do). However the software is pretty easy, and it is cross platform.
For my php encryption script, I use:
This only encrypts a section of an email, which I retrieve with thunderbird and enigmail.
You could change it to input a file, and attach it to an email.
You could even probably find a barebones gnupg app that creates a key and uploads it to a public server, decrypts a file, etc.. etc..
If the data is really sensitive, I think GnuPG is a good option.
It is a lot better for say handling online reservations that only need to go to one email that you control, than for what you are needing, but I thought I would throw this out there.