CentOS zip命令 - 添加密码 - 提供什么类型的加密(如果有)?

时间:2011-11-08 03:20:02

标签: encryption zip centos5

使用CentOS5中包含的zip工具(zip命令):即/usr/bin/zip -P $ZIP_PASS ...

我无法找到任何关于此的文档。我试图找出密码的安全性。这是加密的吗?如果没有加密,它如何受到保护?

由于

2 个答案:

答案 0 :(得分:2)

好的,我找到了我要找的答案......来自http://en.wikipedia.org/wiki/ZIP_%28file_format%29http://en.wikipedia.org/wiki/Known-plaintext_attack

  

ZIP等加密文件存档很容易受到这种攻击。[引证   需要]例如,只需要具有加密ZIP文件的攻击者   (部分)来自存档的一个未加密文件,形成了   “已知明文”。[4] [5]然后使用一些公开的软件   他们可以快速计算解密整个密钥所需的密钥   存档。要获取此未加密的文件,攻击者可以搜索   网站上有合适的文件,可以从其他档案中找到   打开,或手动尝试重建带有该文件的明文文件   从加密档案中了解文件名。

所以...拉链不是完全安全的 - 但是拉链内文件的随机文件名(当实现良好时),并立即删除未加密的文件(也是非网络可访问的) ) - 这似乎是一个可能的解决方案......

更多资源: http://linux.101hacks.com/archive-compression/password-protection-for-zip-files/

但是,我读的越多,经过7zip 的AES 256位加密拉链(一旦安装在服务器上)就会更加安全。它也不容易受到已知的明文攻击。

答案 1 :(得分:1)

是的,它是加密的。根据手册:

-P password
          use password to encrypt zipfile entries (if any).  THIS IS INSECURE!  Many multi-user operating
          systems provide ways for any user to see the current command line of any other  user;  even  on
          stand-alone  systems  there  is  always  the  threat of over-the-shoulder peeking.  Storing the
          plaintext password as part of a command line in an automated script is  even  worse.   Whenever
          possible,  use  the non-echoing, interactive prompt to enter passwords.  (And where security is
          truly important, use strong encryption such as Pretty Good Privacy instead  of  the  relatively
          weak encryption provided by standard zipfile utilities.)

这是通过在centOS机器上运行“man zip”找到的。

正如手册条目所述,为了高安全性,在命令中使用密码来压缩文件是不好的,因为其他人可以检查进程列表并将密码看作是压缩。

我不知道它使用了什么样的加密方式,但我环顾了一些并且看起来并不好。 stackoverflow上有一些类似的问题。如果加密真的很重要,请考虑使用不同的zip库,使用允许AES的东西,例如GPG。