Answers for "BCrypt c#"

C#
0

BCrypt c#

// Como criar uma chave para uma string criptografada

using BCrypt.Net;

public class Hashing  
{
    private static string GetRandomSalt()
    {
        return BCrypt.GenerateSalt(12);
    }

    public static string HashPassword(string password)
    {
        return BCrypt.HashPassword(password, GetRandomSalt());
    }

    public static bool ValidatePassword(string password, string correctHash)
    {
        return BCrypt.Verify(password, correctHash);
    }
}
Posted by: Guest on April-27-2020

C# Answers by Framework

Browse Popular Code Answers by Language