password protected archives (zip)

What it says on the tin: a place to discuss proposed new features.
Post Reply
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 2

password protected archives (zip)

Post by cyrfer » Sat Oct 09, 2010 3:31 am

Hi,
Does the built-in zip archive code have an option to open a password protected file? I'm looking for this feature and it seems like there is no reason not to support it in the built-in zip support.
0 x

User avatar
Fish
Greenskin
Posts: 131
Joined: Fri Aug 22, 2008 6:12 pm

Re: password protected archives (zip)

Post by Fish » Sat Oct 09, 2010 6:42 am

Ogre uses the zziplib library to provide zip file functionality. zziplib does not support password protection for this reason. The author of zziplib provides an example of how to obfuscate a zip file and how to use zziplib to read an obfuscated zip file. It should be trivial to provide your own obfuscated zip parser/factory to the Ogre::ArchiveManager.

- Fish
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: password protected archives (zip)

Post by Assaf Raman » Sun Dec 05, 2010 1:33 am

There are two reasons you may want this:
1. You want to hide your resources.
2. You want to make sure that the resources that are used are your resources (if your program downloads files from the internet and such).

1 can never truly be achieved - if a program runs on the computer - you can always decompile it, you can only make things harder - and an idea like the one in the post before mine - is better then a password - that is easier to find with a decompiler.

For 2 you will need to digital signature - to sign with the private key and open with the public key. There are many ways to do this, I don't think that adding a new dependency for OGRE for this need is something we are going to do on the team level, if you really need this feature post here an perhaps someone will create a snippet for you.
0 x
Watch out for my OGRE related tweets here.

User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1669
Joined: Mon Jan 21, 2008 10:26 pm

Re: password protected archives (zip)

Post by madmarx » Sun Dec 05, 2010 2:12 am

0 x
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0

User avatar
Fish
Greenskin
Posts: 131
Joined: Fri Aug 22, 2008 6:12 pm

Re: password protected archives (zip)

Post by Fish » Sun Dec 05, 2010 1:59 pm

There are still a few small things that I need to add/change before I can consider moving it out of the sandbox (like the toc position and some comments), but it's usable.

Don't spend too much time trying to 'hide' resources. In the end the code will be cracked and the resources will be visible to all eyes. Even the million dollar DRM systems are eventually cracked, sometimes within days of a games release (1, 2, 3, 4). If you are contractually required by a content provider to 'obfuscate' distributed content, then keep it simple: change the .zip extension to something else or do a simple xor.

- Fish
0 x

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: password protected archives (zip)

Post by Wolfmanfx » Sun Dec 05, 2010 3:27 pm

You can always dump meshes and materials from the gpu (there are easy to use tools) so do not waste your time with encryption.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: password protected archives (zip)

Post by Assaf Raman » Sun Dec 05, 2010 4:03 pm

I did need a resource signature checking system in one project - to protect my activex from hackers. I needed to make sure that I created the resources that are downloaded - else a hacker can use my activex to download and run viruses.
Unity3d supports c++ plugins - I don't think they have any way to prevent someone from creating a c++ plugin that copies a virus to computer that runs the unity activex. This is a risk that a simple signature verification can solve.
0 x
Watch out for my OGRE related tweets here.

jblovloss
Halfling
Posts: 42
Joined: Sat Nov 07, 2009 6:59 am
Location: USA
Contact:

Re: password protected archives (zip)

Post by jblovloss » Fri Dec 24, 2010 9:51 pm

Fish is correct that hackers will get through your password protections. If we're talking about things like textures and models, those will get unzipped at runtime and put directly into memory. Even a script kiddie can get them there.

Maybe there's a nice method for turning your content procedural. If you had procedural code compiled directly into your binary, that would be much much harder for someone to get at. Especially with some code obfuscation.
0 x
Come visit me at Bit Bards: http://www.bitbards.com

Post Reply