/// <summary> /// Initialize the deserializer, consisting of the following stack: /// MemoryStream -> Crypto -> GZip /// </summary> /// <param name="stream"></param> /// <param name="key"></param> /// <param name="iv"></param> protected void InitializeDeserializer(Stream stream, byte[] key, byte[] iv) { DecryptTransformer dt = new DecryptTransformer(EncryptionAlgorithm.Rijndael); dt.IV = iv; ICryptoTransform ict = dt.GetCryptoServiceProvider(key); decStream = new CryptoStream(stream, ict, CryptoStreamMode.Read); decomp = new GZipStream(decStream, CompressionMode.Decompress); deserializer = new RawDeserializer(decomp); }
public Decryptor(EncryptionAlgorithm algId) { transformer = new DecryptTransformer(algId); }