Unity3d資料加密

2021-09-07 11:52:03 字數 920 閱讀 5859

在unity中能夠使用c#自帶的對稱演算法對資料進行加密,以下兩種加密演算法:

using system;

using system.text;

using system.security.cryptography;

using system.io;

using unityengine;

public class stringencryption;

/// /// des加密字串

///

/// 待加密的字串

/// 加密金鑰,要求為8位

/// 加密成功返回加密後的字串,失敗返回源串

public static string encryptdes(string encryptstring, string encryptkey)

catch

}/// /// des解密字串

///

/// 待解密的字串

/// 解密金鑰,要求為8位,和加密金鑰同樣

/// 解密成功返回解密後的字串,失敗返源串

public static string decryptdes(string decryptstring, string decryptkey)

catch

}#endregion

#region md5不可逆加密

//32位加密

public string ge***5_32(string s, string _input_charset)

return sb.tostring();

} //16位加密

public static string ge***5_16(string convertstring)

#endregion

}

Unity 3d指令碼加密方案

unity 3d專案遊戲邏輯採用c 指令碼,我們知道c 編譯生成的dll或exe是il程式集。il程式集中有乙個metadata,記錄了程式集中的一切資訊,所以容易被反編譯。傳統的防破解方式是是對il程式集進行混淆或者加殼。但是這種混淆基本上只是做一些名稱混淆或流程混淆或者加一些打花指令。這種混淆或...

Unity3D內容加密保護

僅管資源 assets 在傳輸時可使用加密進行保護,但在資料流入客戶手中後。其內容就有可能被獲取。比如,有工具可記錄驅動程式級別上的 3d 資料,同意使用者提取傳送至 gpu 的模型和紋理。因此,我們通常希望在使用者決定提取資源時。可以滿足其要求。當然,假設您須要。也能夠對資源包 assetbund...

Unity3D開發(九) Unity3d流光效果

遊戲開 壇 hello game 遊戲開發群 201276069 之前曾經注意過material 中紋理的屬性都有 tiling 和offset 但沒有深究過其用途,今天才知道竟然可以利用 offset做uv 動畫,從而完成各種有趣的動畫,比如流光效果!流過效果即通常一條高光光在物體上劃過,模擬高光...