code: def _calc_resp(password_hash, server_challenge):
          
          # padding with zeros to make the hash 21 bytes long
          password_hash += b'\x00' * (21 - len(password_hash))
  
          res = b''
          dobj = DES(DES.key56_to_key64(password_hash[0:7]))
          res = res + dobj.encrypt(server_challenge[0:8])
  
          dobj = DES(DES.key56_to_key64(password_hash[7:14]))
          res = res + dobj.encrypt(server_challenge[0:8])
  
          dobj = DES(DES.key56_to_key64(password_hash[14:21]))
          res = res + dobj.encrypt(server_challenge[0:8])
          return res
docs: Generate the LM response given a 16-byte password hash and the
          challenge from the CHALLENGE_MESSAGE
  
          :param password_hash: A 16-byte password hash
          :param server_challenge: A random 8-byte response generated by the
              server in the CHALLENGE_MESSAGE
          :return res: A 24-byte buffer to contain the LM response upon return