skillfed

ntlm-auth

Creates NTLM authentication structures

ntlm-auth v1.5.0 1.1M downloads/30d#4,312 on PyPI54
Permissive license MIT Abandoned released

What it is and what it does

ntlm-auth is a low-level library that handles the cryptographic and message-parsing details of NTLM (NT LAN Manager) authentication, a Windows-based authentication protocol used by some enterprise HTTP services. It constructs the three-message NTLM handshake, encodes them as base64 for HTTP headers, and can optionally sign and seal message content for integrity and confidentiality. It supports multiple NTLM variants (LM, NTLMv1, NTLMv2) and extended session security, plus channel binding tokens for additional security.

The library is designed as a building block rather than a user-facing tool. The documentation explicitly recommends that most users install requests-ntlm instead, which provides a simpler interface for HTTP authentication. Direct use of ntlm-auth requires manual message exchange with a server and careful handling of the authentication state machine. The package depends only on ordereddict, keeping installation friction minimal.

Use it for:

  • Authenticate HTTP requests to legacy Windows/Active Directory services that require NTLM when requests-ntlm is unavailable
  • Implement custom NTLM authentication in a non-HTTP protocol or specialized client where a standard wrapper does not fit
  • Sign and seal message content for integrity and confidentiality in NTLM-protected communication channels
  • Integrate NTLM support into a proxy, gateway, or middleware that cannot use requests-ntlm directly

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Constructs and parses NTLM authentication messages (LM, NTLMv1, NTLMv2) for HTTP authentication, handling message signing and sealing with support for channel binding tokens.

No—not for new projects. The package is abandoned (last release June 2020, last commit July 2020) and most users should use requests-ntlm instead, which provides the same NTLM support with a simpler API. Install only if you have an existing codebase already using ntlm-auth and cannot migrate, or if you need direct low-level NTLM message construction for a non-HTTP use case and accept the maintenance risk.

Install

ntlm-auth on PyPI

pip

pip install ntlm-auth

uv

uv add ntlm-auth

poetry

poetry add ntlm-auth

Installing ntlm-auth

Before you install

Low install friction with a single pure-Python dependency (ordereddict). However, the package is abandoned—last commit was 2020-07-07 and no releases since 2020-06-16. Most users should prefer requests-ntlm, which wraps this library with a higher-level interface.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from ntlm_auth.ntlm import NtlmContext

ntlm_context = NtlmContext('username', 'password', 'domain', ntlm_compatibility=3)
negotiate_message = ntlm_context.step()
# Send negotiate_message in HTTP header, receive challenge
authenticate_message = ntlm_context.step(challenge_response)

Requires Python 2.6+ or 3.4+; ordereddict dependency for older Python versions. Direct use is low-level; requests-ntlm is the recommended wrapper for HTTP clients.

Verify before relying

  • Whether the package works reliably with modern Windows Server authentication in production environments post-2020
  • Current compatibility with Python 3.8+ given the last release predates those versions
  • Whether signing/sealing with RC4 meets current security requirements for your use case

Package facts

License MIT (permissive)
Python support supports the current Python release (>=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*)
Install friction low — pure-Python wheel
Runtime dependencies 1 — ordereddict
Maintenance abandoned — 2,250 days since the last release
Last repo commit
First released
Downloads 1,135,075/month — #4,312 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ntlm_auth-1.5.0-py2.py3-none-any.whl

Keywords: authentication, auth, microsoft, ntlm, lm

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

ntlm authenticationhttp ntlm authwindows authenticationmessage signing sealingntlmv2 protocolchannel binding tokenslm authentication
authenticationwindows-legacyabandoned

More Security packages