AssetBundle protection

Is there any way to protect your asset bundles ?

It would be nice to have on one side

string key = "myownprivatekey";
BuildPipeline.BuildAssetBundle(mainasset, dependecies, path, key);

and on the other side

string key = "myownprivatekey";
downloadedasset.assetBundle.Load("MyObject", typeof(GameObject), key);

Is there any way to workaround this ?

I’m not sure if this is useful. Even if you had a key, they could just decompile the code and get the key in plain text. If they’re stripping stuff out of your asset bundles, that would have to be like child’s play to them.

I suppose you could always just manually encrypt the data, pull the data down, decrypt it, and then load it with AssetDatabase.ImportAsset( );

I think anyone wanting assets has a much richer field than your assets given all the internet sites loaded with content. The likelihood of someone buying your game to steal the assets is not going to be important enough to your revenue stream to matter. They’d steal the assets from the server and then post them to usenet and peer-to-peer if they wanted them.

What the other posters have said is true; the hacker/pirate will get the key from your code or some other mechanism if they really want to, and there’s always the possibility they will post it if it’s useful enough. However, that doesn’t mean I leave my door unlocked just because someone with enough incentive will break in no matter what lock I use. All we can do to protect ourselves is to decrease the incentive for others to steal by making it harder for it to steal, but keep in mind that someone with enough incentive will break in no matter what. I sleep much better at night knowing the online banking system has some level of security in place to protect my data rather than base it on the honor system simply because it’s not worth expending any effort towards security since someone will eventually break in; lol, imagine that!

Clearly posting the private key in your code is a terrible idea. How far do you want to go? You could convert all your assets to binary and encrypt them, obfuscate all your dll’s, and have your users register their copy via a private key mailed to each and every one of them.

El Diablo

You’ll need to ask for customer’s private information in order to generate the unique keys needed to assure no one is stealing your assets.

What diablo wrote it’s true, I’m tired of reading again and again “Why encrypt them? if someone wants your assets, they will have them no matter what”, why? I should instead wrap my assets with gift paper and hand it over to anyone? no, I want to make the task hard, even if I know it’s not 100% bullet proof, but 50% is better for me than 0%, and that is actually the level of security in unity asset bundles.

It’s not even for me, it’s to protect my providers intellectual property. Is there a way to create an assetbundle from a stream? that way it will be easy for me to use some kind of encryption algorithm… I’ll try to look into that now since I couldn’t find anything related on the unity manual.

Cheers.