protected static void SecurityAesDecrypt(BlamVersion game, Blam.CacheSectionType section_type, byte[] input, out byte[] output, GetAesParametersProc GetAesParameters) { output = null; using (var aesm = new Crypt.AesManaged()) { aesm.KeySize = 128; aesm.Padding = Crypt.PaddingMode.Zeros; aesm.Mode = Crypt.CipherMode.CBC; byte[] key, iv; GetAesParameters(game, section_type, out key, out iv); if (key != null && iv != null) using (var ctx = aesm.CreateDecryptor(key, iv)) { output = ctx.TransformFinalBlock(input, 0, input.Length); } } }
protected static void SecurityAesDecrypt(BlamVersion game, Blam.CacheSectionType section_type, byte[] input, out byte[] output, GetAesParametersProc GetAesParameters) { output = null; using (var aesm = new Crypt.AesManaged()) { aesm.KeySize = 128; aesm.Padding = Crypt.PaddingMode.Zeros; aesm.Mode = Crypt.CipherMode.CBC; byte[] key, iv; GetAesParameters(game, section_type, out key, out iv); if (key != null && iv != null) { using (var ctx = aesm.CreateDecryptor(key, iv)) { output = ctx.TransformFinalBlock(input, 0, input.Length); } } } }