0

I trying to create ZIP file with password protection. But available libraries protecting the Files inside the ZIP. I have tried Zip4jand AesZipFileEncrypter but all these protecting the files only not the ZIP file. The code mentioned in the Question is also Zipping the files only.Stack Overflow Question.

Community
  • 1
  • 1
Sathesh S
  • 1,253
  • 3
  • 23
  • 54

2 Answers2

0

"http://code.google.com/p/winzipaes/"

This API helps to add a password to a already created zip file. It means that if you want to create a password protected zip file, first you have to create a zip file and then you can add a password that zip file. It is a pure java API works with any operating system. You have to download the following jar file from the above URL.

P3trur0
  • 3,155
  • 1
  • 13
  • 27
Abhijeet Kale
  • 1,656
  • 1
  • 16
  • 34
0

It is because Zip-encrypted file is a Zip, with inside files encrypted. details of encryption (algorithm, ...) is kept inside zip format.

The ZIP APIs manage that.

What you want is an encrypted file (independent of content which is Zip).

1 To do that, you can use many methods and algorithms like this:

How to encrypt and decrypt files with bouncy castle (DES) in netbeans java?

2 but result will not be recognized as zip file, then usual tools wont work.

Community
  • 1
  • 1