Skip to main content
GameDev.net gamedev.net
🔒 Locked

Using PhysicsFS...

Started by Perferati May 8, 2005 at 1:48 AM 3 replies 3.1k views
Original Post
Perferati
Perferati
Hi all, Im wondering if anyone has any experience encrypting resource files...right now im using the PhysicsFS file library and storing all my resources in a .zip as far as i can find PhysicsFS has no support for password proteced zips ... so im at a loss as to how i can (relatively easily) protect my game assets.. any thoughts would be much appreciated. Perferati
cozman
cozman
Honestly, the way to do it is usually just to rename the file something obscure, like change the extension from .zip to .mpf (my package format) This will keep 99.9% of the people you are going to keep out of it out. The people that really want your resources will get them, they can capture them in game, if they are passworded in the zip, the password will probably be stored in plaintext within your app.. in the end you'll go to a lot of trouble that isn't worth it.

Many major commercial games don't even attempt to hide their resources, there isn't that large of a need. A user can't legally steal them for commercial use, so why complicate things.
Kylotan
Kylotan
You could consider using something like Crypto++ to encrypt your data, or the zip file. But as mentioned above, it's probably not worth the effort.
TravisWells
TravisWells
An idea: Now that PhysFS is zlib-licensed, you can modify it and distribute (include in your game) those modifications without making the source open.

You could get the source, and modify one of the weirder archive formats (like HOG or GRP). Just alter the header to have a different identifying marker, and the regular tools (and un-modified physfs) won't read them.

GRP is a simple format to modify, and there are free tools (with source) to create them: http://www.advsys.net/ken/buildsrc/default.htm
Only problem is they are limited to 8.3 filenames (it's an old DOS format) with no directories, but you could fix that while you are modifying the GRP-loading code.

PAK might be another good choice, I don't think it has filename limitations.

But like cozman said, you could probably just rename the filename (wouldn't recommend zip though, it's too common. Try PAK or something) and get about the same effect.
You can't prevent your resources from ever being figured out, so why waste the time?
Perferati
Perferati
I suppose the best approach would be to package my files in a lesser known format (.pak for example) and then rename the file...should serve my purposes fine as I am not anticipating a 'commercial' release...:-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.