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

# 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 ByteToHex(self, byteStr):
        return ''.join( [ "%02X" % ord( x ) for x in byteStr ] )

    def createLMHashPassword(self, passwd):
        return self.ByteToHex(ntlm_procs.create_LM_hashed_password(passwd))
        
    def createNTHashPassword(self, passwd):
        return self.ByteToHex(ntlm_procs.create_NT_hashed_password(passwd))
