code: def _ntowfv2(user_name, password, domain_name):
      
      digest = _ntowfv1(password)
      user = (user_name.upper() + domain_name).encode('utf-16-le')
      digest = hmac.new(digest, user, digestmod=hashlib.md5).digest()
  
      return digest
docs: [MS-NLMP] v28.0 2016-07-14
  
      3.3.2 NTLM v2 Authentication
      Same function as NTOWFv2 (and LMOWFv2) in document to create a one way hash
      of the password. This combines some extra security features over the v1
      calculations used in NTLMv2 auth.
  
      :param user_name: The user name of the user we are trying to authenticate
          with
      :param password: The password of the user we are trying to authenticate
          with
      :param domain_name: The domain name of the user account we are
          authenticated with
      :return digest: An NT hash of the parameters supplied