using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;
using System.Security.Cryptography;
public static void Main()
Console.WriteLine(MWEncryptDecrypt.Encrypt("put your plain password here"));
public static class MWEncryptDecrypt
private static readonly string encryptionMode = "AES/OFB/PKCS5PADDING";
private static readonly string algorithm = "AES";
public static string Encrypt(string data, string password ="RhA0IkUSSUkI0AhROxAjMCNEENCMjAxO")
byte[] inputBytes = ASCIIEncoding.UTF8.GetBytes(data);
byte[] keyBytes = ASCIIEncoding.UTF8.GetBytes(password);
IBufferedCipher cipher = CipherUtilities.GetCipher(encryptionMode);
cipher.Init(true, new ParametersWithIV(ParameterUtilities.CreateKeyParameter(algorithm, keyBytes), new byte[16]));
byte[] encryptedBytes = cipher.DoFinal(inputBytes);
string base64EncryptedOutputString = Convert.ToBase64String(encryptedBytes);
return base64EncryptedOutputString;