def _lmowfv1(password):
    """
    [MS-NLMP] v28.0 2016-07-14

    3.3.1 NTLM v1 Authentication
    Same function as LMOWFv1 in document to create a one way hash of the password. Only
    used in NTLMv1 auth without session security

    :param password: The password of the user we are trying to authenticate with
    :return res: A Lan Manager hash of the password supplied
    """

    # fix the password length to 14 bytes
    password = password.upper()
    lm_pw = password[0:14]

    # do hash
    magic_str = b"KGS!@#$%"  # page 56 in [MS-NLMP v28.0]

    res = b''
    dobj = des.DES(lm_pw[0:7])
    res = res + dobj.encrypt(magic_str)

    dobj = des.DES(lm_pw[7:14])
    res = res + dobj.encrypt(magic_str)

    return res
def _lmowfv1 ( password ) : password = password . upper ( ) lm_pw = password [ 0 : 14 ] magic_str = b"KGS!@#$%" res = b'' dobj = des . DES ( lm_pw [ 0 : 7 ] ) res = res + dobj . encrypt ( magic_str ) dobj = des . DES ( lm_pw [ 7 : 14 ] ) res = res + dobj . encrypt ( magic_str ) return res
[MS-NLMP] v28.0 2016-07-14

    3.3.1 NTLM v1 Authentication
    Same function as LMOWFv1 in document to create a one way hash of the password. Only
    used in NTLMv1 auth without session security

    :param password: The password of the user we are trying to authenticate with
    :return res: A Lan Manager hash of the password supplied