docs: def _get_exchange_key_ntlm_v1(negotiate_flags, session_base_key, server_challenge, lm_challenge_response, lm_hash):
      """
      [MS-NLMP] v28.0 2016-07-14
  
      4.3.5.1 KXKEY
      Calculates the Key Exchange Key for NTLMv1 authentication. Used for signing and sealing messages
  
      @param negotiate_flags:
      @param session_base_key: A session key calculated from the user password challenge
      @param server_challenge: A random 8-byte response generated by the server in the CHALLENGE_MESSAGE
      @param lm_challenge_response: The LmChallengeResponse value computed in ComputeResponse
      @param lm_hash: The LMOWF computed in Compute Response
      @return key_exchange_key: The Key Exchange Key (KXKEY) used to sign and seal messages and compute the ExportedSessionKey
      """
      if negotiate_flags & NegotiateFlags.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:
          key_exchange_key = hmac.new(session_base_key, server_challenge + lm_challenge_response[:8]).digest()
      elif negotiate_flags & NegotiateFlags.NTLMSSP_NEGOTIATE_LM_KEY:
          des_handler = des.DES(lm_hash[:7])
          first_des = des_handler.encrypt(lm_challenge_response[:8])
          des_handler = des.DES(lm_hash[7:8] + binascii.unhexlify('bdbdbdbdbdbdbd'))
          second_des = des_handler.encrypt(lm_challenge_response[:8])
  
          key_exchange_key = first_des + second_des
      elif negotiate_flags & NegotiateFlags.NTLMSSP_REQUEST_NON_NT_SESSION_KEY:
          key_exchange_key = lm_hash[:8] + b'\0' * 8
      else:
          key_exchange_key = session_base_key
  
      return key_exchange_key