private boolean checkPasswordMatching(String password, UserData userData)
    {
        boolean matching = false;

        try
        {
            String saltedPassword = password + userData.getSalt();

            MessageDigest md = MessageDigest.getInstance(mdAlgorithm);
            md.update(saltedPassword.getBytes());

            byte byteData[] = md.digest();

            String userPassword = StringUtil.convertToHex(byteData);
            if (userPassword.equalsIgnoreCase(userData.getPassword()))
            {
                if (debug)
                {
                    LOG.debug("Passwords are equal, user authenticated");
                }

                matching = true;
            }

        }
        catch (NoSuchAlgorithmException ex)
        {
            LOG.error(mdAlgorithm + " not available, unable to check passwords", ex);
        }

        return matching;
    }