protected string GenerateSalt(IPasswordSaltProvider saltProvider) { if (saltProvider == null) { return(string.Empty); } return(saltProvider.GetPasswordSalt()); }
public static string EncodePassword(string passwordInClearText, IPasswordSaltProvider saltProvider) { return(PasswordHashProvider.EncodePassword(passwordInClearText, saltProvider)); }
protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider) { return(EncodeRaw(text) == hash); }
protected override string Encode(string text, IPasswordSaltProvider saltProvider) { return(EncodeRaw(text)); }
protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider) { return(BCrypt.Verify(text + GenerateSalt(saltProvider), hash)); }
protected override string Encode(string text, IPasswordSaltProvider saltProvider) { return(BCrypt.HashPassword(text + GenerateSalt(saltProvider))); }
/// <summary> /// Implementation of the hash generator. Uses the saltProvider if there is. /// </summary> protected abstract string Encode(string text, IPasswordSaltProvider saltProvider);
/// <summary> /// Implementation of the checking of the password-hash match. Uses the saltProvider if there is. /// </summary> protected abstract bool Check(string text, string hash, IPasswordSaltProvider saltProvider);
/// <summary> /// Generates a hash from the given password with the saltProvider if there is. /// </summary> public static string EncodePassword(string passwordInClearText, IPasswordSaltProvider saltProvider) { return(Instance.Encode(passwordInClearText, saltProvider)); }
/// <summary> /// Checks the password by the given hash and saltProvider with the configured or default PasswordHashProvider. /// According to configuration does the migration too. /// </summary> public static bool CheckPassword(string passwordInClearText, string hash, IPasswordSaltProvider saltProvider) { return(Instance.Check(passwordInClearText, hash, saltProvider)); }
/// <summary> /// Checks the password by the given hash and saltProvider with the configured or default OutdatedPasswordHashProvider. /// </summary> public static bool CheckPasswordForMigration(string passwordInClearText, string hash, IPasswordSaltProvider saltProvider) { return(OutdatedInstance.Check(passwordInClearText, hash, saltProvider)); }
public override bool Check(string text, string hash, IPasswordSaltProvider saltProvider) { return(EncodeRaw(text + GenerateSalt(saltProvider)) == hash); }
public override string Encode(string text, IPasswordSaltProvider saltProvider) { return(EncodeRaw(text + GenerateSalt(saltProvider))); }
/// <summary> /// Implementation of the checking of the password-hash match. Uses the saltProvider if there is. /// </summary> public abstract bool Check(string text, string hash, IPasswordSaltProvider saltProvider);
/// <summary> /// Implementation of the hash generator. Uses the saltProvider if there is. /// </summary> public abstract string Encode(string text, IPasswordSaltProvider saltProvider);