JustPaste.it

void Start() {

// I creat the file data with encrypt AES with the JSON and password SystemInfo.deviceUniqueIdentifier
File.WriteAllText(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).ToString() + "\\LocalLow\\CardLife\\CardLife\\data", Encrypt("{\"lastLoggedPublicIdKey\":\"00000000-0000-0000-0000-000000000000\",\"lastLoggedDisplayName\":\"IGG-GAME\",\"lastLoggedUserFlags\":64,\"lastLoggedPurchases\":2}", SystemInfo.deviceUniqueIdentifier));
Application.Quit();
}

#region Decode AES

// Useless i have use it for get the JSON and edit this
public static string Decrypt(string cipherText, string passPhrase) {
byte[] array = Convert.FromBase64String(cipherText);
byte[] salt = array.Take(32).ToArray();
byte[] rgbIV = array.Skip(32).Take(32).ToArray();
byte[] array2 = array.Skip(64).Take(array.Length - 64).ToArray();
Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(passPhrase, salt, 1000);
byte[] bytes = rfc2898DeriveBytes.GetBytes(32);
RijndaelManaged rijndaelManaged = new RijndaelManaged {
BlockSize = 256,
Mode = CipherMode.CBC,
Padding = PaddingMode.PKCS7
};
ICryptoTransform transform = rijndaelManaged.CreateDecryptor(bytes, rgbIV);
MemoryStream memoryStream = new MemoryStream(array2);
CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read);
byte[] array3 = new byte[array2.Length];
int count = cryptoStream.Read(array3, 0, array3.Length);
memoryStream.Close();
cryptoStream.Close();
string reponse = Encoding.UTF8.GetString(array3, 0, array3.Length);
return reponse.Substring(string.Empty.Length);
}

// Function make the DATA for crack offline

public static string Encrypt(string unsaltedPlainText, string passPhrase) {
byte[] array = Generate256BitsOfRandomEntropy();
byte[] array2 = Generate256BitsOfRandomEntropy();
byte[] bytes = Encoding.UTF8.GetBytes(unsaltedPlainText);
Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(passPhrase, array, 1000);
byte[] bytes2 = rfc2898DeriveBytes.GetBytes(32);
RijndaelManaged rijndaelManaged = new RijndaelManaged {
BlockSize = 256,
Mode = CipherMode.CBC,
Padding = PaddingMode.PKCS7
};
ICryptoTransform transform = rijndaelManaged.CreateEncryptor(bytes2, array2);
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write);
cryptoStream.Write(bytes, 0, bytes.Length);
cryptoStream.FlushFinalBlock();
byte[] first = array;
first = first.Concat(array2).ToArray();
first = first.Concat(memoryStream.ToArray()).ToArray();
memoryStream.Close();
cryptoStream.Close();
return Convert.ToBase64String(first);
}

// Useless array for make Salt and IV

private static byte[] Generate256BitsOfRandomEntropy() {
byte[] array = new byte[32];
RNGCryptoServiceProvider rNGCryptoServiceProvider = new RNGCryptoServiceProvider();
rNGCryptoServiceProvider.GetBytes(array);
return array;
}
#endregion