Unity Anti-Cheat tools

This package 'Anti-Cheat Tools' is designed to protect games from cheaters

 

 

Package includes

- Encryption of resources (TextAsset, Texure2D, AssetBundle, binary resources)

- Protection of variables from detection and modification on memory

(ProtectedInt, ProtectedLong, ProtectedBool, ProtectedFloat, ProtectedString, ProtectedBuffer and others ..);

- Hiding and protecting variables specified in the inspector;

- Data protection used through PlayerPrefs from viewing and modification;

- PlayerPrefs editor;

 

=============================================================

\Assets\DevXUnity\AntiCheatTools\ProtectedTypes\*.cs

classes

- ProtectedBool

- ProtectedBuffer

- ProtectedByte

- ProtectedChar

- ProtectedFloat

- ProtectedInt

- ProtectedUInt

- ProtectedLong

- ProtectedString

- ProtectedVector2

- ProtectedVector3

Are intended for storage and work with variables in the mode protected from a chiteration.

These classes store the values of variables in memory in an encrypted form, while providing transparent access to their real values.

When working with protected variables in the inspector, the serialized data is stored in the resources in an encrypted form.

 

\Assets\DevXUnity\AntiCheatTools\PlayerPrefsProtected.cs

Class PlayerPrefsProtected - implements the mechanism of working with PlayerPrefs in protected mode, providing hiding the real name of the variable and encryption of the actual value of the field

=============================================================

 

 

 

=============================================================

- Example of embedding the mechanism of encryption of resources

 

\Assets\DevXUnity\AssetEncryption\DecryptTools.cs

Class DecryptTools is an auxiliary class for data encryption

Basic methods

static string _DefaultEncryptPassword - Stores the default password

internal static bool IsEncrypted(string value) - Check if the file is encrypted

internal static byte[] DecryptBytes(string value, string password) - Decrypts binary data

internal static string DecryptString(string value, string password) - Decrypts string data

 

 

\Assets\DevXUnity\AssetEncryption\ResourcesDecrypt.cs

Class ResourcesDecrypt implement methods for obtaining encrypted resources

Basic methods

internal static string LoadEncryptedResourceText(string resource_name, string key) - Load encrypted resource text asset

internal static byte[] LoadEncryptedResourceBinary(string resource_name, string key) - Load encrypted resource binary data

internal static Texture2D LoadEncryptedResourceTexture(string resource_name, string key) - Load encrypted texure

internal static Texture2D LoadEncryptedResourceTextureEx(string resource_name, string key, int width, int height, TextureFormat format, bool mipmap, bool linear) - Load encrypted texure (for raw image)

internal static AssetBundle LoadEncryptedResourceAssetBundle(string resource_name, string key) - Load encrypted bundles (AssetBundle)

internal static UnityEngine.Object LoadEncryptedResourceAssetObject(string resource_name, string key) - Load asset from encrypted bundles (AssetBundle)

=============================================================

 

 

=============================================================

- Visual interface for the operation of resource encryption

\Assets\DevXUnity\AssetEncryption\Editor\CryptoTools.cs

Class CryptoTools is an auxiliary class implementing the encryption mechanisms

Basic methods

internal static bool IsFileEncrypted(string file_name) - Verify: is file encrypted

internal static string EncryptBytes(byte[] value, string password, string meta_data = null) - Encrypt bytes buffer with password

internal static string EncryptString(string value, string password, string meta_data = null) - Encrypt string with password

internal static byte[] DecryptBytes(string value, string password) - Decrypt bytes

internal static string DecryptString(string value, string password) - Decrypt string

 

\Assets\DevXUnity\AssetEncryption\Editor\ResourcesEncrypt.cs

Basic methods

internal static void Encrypt(string asset_name, string password, bool image_as_source_file=false) - Encrypt asset resource

internal static void Decrypt(string encrypted_asset_name, string asset_name, string password) - Decrypt asset

internal static List<AssetEncrypt> GetAllAssets() - Get all resources assets

 

\Assets\DevXUnity\AssetEncryption\Editor\ResourcesEncryptUI.cs

The ResourcesEncryptUI class implements a visual interface for encrypting resources

Basic methods

internal static void AssetEncryptionShow() - Show Encryption manager Tab page

void OnGUI() - Main GUI

=============================================================

 


 

 

 
11.07.2017