def is_host_running(): is_running = True try: alice_verifying_key = Alice.get_verifying_key() bob_encrypting_key, bob_verifying_key = Bob.get_keys() except: is_running = False return is_running
def decrypt(label, encrypted): retrieval = {} retrieval["label"] = label retrieval["policy_encrypting_key"] = Alice.get_policy_encrypting_key( label) retrieval["alice_verifying_key"] = Alice.get_verifying_key() retrieval["message_kit"] = encrypted response = requests.post(f"{Bob.bob}/retrieve", data=json.dumps(retrieval)) plaintext = json.loads(response.content)['result']['cleartexts'][0] return plaintext