def testHmac(self): _SALT = b"diopioahpqu788guahoivanio" import hmac h = hmac.new(_SALT) h.update(hex(uuid._windll_getnode())) hex_digest = h.hexdigest() self.assertIsInstance(hex_digest, str) self.assertEqual(len(hex_digest), 32) assert isinstance(hex_digest, str) from re import match m = match("^[0-9a-f]+$", hex_digest) self.assertIsNotNone(m) m = match("^[xyz]+$", hex_digest) self.assertIsNone(m) binary_digest = h.digest() assert isinstance(binary_digest, str) assert len(binary_digest) == 16
def test_windll_getnode(self): node = uuid._windll_getnode() self.check_node(node)
"installed"]["auth_provider_x509_cert_url"] token_uri = CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"]["token_uri"] class GoogleOAuth2Credentials(object): def __init__(self, credential_dict_given_by_google=None): if credential_dict_given_by_google is None: pass #TODO SALT = b"diopioahpqu788guahoivanio" if __name__ == "__main__": import hmac h = hmac.new(SALT) h.update(hex(uuid._windll_getnode())) print(h.hexdigest()) #for x in CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"].iteritems(): # print(x) import slowaes moo = slowaes.AESModeOfOperation() cleartext = "This is a test!" cypherkey = [ 143, 194, 34, 208, 145, 203, 230, 143, 177, 246, 97, 206, 145, 92, 255, 84 ] iv = [ 103, 35, 148, 239, 76, 213, 47, 118, 255, 222, 123, 176, 106, 134, 98, 92 ] mode, orig_len, ciph = moo.encrypt(cleartext, moo.modeOfOperation["CBC"],
def test_windll_getnode(self): self.check_node(uuid._windll_getnode(), 'windll')
def test_windll_getnode(self): import os if importable('ctypes') and os.name == 'nt': self.check_node(uuid._windll_getnode(), 'windll')
def setKeyByMacAddress(self, salt=b"9)'87qugaoiuqwk~a+>&uq9fao$#1"): import hmac h = hmac.new(salt) h.update(hex(uuid._windll_getnode())) self._key = bytearray(h.digest()) assert len(self._key) == 16
client_secret = CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"]["client_secret"] auth_provider_x509_cert_url = CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"]["auth_provider_x509_cert_url"] token_uri = CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"]["token_uri"] class GoogleOAuth2Credentials(object): def __init__(self, credential_dict_given_by_google = None): if credential_dict_given_by_google is None: pass #TODO SALT = b"diopioahpqu788guahoivanio" if __name__ == "__main__": import hmac h = hmac.new(SALT) h.update(hex(uuid._windll_getnode())) print (h.hexdigest()) #for x in CLIENT_ID_FOR_INSTALLED_APPLICATIONS["installed"].iteritems(): # print(x) import slowaes moo = slowaes.AESModeOfOperation() cleartext = "This is a test!" cypherkey = [143,194,34,208,145,203,230,143,177,246,97,206,145,92,255,84] iv = [103,35,148,239,76,213,47,118,255,222,123,176,106,134,98,92] mode, orig_len, ciph = moo.encrypt(cleartext, moo.modeOfOperation["CBC"], cypherkey, moo.aes.keySize["SIZE_128"], iv) print ('m=%s, ol=%s (%s), ciph=%s' % (mode, orig_len, len(cleartext), ciph)) decr = moo.decrypt(ciph, orig_len, mode, cypherkey, moo.aes.keySize["SIZE_128"], iv) print (decr)
import uuid if __name__ == "__main__": try: print("netbios", hex(uuid._netbios_getnode())) except ImportError: pass print("windll", hex(uuid._windll_getnode())) #print(hex(uuid._random_getnode())) print("ipconfig", hex(uuid._ipconfig_getnode()))
def update_event(self, inp=-1): self.set_output_val(0, uuid._windll_getnode())