using System.Security.Cryptography;
private string encryptString(string strToEncrypt)
{
UTF8Encoding ue = new UTF8Encoding();
byte[] bytes = ue.GetBytes(strToEncrypt);

MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] hashBytes = md5.ComputeHash(bytes);

// Bytes to string
return System.Text.RegularExpressions.Regex.Replace
(BitConverter.ToString(hashBytes), "-", "").ToLower();
}
یک مثال ساده از نحوه ی استفاده :
MessageBox.Show(encryptString("Sinpin"));
خروجی :
e140088b10c4f19588ed3624e2b3c463