【发布时间】:2014-12-10 13:22:43
【问题描述】:
我想创建受密码保护的 ZIP:
// Set the compression level
parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
// Set the encryption flag to true
// If this is set to false, then the rest of encryption properties are ignored
parameters.setEncryptFiles(true);
// Set the encryption method to Standard Zip Encryption
parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
// Set password
parameters.setPassword(password);
但这只是加密 zip 中的文件,但我可以打开这个 zip 并查看其中的文件。这不是我想要的,我想要保护 zip 密码而不是其中的文件。
【问题讨论】:
-
只需在一个 zip 中创建一个 zip 并加密内部 zip :)
-
更严肃地说 - 这是不可能的。 .ZIP 文件格式规范声明包括内容列表的元数据是未加密的。其用途之一是验证正确解密。
-
有没有其他方法可以保护 zip 密码?
-
你可以使用
winzipaes -
@vzamanillo 但是当我尝试使用 winzipasi 时无法打开 zip 文件夹中的文件。它显示“windows 无法完成提取”错误消息。