Nex
Nex

Reputation: 361

Library for Unzipping password protected file

I need to unzip password protected file.

I am asking for library to include to my Windows project, not utility.

Requirements:

Already searched SO and Google, unfortunately no libraries found yet.

I can't believe there is no solution for this simple task in 2012. Please help.

Upvotes: 4

Views: 10398

Answers (3)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

You can try Info ZIP. It is open-source, and supports archive encryption: http://sourceforge.net/projects/infozip/

Upvotes: 0

user1055604
user1055604

Reputation: 1672

UPDATED: use 7-zip as a library

Test if your password protected file can be decompressed with 7-zip.
If that is the case, then you should be able to use the codebase (as a dll).

The tool has support for zip decompression (ZlibDecoder) and 2 possible different encryption techniques (ZipCrypto & ZipStrong).


As for instructions how to use it, the 7-zip file manager tool uses the 7-zip dll to do all the work. You will need to look at the source code of the command line tool 7z.

Upvotes: 2

Nex
Nex

Reputation: 361

Ended up using "Zip Utils" by Lucian Wischick.

There was a bug - extracted file is cropped by 12 bytes at end. I found out how to fix it.

To fix this bug, delete line 3657 in file "unzip.cpp":

pfile_in_zip_read_info->rest_read_uncompressed-=uDoEncHead;

Upvotes: 4

Related Questions