import rsa, aesHmac, address, getpass, json ip, port = input('Enter ur ip/port: ').split('/') port = int(port) bits = int(input('How many bits long? ')) file_path = '{}\\{}.rsa.keys'.format(address.getId(ip, port)[0], bits) passphrase = getpass.getpass('Enter ur password: ') key = json.dumps([rsa.newKeys(bits)]) aesHmac.writeEncryptedFile(file_path, key, passphrase)
def getChainHashOfAddress(self, addr, port): return self.getChainHashOfId(address.getId(addr, port)[1])
import supersqlite as ssql, json, address DB_MANAGER = ssql.SSQLiteManager('public_details.db') TOTAL_VOTERS = DB_MANAGER.len('ELIGIBLE_VOTERS') t = DB_MANAGER.select('OFFICER_DETAILS') BLO_PUBLIC_KEY, BLO_ID = json.loads(t[0][0]), address.getId(t[0][1], t[0][2])[1] EXT_OFFICER_PUBLIC_KEY, EXT_OFFICER_ID = json.loads(t[1][0]), address.getId( t[1][1], t[1][2])[1] DB_MANAGER.close()
def getPublicKeyOfAddress(self, addr, port): id = address.getId(addr, port)[1] return self.getPublicKeyOfId(id)