ZipBuilder - Create zip file with password?

I am using the ZipBuilder class to create a zip file with data. Is there anyway to create a zip file with a password on the file? I want to make sure that only the correct user can import the zip file back into the program after it has been created.



Does the zip format support passwords?

But anyway, you can always just encrypt the resulting data - we have a bunch of algorithms you can use for that in the crypto module.

It does:


4.1.4 Data encryption MAY be used to protect files within a ZIP file.

Keying methods supported for encryption within this format include
passwords and public/private keys. Either MAY be used individually
or in combination. Encryption MAY be applied to individual files.
Additional security MAY be used through the encryption of ZIP file
metadata stored within the Central Directory. See the section on the
Strong Encryption Specification for information. Refer to the section
in this document entitled “Incorporating PKWARE Proprietary Technology
into Your Product” for more information.

Having the embedded encryption in place has the benefit, that it can be opened with any unzip.

But encrypting the content is an option for the OPs use case.

P.S. still looking for the original zip specification… (silly me, pkware IS the original :wink: )

I will have hundreds, maybe thousands of mp3/wave/aiff files in this zip file.