MCPcopy Create free account
hub / github.com/Apress/practical-cryptography-in-python / __call__

Method __call__

src/rsa_oracle_attack.py:52–55  ·  view source on GitHub ↗
(self, cipher_text)

Source from the content-addressed store, hash-verified

50 self.private_key = private_key
51
52 def __call__(self, cipher_text):
53 recovered_as_int = simple_rsa_decrypt(cipher_text, self.private_key)
54 recovered = int_to_bytes(recovered_as_int, self.private_key.key_size//8)
55 return recovered[0:2] == bytes([0, 2])
56
57class RSAOracleAttacker:
58 def __init__(self, public_key, oracle):

Callers

nothing calls this directly

Calls 2

simple_rsa_decryptFunction · 0.70
int_to_bytesFunction · 0.70

Tested by

no test coverage detected