A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Asset Bundles' started by vaibhavgoel2, Jul 23, 2021.
Can you please us how to encrypt asset bundle & how to decrypt the same.
When you build the asset bundle into the file, encrypt the file itself.
Before loading the asset bundle you can decrypt the file into temporary location or into memory and then load it with following method:
About the encryption itself, you can google "C# encrypt byte array" or use CryptoStream (see MSDN docs).
The question is, why would you like to do that? If you store decryption key in assembly itself or in memory, it won't be very hard to get it and then decrypt the bundles.
The only good applicable use case I can think of is "pre-distributing" the content and providing the decryption key later (on the release day).