public bool Invalid_hash_cannot_be_verified(ISecureHashProvider provider) { var hash = provider.Password(Encoding.UTF8.GetBytes(Password)); var result = provider.PasswordVerify(Encoding.UTF8.GetBytes("rosebowl"), hash); return(result == VerifyHashResult.Invalid); }
public bool Hash_can_be_verified(ISecureHashProvider provider) { var hash = provider.Password(Encoding.UTF8.GetBytes(Password)); var result = provider.PasswordVerify(Encoding.UTF8.GetBytes(Password), hash); return(result == VerifyHashResult.Valid); }
public bool Same_input_produces_different_hash(ISecureHashProvider provider) { var bytes = Encoding.UTF8.GetBytes(Password); var left = provider.Password(bytes); // ARGON2 w/ built-in salt var right = provider.Password(bytes); return(!left.SequenceEqual(right)); }
public bool Different_input_produces_different_hash(ISecureHashProvider provider) { var leftBytes = Encoding.UTF8.GetBytes(Password); var rightBytes = Encoding.UTF8.GetBytes("rosebowl"); var left = provider.Password(leftBytes); var right = provider.Password(rightBytes); return(!left.SequenceEqual(right)); }
public AuthenticationMessageHandler(ILogger <AuthenticationMessageHandler> logger, IAuthenticationSynchronizationContextService authenticationSynchronizationContextService, IUnitOfWorkFactory unitOfWorkFactory, ISecureHashProvider secureHashProvider, ICharacterEquipmentBuilder characterEquipmentBuilder) { _logger = logger; _authenticationSynchronizationContextService = authenticationSynchronizationContextService; _unitOfWorkFactory = unitOfWorkFactory; _secureHashProvider = secureHashProvider; _characterEquipmentBuilder = characterEquipmentBuilder; }
public PasswordHasher(ISecureHashProvider secureHashProvider) { _secureHashProvider = secureHashProvider; }
public LoginSeed(ISecureHashProvider secureHashProvider) { _secureHashProvider = secureHashProvider; }