public static string EncodePassword(string passwordInClearText)
{
if (string.IsNullOrEmpty(passwordInClearText))
return String.Empty;
byte[] data = System.Text.Encoding.UTF8.GetBytes(passwordInClearText);
using (System.Security.Cryptography.HashAlgorithm sha256 = new System.Security.Cryptography.SHA256Managed())
{
byte[] encryptedBytes = sha256.TransformFinalBlock(data, 0, data.Length);
return Convert.ToBase64String(sha256.Hash);
}
}