久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 PHP 創建加密的 zip 存檔

Create an encrypted zip archive with PHP(使用 PHP 創建加密的 zip 存檔)
本文介紹了使用 PHP 創建加密的 zip 存檔的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在尋找一種將 .txt 文件加密為 zip 文件的方法,但采用安全的密碼保護方式.我的目標是將此文件通過電子郵件發送給我,而任何人都無法閱讀附件的內容.

I am searching for a way to encrypt a .txt file into a zip, but in a secure password protected way. My goal is to email this file to me, without anyone being able to read the content of the attachment.

有誰知道一種簡單且最重要的是安全的方法來實現這一目標?我可以創建 zip 檔案,但我不知道如何加密它們,也不知道這有多安全.

Does anybody know an easy, and above all, secure way to accomplish this ? I can create zip archives, but I do not know how to encrypt them, or, how secure this is.

推薦答案

注意:這個答案推薦了一種已知的加密方法不安全,即使密碼很好.請查看評論中的鏈接和 AES 上的 Winzip QA.支持 in-php AES zip 加密附帶 php 7.2(和 libzip 1.2.0),這意味著答案也很快就會過時.在那之前查看此答案了解如何調用 7z 而不是 zip 命令,它支持 winzip 的AES 加密.

Note: this answer recommends a cryptographic method that is known insecure, even with good password. Please see link from comments and the Winzip QA on AES. Support for in-php AES zip encryption arrives with php 7.2 (and libzip 1.2.0), which means this answer will soon be outdated too. Until then see this answer for how to call out to 7z instead of the zip command, which supports winzip's AES encryption.

你可以使用這個:

<?php echo system('zip -P pass file.zip file.txt'); ?>

其中 pass 是密碼,file.txt 將被壓縮到 file.zip 中.這應該適用于 Windows 和 Linux,您只需要獲得適用于 Windows 的免費 zip 版本( http://www.info-zip.org/Zip.html#Win32 )

Where pass is the password, and file.txt will be zipped into file.zip. This should work on Windows and Linux, you just need to get a free version of zip for Windows ( http://www.info-zip.org/Zip.html#Win32 )

這種安全性可以被蠻力攻擊、字典攻擊等破壞.但這并不容易,特別是如果你選擇了一個又長又難猜的密碼.

This kind of security can be broken by brute force attacks, dictionary attacks and etc. But it's not that easy, specially if you chose a long and hard to guess password.

這篇關于使用 PHP 創建加密的 zip 存檔的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 欧美网站一区二区 | 国产精品日韩欧美一区二区三区 | av一区二区三区四区 | 欧美精品在线一区 | 一区免费 | 在线免费观看黄网 | 黄色大片网站 | 欧美综合自拍 | 欧美福利久久 | 在线免费看毛片 | 久久久精彩视频 | 二区亚洲 | 日本午夜在线视频 | 成人h视频在线 | 免费一区二区三区在线视频 | 91久久久久久久久久久久久 | 毛片在线视频 | 亚洲一区二区在线播放 | 亚洲午夜在线 | 国产一区91精品张津瑜 | a视频在线 | 久久精品播放 | 国产一区 在线视频 | 99亚洲精品 | 久久久精品国产 | 日韩一二区在线 | 天天干天天玩天天操 | 亚洲欧美高清 | 人人色视频| 欧美日韩中文字幕在线 | 欧美在线视频一区二区 | 婷婷激情五月网 | 人人爱干 | 成人免费高清 | 一级黄色片在线看 | 黄色精品 | 欧美一级高潮片免费的 | 国产女人与拘做视频免费 | 久久久久久www | 精品一区二区三区在线视频 | 国产激情精品一区二区三区 |