0
What library do i use to encrypt (with des, aes and md5) in .netcore?
Hello! I am trying to encrypt some data in C# in .NetCore but i do not have the right libraries. I can't find them. Can you please tell me some, if i want to use AES, MD5, and DES encryptions?
1 Odpowiedź
0
using System.Security.Cryptography;
using System.Text;
string Encrypt(string password)
{
MD5CryptoServiceProvider a = new MD5CryptoServiceProvider();
a.ComputeHash(Encoding.ASCII.GetBytes(password));
var result = a.Hash;
var strBuilder = new StringBuilder();
for (int i = 0; i < result.Length; i++)
strBuilder.Append(result[i].ToString("x2"));
return strBuilder.ToString();
}