发送加密文件(zip或txt)-通过PHP-在Windows PC上可打开 [英] Send encrypted file (zip or txt) - via PHP - openable on Windows PC
问题描述
我需要通过电子邮件向用户发送一些最少的数据(但必须将其加密).
I have a need to send some minimal data via email to users (but it must be encrypted).
他们将需要对附件进行DL处理并使用某种易于使用的软件(PC/MAC)对其进行解密...这里有什么想法吗?
They would need to DL the attachment and decrypt it with some kind of easy to use software (PC / MAC)... any ideas here?
我的第一个想法是制作一个加密的zip文件,使它们可以使用7zip或winzip打开...但是我发现,使用典型的PHP/Linux应用程序是不可能的.
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.
推荐答案
您可以使用 mcrypt和河豚来加密邮件.您可以找到许多针对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
<?php
$key = 'too many secrets?';
$text = 'If you are paranoid, we know who you are and what you want. Stay online so we can trace you.';
$crypt_text = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $text, MCRYPT_MODE_ECB);
var_dump($crypt_text);
$plain_text = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $crypt_text, MCRYPT_MODE_ECB);
var_dump($plain_text);
?>
测试:
string(96) "dà¨gþJ\V$3Äö,' [y€&"¼‚\•òÏ=$ÅdG|ÀœÀbáÌɽûÝÉ·'þØ?I½}8óTé5<-‹ôÞ¶Ÿ°ÅMcCê®JxØ@RIú£Ç‹™xÞ"
string(96) "If you are paranoid, we know who you are and what you want. Stay online so we can trace you.����"
我链接的程序需要这样的输入文件(您可以通过电子邮件轻松地将其制成).
The program I've linked needs input file like this (you can easily make it like that in email).
-----开始我的秘密----- TVn8APjdMOdLPUBQ2OWsEh7wWnihhKKOKf11Vj0oo4pM20BPwrRXJyL + nBOLdpxdc + PQQoQlr0Vz1n1Fv932HQ16DG712ui69T3O0jI3NfX8jRjtZkal/sFyVu9JJEWPfZ2Ri1fkfOCqe9ZvFEmJ78BcUVmf37SYbgKi8UcAv4i1heHfJ05ende6nFeiyDptYflT7SiIGHcO1cVya22b1OLHakAE2paS1OJqQrHYc + 5wEAdoDU/0BmNvNNYOekmHZT19C1 + cIwZFo3ACLRN44gZffx + KIng570UcoNYa7NWnhzt6gvQHXEp2jnE =-----结束我的秘密-----
-----BEGIN MYSECRET----- TVn8APjdMOdLPUBQ2OWsEh7wWnihhKKOKf11Vj0oo4pM20BPwrRXJyL+nBOL dpxdc+PQQoQlr0Vz1n1Fv932HQ16DG712ui69T3O0jI3NfX8jRjtZkal/sFy Vu9JJEWPfZ2Ri1fkfOCqe9ZvFEmJ78BcUVmf37SYbgKi8UcAv4i1heHfJ05e nde6nFeiyDptYflT7SiIGHcO1cVya22b1OLHakAE2paS1OJqQrHYc+5wEAdo DU/0BmNvNNYOekmHZT19C1+cIwZFo3ACLRN44gZffx+KIng570UcoNYa7NWn hzt6gvQHXEp2jnE= -----END MYSECRET-----
这篇关于发送加密文件(zip或txt)-通过PHP-在Windows PC上可打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!