CSPspEmu.Core.Crypto.Kirk.EncryptAes C# (CSharp) Method

EncryptAes() public static method

public static EncryptAes ( byte Input, byte Key, byte IV = null ) : byte[]
Input byte
Key byte
IV byte
return byte[]
        public static byte[] EncryptAes(byte[] Input, byte[] Key, byte[] IV = null)
        {
            if (IV == null) IV = new byte[16];

            using (var AES = Aes.Create())
            {
                AES.Padding = PaddingMode.Zeros;
                var Encryptor = AES.CreateEncryptor(Key, IV);

                return new CryptoStream(new MemoryStream(Input), Encryptor, CryptoStreamMode.Read).ReadAll(Dispose: true);
            }
        }