This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.PublicKey import RSA | |
with open('public_key.pem', 'rb') as f: | |
modulus = RSA.importKey(f.read()).n | |
with open('message.enc', 'rb') as f: | |
message = int.from_bytes(f.read(), byteorder='big') | |
def cube_root(n): | |
guess, previous = n, 0 |