using System.Security.Cryptography;
public static void Main()
Console.WriteLine("************************************************************************************************");
string encryptedvalue = Encriptar("ONEBANK|15459FA7-86F7-46C2-B7C9-B9E812C9144D");
Console.WriteLine(" Encrypted Text : " + encryptedvalue);
Console.WriteLine("************************************************************************************************");
public static string Encriptar(string plainText)
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
string PasswordHash = "392664C0-8548-4FC3-B0AA-E01FAA9CB518392664C0-85488548-4FC3392664C0-8548-4FC3-B0AA-E01FAA9CB518392664C0-85488548-4FC3";
string SaltKey = "2664C0ASDGASDGASDGASDGASDGAS8542664C0ASDGASDGASDGASDGASDGAS854";
string VIKey = "@1BAc3DEeGF6g1H2";
byte[] keyBytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(256 / 8);
var symmetricKey = new RijndaelManaged() { Mode = CipherMode.CBC, Padding = PaddingMode.Zeros };
var encryptor = symmetricKey.CreateEncryptor(keyBytes, Encoding.ASCII.GetBytes(VIKey));
using (var memoryStream = new MemoryStream())
using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
cryptoStream.FlushFinalBlock();
cipherTextBytes = memoryStream.ToArray();
return Convert.ToBase64String(cipherTextBytes);