Encrypting game content

Is there a good way to encrypt game assets into files to hide from everyone except the hardcore? I was thinking of using bz2lib to compress the data. One could use hex base XORing of the data and reversing of the bits, and a number of functions that are reversible.

The more I've thought about hiding assets over the years, the less it appeals to me. What's to hide? No matter what you do, you can't ultimately hide it, so what's the point? What's the difference between a casual gamer seeing a texture and a hardcore gamer or hacker?

The only time I've come up with a reason to bother making an effort to hide asset data is if the product includes someone else's intellectual property, or there is some other potential liability. Even then, it seems to me that just having it stored in the app bundle might win the argument in court since you didn't hang the dirty laundry out in the open air for the neighbors to see without them making a special effort to reveal it.

Thirded, it's just not a problem in reality. What I did for Galder was to put a couple of megs of junk data in the bundle called "gamedata.packfile" and then hid the real stuff in a hidden directory. A simple ls -a will reveal it, but at least it deters the casual snooper. Still, I can't really see why I was so eager to hide the files...

Copyright is tough protection -- *legal* protection, which is much better than encryption IMHO.

Because of copyright, the need to hide content is merely an illusion, when you think about it. That's why id open-sourced all their older stuff. They realized that there's no way to "steal" a game, even if the source is made freely available, because the graphics and content are firmly protected by copyright. You can't just make the game and give it away without the content, and the content is NOT open-source, only the code is. Genius! It's amazing to me that no one has taken id up on the offer to make whatever they want --> *for profit* <-- with id's open-sourced stuff. I think this is proof that the common conception of "ownership" is really just an illusion to most of us.

What I'm saying is that you (and/or the artists) *own* the content, no matter what the "snoopers" think there is to be had in there for them. If they use it in any way, they are screwed, by law. So there's really no point in hiding it when you think about it. It's just extra work on your part, protecting stuff that is already protected for you.

But of course, it's taken me years to see it this way myself, so I know how hard it is to give up on the concept.

It's understandable that such a question would create a bunch of "why bother?" responses, and my gut reaction was the same.

However there is a clear win to providing some level of protection when you are asking others to contribute work, and as a contributer I would ask "how easy is it for someone to pull my art/music out of the game" and the answer for simple resources in bundles is "dead easy".

So, if you need to try to make it harder, you are on the right track. Explaining exact methods on a public forum might not be so wise, but in general I would use a combination of compression and a small amount of change that renders the compressed archive very difficult to extract by any other means than your app.

Anything more than this is pretty much redundant as far as deterring the determined hackers goes, and in an ideal world you could explain that to your contributers. Otherwise it's just a matter of coming up with creative buzz words and implementing them in some form or another for little actual protection but perhaps more piece of mind for the artist.

You can easily make it harder for average Joe with not much effort, but actually stopping someone who knows a little more is impossible.

reubert Wrote:However there is a clear win to providing some level of protection when you are asking others to contribute work, and as a contributer I would ask "how easy is it for someone to pull my art/music out of the game" ...

I would answer, "No easier than it would be if you put it up on your website for them to look at or listen to." If you don't want people to see or hear your work, why make it? Once somebody else sees or hears it they can create a derivative of it. You can't encrypt against perception.

As a contributor, I would say, "My work is copyright me, so I don't care what you do to protect it from being pulled out of your game, because nobody else can legally use it anyway. I licensed only you to use it and distribute it with your game."

OK, but there is a clear difference between listening to a song via the internet, and downloading that song as an MP3 to put on an iPod, thereby never having to pay for it via iTunes or otherwise.

If I was a musician who had music available for purchase I would be concerned about that music being available for free to anyone who happened to look in the resources of a particular game bundle.

It's pretty clear that no one gives a damn about copyright for personal use. I think you have a good argument for commercial use of resources (which might be worth pursuing in the courts or public forum), but if you're targeting mainstream consumers and are trying to source resources from someone who has a financial interest in not seeing those resources distributed on a wide scale for free, you need to do something to convince your contributer that it won't harm them financially.

reubert Wrote:... but if you're targeting mainstream consumers and are trying to source resources from someone who has a financial interest in not seeing those resources distributed on a wide scale for free, you need to do something to convince your contributer that it won't harm them financially.

I can agree with that. I can understand that some potential contributors wish to have their creations "hidden" to protect them financially.

I guess my position is that I would make an effort to convince them that they're wasting their time, and mine, by wanting to do so. I would remind them that their work is already protected by copyright.

Music is probably a little more sensitive in this area since it can be appreciated outside of the game. Art, OTOH, is not really so special in that respect. Being as how I've worked in commercial graphics I can testify that it is hard work, but it's only valuable in its context.

[edit] All that being said, in reality, no one wants to piss off the artists. Seriously. You can try to get them to understand, but it's *their* work not yours. I fully appreciate that!

AndyKorth Wrote:If you're in the United States, you can use the DMCA to crush people. Implement a trivial encryption for your assets, and if it's ever circumvented in any way, you have some powerful legal options.

Yeah, like having the Interpol raid that script kiddie's house in Siberia.

As for encryption i think that it nice to have a pack system that stores assets in one file or more, it especially good for localization because you can prepare a set of pack for different lags.
Another think is that it more elegant to keep 4 - 6 files which contain data than keep hundreds of files.
Next thing is that encryption is some sort of security but just for normal ppl, (i have spend quite a lot of time trying to make exe for windows hard to crack but the harder i try the more ppl wanted to crack it so finally i gave up my efforts because it was just useless). So encrypion is good to make your work easier for example asset manager that as a bonus has encryption but don't think that this will grant you security, is someone wants to steal assets thy will do it and encrypion will only make them angry.

I agree with OSC and Jake on this one, and must say that there is every benefit to not encrypt your files and few downsides. Many of the most successful commercial games, both high production and shareware, have been successful and have retained large followings because of their inclusion of mod tools and the freedom for the player-base to expand upon the game.

For a high production example, take Morrowind and Oblivion; both were popular when they first came out, but as anyone in their respective communities will tell you, if it wasn't for the ability to mod the games and alter them to the communities liking, neither would continue to be popular today. Especially Oblivion which many feel is almost unplayable without a range of mods.

For a shareware game, the Escape Velocity series is a prime example. The EV series has been successful because they were great games to begin with, but the community for it is still alive and kicking years afterwards, for no other reason than the ability to relatively easily create mods of all sorts for the games.

To be perfectly honest, many players find it insulting when companies try to turn pieces of software into virtual fortresses, while they tend to embrace companies that fully support a communities right and ability to, through mods, open source or feedback, affect the games they love. Unfortunately, giving players the power to help shape the games they love is mutually exclusive with locking down your resources.

To that end, your resources are never truly secure in any real fashion; the more you lock data down, the more some people jump at the bit to get it. Any audio can easily be stripped and recorded by a variety of tools (including one that Ambrosia offers), and due to the way data is sent to a graphics card to be rendered, model and texture data can actually be stripped out and saved. To be fair, someone would really have to be dedicated to getting the resources to try either of those methods, but the fact of the matter is, people can and do.

The simplest way to avoid the hassle while still keeping casual viewers at bay (anyone just looking around the folders), is to package your resources in a few (one for models, one for sound, ect) easily read resource packages. You keep away the casual viewers while still taking away the thrill from the people who do it just for the sake of doing it. All with the added bonus of allowing those with the will, to mod your game. Not to mention the decreased complexity of writing development and/or modding tools, simply because you no longer need to find and decrypt every resource you wish to work with.