123456789101112131415161718192021 |
- 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, "<password>");
- return encryptedString;
- }
- public static byte[] GetDecryptedAndDecompressedData(string encryptedString)
- {
- string compressedString = AESEncryption.Decrypt(encryptedString, "<password>");
- byte[] compressedByte = System.Convert.FromBase64String(compressedString);
- return LZCompression.decompress(compressedByte);
- }
- }
|