I am working on an Android project recently and met an issue. I send a request to webservice and got a zip file with password protection. The zip file is create using the Linux command
zip -P 123123123123123123 test.zip test.txt
I want to unzip it with Java. Because there is no standard API support so I need a third library.
winzipaes
, but it prompts that my zip file is not in the AES-256 format. sevenzipjbinding
, it's too large. Do you have any suggestion about this? Do you know what algorithm Linux used to encrypt the zip file?
Finally, I done with zip4j.
Download zip4j-1.3.1 and import it to project.
Sample Code:
ZipFile zipFile = new ZipFile(YourZipFile); if(zipFile.isEncrypted()){ zipFile.setPassword(Password); } zipFile.extractAll(Destination);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.