def create_LM_hashed_password(passwd):
    "setup LanManager password"
    "create LanManager hashed password"

    lm_pw = '\000' * 14

    passwd = string.upper(passwd)

    if len(passwd) < 14:
        lm_pw = passwd + lm_pw[len(passwd) - 14:]
    else: lm_pw = passwd[0:14]

    # do hash

    magic_lst = [0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25]
    magic_str = ntlmutils.lst2str(magic_lst)

    res = ''
    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)

    # addig zeros to get 21 bytes string
    res = res + '\000\000\000\000\000'

    return res
Beispiel #2
0
 def __init__(self, key_str):
     ""
     k = str_to_key56(key_str)
     k = key56_to_key64(k)
     key_str = ntlmutils.lst2str(k)
     self.des_c_obj = des_c.DES(key_str)
Beispiel #3
0
 def __init__(self, key_str):
     ""
     k = str_to_key56(key_str)
     k = key56_to_key64(k)
     key_str = ntlmutils.lst2str(k)
     self.des_c_obj = des_c.DES(key_str)