Welcome to Web-News
A Web-based News Reader
Subject Support for zip decryption -- File attached
From Jarrett Billingsley <kb3ctd2@yahoo.com>
Date Fri, 31 Dec 2004 13:01:29 -0500
Newsgroups digitalmars.D
Attachment(s) myzip.zip

I wrote a ziplib for use with another language (Blitz3D).  I made sure to
add decryption support so that I could encrypt my game data files with
winrar and still be able to extract them in the game.  I noticed that
std.zip didn't have any decryption support, so I added it.

It doesn't have any support for encryption (adding files to the archive and
encrypting them), but that might come later.

The attached file contains myzip.d, which is exactly the same as std.zip,
except that the ZipArchive.expand() function no longer throws an exception
if it finds an encrypted file, and it has an extra optional parameter - a
char[] for the password.  So to decrypt a file, you'd do something like..

ubyte[] data=zip.expand(zip.directory["test.txt"],"qwe");

Where "qwe" is the password.  Note that because of the way zip encryption
works, there is not necessarily a "right" or "wrong" password - use the
wrong password, and it'll decrypt the file into nonsensical garbage.

There is another file in the attached zip called message.txt.  Try
extracting it using the new expand() function with the password "walter".



Recent messages in this thread
 
-# Support for zip decryption -- File attached (Current message) Jarrett Billingsley 31-Dec-2004 01:01 pm
.-# Re: Support for zip decryption -- File attached Simon Buchan 03-Jan-2005 06:37 am
..-# Re: Support for zip decryption -- File attached Jarrett Billingsley 03-Jan-2005 05:26 pm
...\# Re: Support for zip decryption -- File attached Simon Buchan 04-Jan-2005 12:52 am