A full assets encrypt/decrypt solution without engine patch

Recently, somebody ask me about assets encrypt/decrypt questions. so I share a batch encrypt tool and EncryptManager source code which is used in game runtime to decrypt assets at here.

This solution use AES-CBC mode.

The batch encrypt tool: http://files.git.oschina.net/group1/M00/00/78/PaAvDFf4sM6ANKQeAANJ00U8TM04975.7z?token=d7e802e1752a043b19983922be70e0d8&ts=1475916063&attname=encrypt_tool_en-us.7z

There is only one API of EncryptManager to enable/disable decrypt: https://github.com/halx99/x-studio365/tree/master/encrypt-demo/cpp-empty-test/Classes

5 Likes

encrypt_tool_spec.exe not working windwos 10

let me check it.

Is there an Mac version?

sorry, no mac version.

This solution has been replaced by the x-studio365 Encrypt System Solution command line tool since 2019.1.16
The encrypt command line usage is:

  1. Download the latest x-studio365 10.0.3300.1001 at: http://x-studio365.com/dl.php?host=local and install.

  2. Then you can use command line to encrypt your assets
    x-studio365 -c -enc -cfg=D:\encrypt-cfg.xml -i=D:\OriginalRes1 -o=D:\EncryptedRes1
    other flags:
    -j2: Enable 2 threads for encrypt assets
    -ft=*.png;*.csb: Specific encrypt file types
    -dc=.ttf;.mp3;.ogg: Specific directly copy file types
    pitfall:
    (1) The ivec and key are generated by the tool randomly, and will store to encrypt-cfg.xml
    (2) If the encrypt-cfg.xml is already exist, the tool will read options from it, but will be overwrite by command line arguments, if you want new random key/ivec and use the exist encrypt-cfg.xml, you can delete the elements ivec and key from the it.

  3. The cocos2d-x runtime demo is here: https://github.com/halx99/x-studio365/tree/master/encrypt-demo/cpp-empty-test

For more detail, please see the topic: The New Cocos2d-X Encryption Solution