Thread overview
Support for zip decryption -- File attached
Jan 03, 2005
Simon Buchan
Jan 04, 2005
Simon Buchan
December 31, 2004
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".



January 03, 2005
On Fri, 31 Dec 2004 13:01:29 -0500, Jarrett Billingsley <kb3ctd2@yahoo.com> wrote:

> 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
<snip>
Heh... I hope your game isn't OSS :D
January 03, 2005
> Heh... I hope your game isn't OSS :D

Not to sound condescending, but opensource isn't really big in the Blitz3D community.  In fact it's quite the opposite - just about everything has a price.  Usually a small price, but a price nonetheless.  Can't say as I'm too happy about it, but that's just because most of the people who use B3D were raised on shareware.

I suppose I could break the mold and release my game as opensource, but then that'd defeat the purpose of my beautiful zip decryption ;)

I didn't expect this addition to phobos to be that big, so I'm not that surprised that no one else has replied.  Just curious, do you have any use for this?


January 04, 2005
On Mon, 3 Jan 2005 17:26:27 -0500, Jarrett Billingsley <kb3ctd2@yahoo.com> wrote:

>> Heh... I hope your game isn't OSS :D
>
> Not to sound condescending, but opensource isn't really big in the Blitz3D
> community.  In fact it's quite the opposite - just about everything has a
> price.  Usually a small price, but a price nonetheless.  Can't say as I'm
> too happy about it, but that's just because most of the people who use B3D
> were raised on shareware.

Hmmm.....

> I suppose I could break the mold and release my game as opensource, but then
> that'd defeat the purpose of my beautiful zip decryption ;)

:D

> I didn't expect this addition to phobos to be that big, so I'm not that
> surprised that no one else has replied.  Just curious, do you have any use
> for this?
>

Probably not, but for a completionist point of veiw (or for a proof-of-concept
extraction program or something) it's not as if it's pointless.
In a predominantly OSS comunity like this (as most programming communities are)
it is kind of pointless though, which may be part of the reason why it wasn't
included in the first place.

--
"Yes, the american troops have advanced further. This will only
make it easier for us to defeat them" - Iraqi Information Minister
Muhammed Saeed al-Sahaf