ntlm library

This is a library for NTLM authentication in Dart/Flutter.

NTLM authentication is based on messages being sent to and from the server in HTTP headers. These messages contain the username and hashed versions of the password along with some other information.

import 'package:ntlm/ntlm.dart';

main() {
  NTLMClient client = new NTLMClient(
    domain: "",
    workstation: "LAPTOP",
    username: "User208",
    password: "password",
  );

  client.get("https://example.com/").then((res) {
    print(res.body);
  });
}

Classes

NTLMClient
Type2Message
Data class for all information contained in the type 2 response.

Constants

kHeaderPrefixNegotiate → const String
kHeaderPrefixNTLM → const String

Functions

createType1Message({String domain = '', String workstation = '', String headerPrefix = kHeaderPrefixNTLM}) String
Creates a type 1 NTLM message from the domain and workstation
createType3Message(Type2Message msg2, {String domain = '', String workstation = '', required String username, String? password, String? lmPassword, String? ntPassword, String headerPrefix = kHeaderPrefixNTLM}) String
Creates a type 3 NTLM message based on the response in msg2.
lmHash(String password) String
Generates the base 64 lan manager hash corresponding to the password.
ntHash(String password) String
Generates the base 64 NT hash corresponding to the password.
parseType2Message(String rawMsg, {String headerPrefix = kHeaderPrefixNTLM}) Type2Message
Extract the information from the type 2 rawMsg into an object.