Here is an how to use symmetric-key encryption in C#.

string password = "Password";

// Rijndael algoritm also known as AES
RijndaelManaged rijndael = new RijndaelManaged();
// Salt value used to obscure a code
byte[] salt = Encoding.ASCII.GetBytes("To jest sól");

Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(password, salt);

// the generated key
rijndael.Key = key.GetBytes(rijndael.KeySize / 8);
// inicjalization vector
rijndael.IV = key.GetBytes(rijndael.BlockSize / 8);

Encryption and decryption a file example:

// must be generated in same way in decryption and encryption
SymmetricAlgorithm rijandel = new RijndaelManaged();
// acctualy below line it is not nessesary
rijandel.GenerateKey(); 

const string encryptedFileName = @"message.enc";
{
    FileStream inputFile = new FileStream(@"message.txt", FileMode.Open, FileAccess.Read);
    FileStream encryptedFile = new FileStream(encryptedFileName, FileMode.OpenOrCreate, FileAccess.Write);

    byte[] fileData = new byte[inputFile.Length];
    inputFile.Read(fileData, 0, (int)inputFile.Length);

    ICryptoTransform encryptor = rijandel.CreateEncryptor();

    CryptoStream encryptorStream = new CryptoStream(encryptedFile, encryptor, CryptoStreamMode.Write);
    encryptorStream.Write(fileData, 0, fileData.Length);
    encryptorStream.Close();
    encryptedFile.Close();
    inputFile.Close();
}
{
    FileStream encryptedFile = new FileStream(encryptedFileName, FileMode.Open, FileAccess.Read);
    FileStream decryptedFile = new FileStream(@"messageDecrypted.txt", FileMode.OpenOrCreate, FileAccess.Write);

    ICryptoTransform decryptor = rijandel.CreateDecryptor();

    CryptoStream decryptedStream = new CryptoStream(encryptedFile, decryptor, CryptoStreamMode.Read);

    StreamReader encrypted = new StreamReader(decryptedStream);
    string decryptedText = encrypted.ReadToEnd();

    StreamWriter decrypted = new StreamWriter(decryptedFile);
    decrypted.Write(decryptedText);

    decryptedStream.Close();
    decrypted.Close();
    decryptedFile.Close();
    encryptedFile.Close();
}

Cryptography AES C# code