using System.Security.Cryptography;
public static void Main()
var secretValue = "secrectKey";
byte[] encryptedvalue = GenerateKey(secretValue);
string ba = BitConverter.ToString(encryptedvalue).Replace("-"," ");
private static byte[] GenerateKey(string strPassword)
return Array.Empty<byte>();
var rfc2898 = new Rfc2898DeriveBytes(strPassword, salt: Encoding.UTF8.GetBytes(strPassword));
return rfc2898.GetBytes(128 / 8);