Zip icon indicating copy to clipboard operation
Zip copied to clipboard

Password

Open Aerocan opened this issue 8 years ago • 10 comments

Once zipped with password, can't unzip the file with the same password.

Aerocan avatar Jul 07 '16 18:07 Aerocan

I have the same problem.

PjotrC avatar Jul 16 '16 18:07 PjotrC

I've been looking into this and from what I can tell, its not protected with the given password. I've added a new unit test (which fails, as expected) to demonstrate this. In the test I create a zip archive with a password of "password". I then try and unzip this file with a password of "wrong-password" and look for any directories at the given location. To my surprise, the file has been unzipped. The branch can be found here: https://github.com/jwelton/Zip/tree/password-bug.

I should mention, when attempting to open the zip by other means, the password "password" does not work.

jwelton avatar Jul 20 '16 16:07 jwelton

Do you mean there is a bug in minizip, the library, which you are using? I did zip with your library and did try to unzip by double clicking the archive:

  • On Windows 10 it opens an explorer window, which shows all zipped files. If I double click on one of the files, a small window appears, asking for the password: any password I try is wrong. Extracting not possible. Also if I try to unzip with WinRar, it is telling me, that the correct password is wrong.
  • On OS X El Capitan it opens an archive program, which is asking for a password right away: any password I try is not accepted. If I enter a blank password (not possible on Windows), the archive program quits without successful extraction.

PjotrC avatar Jul 20 '16 19:07 PjotrC

That's the same behaviour I'm seeing. I cant say for sure but the password is not null when being passed into minizip. Looks like the problem might be in minizip.

jwelton avatar Jul 20 '16 19:07 jwelton

I have the same problem as you and have solved it, please reference my above linked post.

dttrinh avatar Oct 14 '16 02:10 dttrinh

@dttrinh I have used the solution with enabling AES and it works - yes. One drawback is that unpacking still won't work with MacOS default unzip software. You need something like 7zip that supports compression method 99.

Also it doesn't seem like a proper fix, rather a workaround for the existing problem.

maciejpigulski avatar Nov 17 '16 13:11 maciejpigulski

same.

ValentinKuznetsov avatar Dec 05 '16 17:12 ValentinKuznetsov

I've also got this problem. Create a zip file with a password on OSX. Can't unzip it because the password is rejected. I downloaded the aes folder from https://github.com/nmoinvaz/minizip and added it to the project (perhaps in the wrong way) and added #define HAVE_AES into zip.c - I am not sure what else to do.

jukwaphil avatar Jun 24 '17 20:06 jukwaphil

Same issue here.

iblacksun avatar Jul 20 '17 03:07 iblacksun

This is still an issue. According to the other thread, does minizip have to be fixed or configured properly in the master branch?

basememara avatar Jan 21 '18 22:01 basememara