aspose file tools*
The moose likes Java in General and the fly likes How to unzip password protected zip file in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to unzip password protected zip file in java?" Watch "How to unzip password protected zip file in java?" New topic
Author

How to unzip password protected zip file in java?

Giri Regu
Greenhorn

Joined: Apr 03, 2006
Posts: 15
Hi all,

I am trying to unzip a password protected zip using java.util.zip package.
it throw an error "java.util.zip.ZipException: encrypted ZIP entry not supported".

is there any specific classes to unzip password protected zip file in java?

how can i make this works?

Thanks in advanced,
Giri
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Take a look at http://www.coderanch.com/t/276889/Streams/java/java-util-zip-password-protected

A Google search turned up IP*Works! Zip, commercial product by /n software
[ August 25, 2008: Message edited by: Mark Vedder ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42283
    
  64
In regards to the discussion Mark linked to, the built-in ZIP classes in the class library do not support password-protected ZIP files (and I'm not aware of a Java library that does).


Ping & DNS - my free Android networking tools app
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1773
    
    7

On the other hand, the ZIP File Format Specification is well defined, so anyone with 'some' time to kill could extend the standard ZipInputStream / ZipOutputStream pair to support encryption. Java crypto supports AES, so that's like a head start
Of sorts.
[ August 25, 2008: Message edited by: Jelle Klap ]

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Did I just hear you volunteer Jelle?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42283
    
  64
Somehow I seem to remember that PKZIP and WinZIP use different but incompatible password schemes. Anyone know anything about that?
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1773
    
    7

Originally posted by Rob Prime:
Did I just hear you volunteer Jelle?


Good point.
I'll shut up now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to unzip password protected zip file in java?