#!/usr/bin/python
# encoding: utf-8

# osstech.ntlm.NTLMpass: store NTLM password 
# (C) TAKEDA Yasuma @ Open Source Solution Technology Inc.
#
# License: GNU General Public License version 2 or later
# Date: 2008-08-07, since 2008-08-07

import ntlm_procs
from struct import *

class NTLMpass:
    def __init__(self):
        self.lmhash = ""
        self.nthash = ""

    def set_pass(self, passwd):
        self.lmhash= "%X%X%X%X" % unpack('!4L',ntlm_procs.create_LM_hashed_password(passwd))
        self.nthash= "%X%X%X%X" % unpack('!4L',ntlm_procs.create_NT_hashed_password(passwd))

