Protecting Resources?

Nibbie
Posts: 2
Joined: 2008.12
Post: #1
Howdy

Just a quick question: Is there a way of protecting your resources when compiling a bundle? What I mean is, you can just open a terminal and cd into the bundle and get whatever you like out of it, it makes it easy to code for, but I'd like to stop people fiddling with my files. Is that possible? Is there someway to "lock" them so they can't be read/changed? Or is the solution to somehow combine them in my own data file format? If that's the case, any pointers?

Ok, so it was a little more than one quick question. Smile

Rob.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #2
UselessRob Wrote:Howdy

Just a quick question: Is there a way of protecting your resources when compiling a bundle? What I mean is, you can just open a terminal and cd into the bundle and get whatever you like out of it, it makes it easy to code for, but I'd like to stop people fiddling with my files. Is that possible?
Actually, is even easier than Terminal+cd: Try right-clicking (or control-clicking) on your app, and select "Show Package Contents" Sneaky

Quote:Is there someway to "lock" them so they can't be read/changed? Or is the solution to somehow combine them in my own data file format? If that's the case, any pointers?

If you want to prevent casual users from opening and playing with your files, simply change their extensions. For instance, change every file extension to .dat, or something non-standard. You will still be able to read them, but a double click won't open them anymore. Another thing you can do to prevent casual access, is compress everything in one file and use zlib or some other library to read your files directly from that one compressed file. Of course, if you use zip or gz, remember to change the extension to something else!
Also, you could try using a password protected, compressed file, and embed the password in your app. It won't be 100% secure, but would make things a bit harder for the occasional tinkerer.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.12
Post: #3
Wow, it is even easier than I thought! Smile

I've tried renaming the files, but I hadn't thought of zipping or anything like that.

All great suggestions, thanks a lot!
Quote this message in a reply
Puzzler183
Unregistered
 
Post: #4
Just remember that any scheme you come up with, no matter how complicated, can and will always be broken. People have a lot of free timeRasp.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.12
Post: #5
Hehe ofcourse. I just want it to be harder than a quick click for people to mess with the data files.

Just stop the casual folks having a fiddle.

Err.. I mean that in the nicest possible way. Smile
Quote this message in a reply
Member
Posts: 196
Joined: 2003.10
Post: #6
UselessRob: Frankly, I don't see the problem with people poking around your app bundle. Almost all commercial games leave the resources sitting out there. Really, I doubt it's worth it.
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #7
There is a commercial toolkit for encrypting all your assets in the bundle. But the name escapes me at the moment.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.12
Post: #8
Blobbo: The reason I want to do something to stop fiddling is that with my first Windows shareware app way back when, I wasn't bothered by it. I had my files in the exe as resources, and it took only a couple of days before I had emails from people saying they'd simply changed the "please register" message to a blank image. Now, this was partly my fault for doing such simple crippling, but I then added some simple checks and stuff and it didn't happen again. Smile So I just wanna take a simple step to stop the average user playing with it. I'd rather choose which bits are customizable, if that makes any sense. I'm small and petty. Smile
Quote this message in a reply
Post Reply