using System.Security.Cryptography;
private const int Keysize = 256;
private const int DerivationIterations = 1000;
private const string PassPhrase = "3ncrypted#!ims!$p@ss";
public static void Main()
string cipherText = "1GwTYITIW9lZp08/gDXqw4JSD2Zx1PfC2uxYu+zm8lnWzZreH6FUmyiieh2AhqTeQ65cRO8/a/oYMjwNvtB88at0voPNHebpBlWN99sPTFodFjEd5KpWKFrhrj7xBH+e";
var cipherTextBytesWithSaltAndIv = Convert.FromBase64String(cipherText);
var saltStringBytes = cipherTextBytesWithSaltAndIv.Take(Keysize / 8).ToArray();
var ivStringBytes = cipherTextBytesWithSaltAndIv.Skip(Keysize / 8).Take(Keysize / 8).ToArray();
var cipherTextBytes = cipherTextBytesWithSaltAndIv.Skip((Keysize / 8) * 2).Take(cipherTextBytesWithSaltAndIv.Length - ((Keysize / 8) * 2)).ToArray();
using (var password = new Rfc2898DeriveBytes(PassPhrase, saltStringBytes, DerivationIterations))
var keyBytes = password.GetBytes(Keysize / 8);
using (var symmetricKey = new RijndaelManaged())
symmetricKey.BlockSize = 256;
symmetricKey.Mode = CipherMode.CBC;
symmetricKey.Padding = PaddingMode.PKCS7;
using (var decryptor = symmetricKey.CreateDecryptor(keyBytes, ivStringBytes))
using (var memoryStream = new MemoryStream(cipherTextBytes))
using (var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
var plainTextBytes = new byte[cipherTextBytes.Length];
var decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
Console.Write(Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount));