Password protected zip resource

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Password protected zip resource

Post by lonewolff »

Hi Guys,

Is there a way to use a password protected zip resource, to help hide away assets from prying eyes?

I know there is no sure-fire method to stop people from getting at your resources, but this seems like a logical first step.

Love to hear your ideas 8)
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Password protected zip resource

Post by dark_sylinc »

The default Ogre implementation of ZipArchive relies on zziplib, which doesn't support password protected files.

However it shouldn't be too hard to write your own implementation of Archive to use a different library that does support encryption, or even modify an existing implementation to perform a simple bit mangling (or full AES decoding) before performing the actual read.

Edit: It seems zziplib does actually have an obfuscation routine.
User avatar
insider
Orc
Posts: 462
Joined: Thu Sep 15, 2011 12:50 pm
x 31

Re: Password protected zip resource

Post by insider »

lonewolff wrote:Hi Guys,

Is there a way to use a password protected zip resource, to help hide away assets from prying eyes?

I know there is no sure-fire method to stop people from getting at your resources, but this seems like a logical first step.

Love to hear your ideas 8)
I have also had the idea of why media resources can't be password protected.
I had bookmarked this a long time back.
http://www.codeproject.com/Articles/133 ... -LiteUnzip

Would it be possible to use it with Ogre ? :)
I have media files worth atleast upwards 1000$ any help in protecting them would be great :D
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Password protected zip resource

Post by c6burns »

Ultimately your assets are not safe from someone with even a medium amount of skill no matter what measures you take. Not only could they rip resources by using a dx/gl interceptor and not even worry about where/how they are stored on disk/internet/tron lightcycle drive ... they could disassemble your code. So you have to decide how much work its worth doing. Personally, I think stopping the average user is good enough, so simple obfuscation or alteration to the zip headers is enough. Some commercial games simply rename their zips to a different extension with no obfuscation (like Crytek).

Anyway, my understanding is you can subclass Archive and ArchiveFactory to create your new archives. Then you register the new factory with the ArchiveManager:
http://www.ogre3d.org/docs/api/1.9/clas ... 379a512730

So you are free to use any library or format to store assets.
User avatar
paul424
Gnome
Posts: 314
Joined: Thu May 24, 2012 7:16 pm
x 13

Re: Password protected zip resource

Post by paul424 »

Insider, have you ever saw a offline installable game which protects it's asset in any way ?
Never saw that. Every game just lays off it's assets in front of the user in texture, models, maps , directories .... etc.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Password protected zip resource

Post by c6burns »

paul424 wrote:Insider, have you ever saw a offline installable game which protects it's asset in any way ?
Never saw that. Every game just lays off it's assets in front of the user in texture, models, maps , directories .... etc.
Many many games do. The first game I checked on my PC is Alien Isolation. It is storing resources inside .pak files which are not just renamed zips. Second game I checked, FFXIII. I know they are using bink for video, but all their videos are stored with some weird extension name and possibly obfuscated. All of the assets for each zone are lumped together into large .bin files as well. Third game I checked, GOG version of Deponia. All of their resources are stored in some special format.

3 for 3 so far. I'm sure if I kept checking games, I'd find most I have are employing some basic protection for their assets on disk.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Password protected zip resource

Post by lonewolff »

Crysis does it as well, infact their Pak files are actually pass worded zip files.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Password protected zip resource

Post by Transporter »

A long time ago, I made a proposal to remove the zzip library: http://www.ogre3d.org/forums/viewtopic.php?f=3&t=70443

A good replacement would be libarchive. libarchive is supporting a lot of file formats and could handle encrypted files by using OpenSSL. Also, libarchive is licensed under BSD which is better than the MPL of zzip.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Password protected zip resource

Post by c6burns »

lonewolff wrote:Crysis does it as well, infact their Pak files are actually pass worded zip files.
Ah I swore it was renamed zip files with no protection, but I'm too lazy to re-install and check. You are probably right and I'm thinking of the SDK .pak files or something.

Anyway ogre is built to accommodate whatever your needs are re: protection by extending your own Archive/ArchiveFactory. The issue of protecting your media was definitely not unforseen in the design :)
User avatar
insider
Orc
Posts: 462
Joined: Thu Sep 15, 2011 12:50 pm
x 31

Re: Password protected zip resource

Post by insider »

paul424 wrote: Every game just lays off it's assets in front of the user in texture, models, maps , directories .... etc.
Well maybe Indie games do that, I have COD MW,Dirt 3, Grid and HAWX installed, now those are games from Microsoft, Ubisoft and CodeMasters and none of them have asset protection as easy as right click -> Extract :lol:
c6burns wrote: Anyway ogre is built to accommodate whatever your needs are re: protection by extending your own Archive/ArchiveFactory. The issue of protecting your media was definitely not unforseen in the design
It's good to hear Ogre does accommodate media protection, well I don't need an AES vault protection but I should at least protect my assets from any 10 year old kid, that should suffice :D
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Password protected zip resource

Post by Kojack »

lonewolff wrote:Crysis does it as well, infact their Pak files are actually pass worded zip files.
CryUnpack: https://www.youtube.com/watch?v=KLKEi_Ltg3c
It lets anybody extract Crysis 1, 2 and 3 game assets.

One of my hobbies is reverse engineering game data files (terrain in particular interests me, such as Morrowind's offsets from horizontal adjacent vertices, World Of Warcraft's interleaved 9x9 and 8x8 height maps, Asheron's Call's algorithm controlled triangulation direction, etc). Can be fun.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Password protected zip resource

Post by c6burns »

Yeah, if your game is anywhere near successful, your assets are going to be stripped out and toyed with or even uploaded to some site on the internet :lol:

But at that point you can celebrate (hopefully) because enough people bought your game legitimately that you should be throwing a huge party and sending me an invitation :twisted:
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Password protected zip resource

Post by lonewolff »

Very true, but even still I'd rather have the option of not handing people game assets on a silver platter :D
Post Reply