United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4347142 Need method to set Password protection to Zip entries
JDK-4347142 : Need method to set Password protection to Zip entries

Details
Type:
Enhancement
Submit Date:
2000-06-21
Status:
Open
Updated Date:
2009-07-03
Project Name:
JDK
Resolved Date:
Component:
core-libs
OS:
generic,windows_xp
Sub-Component:
java.util.jar
CPU:
x86,generic
Priority:
P4
Resolution:
Unresolved
Affected Versions:
1.3.0,1.4.2
Targeted Versions:

Related Reports
Relates:

Sub Tasks

Description

Name: skT45625			Date: 06/21/2000


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

We are on the process of converting our ActiveX control which zip's a users
local files add password protection to zip entries and uploads these zip files
to his/her account on the host. However the current zip classes provided by JDK
(ZipEntry, ZipOutputStream etc..) does not have a method to set the password of
the zip entry. This is crucial to our application and hope the java team can
develop this feature in its next release.
(Review ID: 106388) 
======================================================================

                                    

Comments
EVALUATION

I'm not sure this is possible with the INFO-ZIP libraries we are using.  I'm not sure they support the password feature as done with the PKZIP implementation.

andrew.bennett@eng 2000-11-15
                                     
2000-11-15
EVALUATION

Sun's Java SE implementation uses zlib.  From the FAQ at:
    http://www.zlib.net/zlib_faq.html#faq38

<quote>
How can I encrypt/decrypt zip files with zlib?

zlib doesn't support encryption. The original PKZIP encryption is very weak and can be broken with freely available programs...
</quote>

The PKWare specification at:
    http://www.pkware.com/support/zip-application-note
suggests that, as of version 6.2.1 (perhaps earlier?), stronger encryption is possible.  However, (a) zlib does not support this, (b) the appnote states that use of this newer technology is covered under a pending patent application.  In light of the open sourcing of the JDK, it is questionable if this can be adopted (but note that I am not a lawyer and nothing here should be construed as a legal opinion).
                                     
2008-06-11



Hardware and Software, Engineered to Work Together