BCrypt
BCrypt 只能單向加密! 不能反向解密!
應用
using BCryptHelper = BCrypt.Net.BCrypt;
public class Cryptography
{
public static string Hash(string Text, out string Salt)
{
Salt = BCryptHelper.GenerateSalt();
return BCryptHelper.HashPassword(Text, Salt);
}
public static bool VerifyHash(string Text, string HashedText)
{
return BCryptHelper.Verify(Text, HashedText);
}
}Last updated