Quantcast
Channel: Answers for "Is it possible to change builds structures?"
Viewing all articles
Browse latest Browse all 4

Answer by whydoidoit

0
0
Ok so you are probably going to use System.Security.Cryptography to do the encryption and create a [CryptoStream](http://msdn.microsoft.com/en-us/library/system.security.cryptography.cryptostream.aspx) that you would use to load some of your assets. The easiest thing to do would be to create asset bundles and then encrypt those files and decrypt them before using [AssetBundle.CreateFromMemory](https://docs.unity3d.com/Documentation/ScriptReference/AssetBundle.CreateFromMemory.html) on a decrypted byte array. This would cover your assets **but not** your scripts. The best way to manage scripts would be to download a chunk of your code from the server in an encrypted stream and use [Assembly.Load](http://msdn.microsoft.com/en-us/library/h538bck7.aspx) on the decrypted byte array to load some script into the game. A clever approach would be to automatically update such components every hour or so and have it send a GUID to the server. The server would maintain a list of currently valid GUIDs (last one, this one) and would reject the code if it was out of date or messed with and not allow any play. This does mean compiling a set of different executables or resources that have the keys. Given that you have to decrypt these streams you will somewhere in your code have to have the key, which a hacker can find so it isn't 100% secure (apart from the script method I just described which is secure on every period you change the code, though even this could be "auto hacked" especially if the location of the encoding did not change or was easily identifiable). But it would need to be hunted for. Don't download keys from the server, this gives a packet sniffer more chance of identifying the keys location.

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images