ZIP format does not encrypt file structure / filenames, only actual data
Configuration
- Keka version:1.6
- macOS version:15.7.2 (24G325)
Describe the bug
将待压缩的文件夹拖入设置了密码的keka中,压缩后的.zip文件可以直接用mac自带的解压工具打开,不用输入密码,这是为什么? When I drag a folder to Keka with a password set for compression, the resulting .zip file can be opened directly using the built-in macOS decompression tool without entering the password. Why is this?
有时却能够设置密码,但是用mac自带的解压工具输入密码后解压后会报错:Unable to expand "test.zip" into "folder". (Error 0 - Undefined error: O.),用keka解压不需要输入密码,这是为什么? Sometimes it is possible to set a password, but when using the built-in macOS decompression tool, after entering the password, it throws an error: 'Unable to expand "test.zip" into "folder". (Error 0 - Undefined error: O.)' However, when using Keka to decompress, no password is required. Why is this?
Thanks a lot for the feedback @Adam-226.
Can you share a sample file that reproduces the (Error 0 - Undefined error: O.)?
As for not asking for the password the ZIP format does not encrypt file structure and filenames. If you compress no data like in the example, just an empty folder, the password will not be needed since there's no encrypted data.
@aonez Thanks for your reply! So, does this mean that if it's an empty folder or a folder containing files with no actual content, after setting a password for compression, you don't need to enter the password to unzip with Keka? Also, I've noticed that when compressing these two types of folders with a password, using the macOS built-in unzip tool will result in the error mentioned above.
The sample file that reproduces the (Error 0 - Undefined error: O.) is below. It contains a file: hello.txt, with no actual content. And the password is 123456
empty folder or a folder containing files with no actual content, after setting a password for compression, you don't need to enter the password
This is it. This is a "limitation" of the ZIP format. If you use 7Z format instead you can encrypt the filenames so this does not happen.
As per the Error 0 this might be a limitation of Apple's Archive Utility when no actual data is found. The attached file is valid and can be unzipped with Keka, unzip using the Terminal and most of the extraction tools.