Image and sound encryption

Maybe this topic is not in the good section but I’m remembering a thread where people were talking about doing encryption for images and maybe other files such as sounds/music. Anyway, how do you protect your content such as images and sounds? I intend to use png images and ogg files for sound (still don’t know for music). I’d like to use them in an unsecured fashion at dev time and encrypt them at distribution time only and the game knows that it has to decrypt them for production use. I know that many companies define their own image format but I’d like to avoid this as much as possible. Same idea for sound…

I would write my own classloader that pipes everthing through a javax.crypto.CipherInputStream, then access the standard type files as normal via getResource() and getResourceAsStream().

Of course, keep in mind that encrypting data gives you FAR from as much security as you might think. There’s no way to make it secure, so the only question is how many trivial hoops you make people jump through before getting the content.
(and you need to jump through those hoops as well when implementing it)

OK thanks for the ideas. What do you do in Wurm Online?

Not sure if this is a good idea or not. But why dont you corrup the files? I.e. Add a little key at the top/bottom (or both) of the png file (in bytes) and just read if that key is valid or not. If so, then read whats in between. I can see alot of problems with that to. I.e. you dont use the normal ImageIO stuff, you can probably find a back way through…

Its an idea nonetheless…

DP

I’ve already thought about that but it’s not really secure. Thanks for your help.

The most secure thing would be to currept the files in some way. That will prevent people form just opening the files in their favorite viewer. It do not mather if you use the most advanced encryption in the world, or basic xoring. They got your code and can decrypt it no mather what.

But why bother at all?

[quote]I’ve already thought about that but it’s not really secure. Thanks for your help.
[/quote]
There is no secure way to do this.
You might as well use XOR rather than some complex crypto… since your program itself will contain the code to decrypt the images it’s like locking a door but leaving the key in the lock.

/me agrees with swpalmer.

Ironically, “just xoring” the files might end up being more work in java since we have all those fancy crypto classes built in in the language. =D

As for wurm, we currently don’t obfuscate(*) the art at all.

(* btw, you’re not encrypting if you’re doing anything suggested in this thread… you’re obfuscating)

OK thanks for ideas. I ask the question because in the future when my game will go live, I don’t want companies to stole images and sound/music contained in the game and reuse it for their own commercial purposes. I don’t know if this could happen.

As a general rule: No such thing as client side security.
Just wrap the resources in something like an xor stream that makes it harder to get than pure images.

If they ever use your media in a production game, you can sue them.

OK then I think that I will simply put some sort of signature at the begining and end of each file using image io. My game would have to just ignore them and read the content.

What about watermarking? It may be useful?

Watermarking is probably the more useful thing. Since you can’t prevent someone from stealing the content, the next best thing is being able to prove that they did :slight_smile:

I’d just like to point out that your art and sound, individually… are pretty worthless, from a commercial perspective. In other words no commercial entity is going to dream of taking your graphics and sounds without permission because the risks are big and the rewards trivial. That just leaves hobbyists and modders and so on… and what’s the harm in letting them play with your stuff? A few bleeps and boops and a grass texture ain’t so much to give away is it?

Cas :slight_smile:

[quote]and what’s the harm in letting them play with your stuff? A few bleeps and boops and a grass texture ain’t so much to give away is it?
[/quote]
I hope you’re not refering to the prototype/demo I’ve done. I don’t consider those graphics as professional stuff.

Even if it were professionally developed graphics and sound… in fact especially if it were professional. It’s just something that you’re worrying about that isn’t really a problem. Like piracy: there is nothing realistic that can be done about stopping it, so you just need to work out how to make money regardless of piracy.

Cas :slight_smile:

Image obfuscation/encyrption/whatever is pretty pointless anyways. Anytime you’re drawing the Image to the screen in your game, the “print screen” key can be pressed… (at least on Windows)

Watermarking is preserved in that case, but as princec stated out, you have to be certain that if somebody wants to steal your work, he will succeed…

You wouldn’t watermark every sprite on the screen… that would be hideous!

Quite right, MOST watermarks can easily be removed with something similiar to the “clone brush” on Photoshop. Either way the thief might not want the part of the image that has the watermark and would just crop what he wants out :stuck_out_tongue:

Watermarks aren’t visible to the naked eye.