using System.Security.Cryptography;
public static void Main()
Console.WriteLine(Encrypt(token));
public static string Encrypt(string text)
using (Aes cipher = CreateCipher())
ICryptoTransform cryptTransform = cipher.CreateEncryptor();
byte[] plaintext = Encoding.UTF8.GetBytes(text);
byte[] cipherText = cryptTransform.TransformFinalBlock(plaintext, 0, plaintext.Length);
return Convert.ToBase64String(cipherText);
private static Aes CreateCipher()
Aes cipher = Aes.Create();
cipher.Mode = CipherMode.CBC;
cipher.Padding = PaddingMode.ISO10126;
cipher.Key = Encoding.UTF8.GetBytes("4OArLrKY7WCZKWrDnWZkR8eYeSzFJrkJ");;
cipher.IV = Encoding.UTF8.GetBytes("KsQFeW5cxn080808");;