I. The harm of Assetbundle resources being hacked and decrypted
After Unit from 5.x version, Assetbundle resources are used more and more widely, the ab package can contain pictures, videos or scripts, all of which are the intellectual property of the game, if they are decrypted by hackers or competitors, and get the content inside, it is a big loss for the game.
Ab resources are decrypted and captured, in addition to the loss of intellectual property, it will also have a great impact on the game operation. For example, if the activity resources in the game package are unraveled and dramatized in advance, it will greatly affect the effect of the activity. In addition, if the resources are modified, it will also produce cheats effect.
For example, in the picture below, the resource material has been modified to be transparent, creating a see-through effect.

II. The realization principle of Ab resource encryption solution
Many games now recognize the importance of Assetbundle resource encryption, and you can find related encryption articles on the Internet, such as the program provided by Yusongmono, which encrypts the entire resource. The disadvantage of this method is very obvious, ab resources account for a large proportion of the game volume, if all the encryption is done in this way, the performance impact will be very large.The problem of how to encrypt the ab resources and at the same time, decrypt the consumption is very small, this problem has become the pain point of many games.
JikGuard's R&D team spent a lot of time on black box analysis of unity engine, and figured out the loading mechanism of Assetbundle and its file structure.
The following encryption solution was developed:
First of all, we analyze the structure of Assetbundle file, find the core file block of resource file, encrypt the core file block, and then bury the unity engine Assetbundle loading timing when the game is running, and decrypt the core file block at the burying point.
III. Advantages of Ab resource encryption solution
This solution has the following advantages:1. Only decrypt the resources when they are loaded, without increasing the startup delay
2. The encryption strength is very high, the encryption and decryption algorithms are custom obfuscated, so that the hacker can not analyze the algorithm, the algorithm flow chart is shown below:

3. High compatibility
Through the Android SO shell or iOS static hook imported pure native program, compatible with all 32-bit and 64-bit instruction sets.
4. Decryption speed is very fast.
There are two reasons
1) Because the core file block is very small and does not vary with the size of the entire resource file. Using mainstream cell phone test, 300 resource files decrypted at once, the additional decryption time is less than 10ms.
2) Although the encryption algorithm has been customized to do high-intensity obfuscation, but the obfuscation is carefully designed to increase the complexity at the same time, taking into account the efficiency of the running overhead is very small.
5. Support online update of resources
6. Support Android / iOS / PC three platforms
Ab resource encryption algorithm is common to all three platforms, even if the encrypted Ab resources are sent online, they can be loaded normally.
IX. How to use Unity Resource Encryption
It is very easy to use, just run a command line to complete the encryption of the whole game resources.This command line encrypts the game resources and also encrypts the scripts in the game with mono dll encryption or il2cpp encryption. At the same time, according to the configuration options, you can also add anti-hack, anti-cheat, anti-modifier, anti-speedhack, virtual machine, cloud phone and other functions. In addition, it also supports encryption of individual AB packages, which can be done with a single command line.