//here password is input from user and it is in byte array. PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, // Change this //hjiweykaksd new byte[] { 0x43, 0x87, 0x23, 0x72 }); // Change this MemoryStream ms = new MemoryStream(); Aes aes = new AesManaged(); aes.Key = pdb.GetBytes(aes.KeySize / 8); aes.IV = pdb.GetBytes(aes.BlockSize / 8); CryptoStream cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write); cs.Write(input, 0, input.Length); cs.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)