Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I think the title is quite self-explaining, still this is a big area I think, so let me drop a few words:

I've got a simple experiment game project going, and I want to make sure, that the user isn't messing with the game assets like player skin etc.

In my opinion the best way would be that on production I would merge all the assets into one file and the application would check the hash of that file, so it could detect the corrupted data.

Is this an acceptable practice? There must be sum libraries / applications which are targeting this problem, could you guide me on this?

Project details: unix/linux, c++, sdl

share|improve this question
So, you want to hide or protect resources/assets? – kravemir Oct 21 '12 at 15:08
Yes, both hide and protect, in the sense that hiding is merging into one file and maybe pack/zip it, and protecting is achieved trough hash code controlling. – p1100i Oct 21 '12 at 16:01
possible duplicate of How can I protect my save data from casual hacking? – Josh Petrie Oct 21 '12 at 16:15
I think this is a duplicate because the fundamental techniques are the same, and the "casual hacking" point is relevant because the data is on the end-user's machines and thus can be accessed with enough effort. – Josh Petrie Oct 21 '12 at 16:16
@JoshPetrie It's not really a question of "enough effort" - since we're talking about games it's more like "no effort". There are general purpose OpenGL and DirectX debuggers that can simply read any texture from graphics memory and save it to disk. If it can be displayed then it can be accessed. Actually, the same tools can modify the images post-loading, so checking the hash isn't a good technique for protection ;) – Liosan Oct 21 '12 at 18:50
up vote 1 down vote accepted

My answer to this question won't be complete, because there is no real good way to achieve what you want.

Assume you would pack all your assets in one zip file and compute the hashes. This leads to the problem that you need to recompile your project if you hardcode your expected hashes. However if you save the hash in another external location, you would need to protect that, too.

One method to protect your assets I often rely on is using PhysicsFS to pack my assets in different packed zip files. In order to protect them, you could use some kind of symmetric encryption to secure your archives. If you do not plan any AAA-game this should be fairly enough to protect everything. But keep in mind, too much encryption etc. won't be useful and eventually decrease performance if you load your assets on-the-fly.

share|improve this answer

Don't make it too easy for hackers by putting each individual image in its own file or whatever, but don't bother with encryption because the determined ones will just break it, and pushing it to slow them down will just slow down your game and its development.

Blizzard's MPQ format has encryption, and it has been cracked.

The big name games tend to use some variation of a well-indexed propietary archive file format with maybe basic compression.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.