简体   繁体   中英

How to create a password-protected zip folder in Java?

It is important that the zip file should be password protected and not the files contained inside the zip. It means that when I double-click on the zip file it should ask me the password before showing the contents of the zip.

I have tried Zip4j and Winzipaes libraries but they both encrypt the content files inside the zip, not the zip itself. I have also tried several answers from Stackoverflow but to no avail. Please help.

As stated here by WinZip, the Zip format encrypts the files inside the archive only and not the zip itself. http://kb.winzip.com/kb/entry/147/

However, as the article suggests, double zipping the archive will hide files inside the inner zip file. As long as you encrypt the outer archive.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM