using System.Security.Cryptography;
public static void Main() {
string cipherTextValue = "";
byte[] clearBytes = Encoding.Unicode.GetBytes("karthickkumarm@virtusa.com");
using (Aes encryptor = Aes.Create())
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes("11E2A2C0-C29B-447A-B371-A7F0A3A2B2B5", new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
cs.Write(clearBytes, 0, clearBytes.Length);
cipherTextValue = Convert.ToBase64String(ms.ToArray());
Console.WriteLine(cipherTextValue);
cipherText = Convert.FromBase64String(cipherTextValue);
using (Aes encryptor = Aes.Create())
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes("11E2A2C0-C29B-447A-B371-A7F0A3A2B2B5", new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
cs.Write(cipherText, 0, cipherText.Length);
Console.WriteLine(Encoding.Unicode.GetString(ms.ToArray()));