using UnityEngine; using System.Collections; public class EncryptDecrypt { public static string GetCompressedAndEncryptedData(byte[] data) { byte[] compressedBytes = LZCompression.compress(data, 3); string compressedString = System.Convert.ToBase64String(compressedBytes); string encryptedString = AESEncryption.Encrypt(compressedString, ""); return encryptedString; } public static byte[] GetDecryptedAndDecompressedData(string encryptedString) { string compressedString = AESEncryption.Decrypt(encryptedString, ""); byte[] compressedByte = System.Convert.FromBase64String(compressedString); return LZCompression.decompress(compressedByte); } }