public PasswordEncryptionContext EncryptPassword(string password) { string salt = GetCurrentSalt(); var request = new PasswordEncryptionContext(password, salt); return(EncryptPassword(request)); }
private PasswordEncryptionContext EncryptPassword(PasswordEncryptionContext request) { string val = _encryptor.HashAndShift( request.EncryptedPassword, request.Salt, AppConfig.Current.Encryption.ShiftDirection, AppConfig.Current.Encryption.ShiftFactor, AppConfig.Current.Encryption.ShiftOffset, true ); return(new PasswordEncryptionContext(val, request.Salt)); }
public bool Verify(PasswordEncryptionContext request, string hash) { return(EncryptPassword(request).EncryptedPassword.Equals(hash)); }