RSA with python Challenge, Any tip on cracking python code

557 views Asked by At

Hy Guys, I know this will sound weird but can u guys help me with finding readme value.

I know python and still having a hard time cracking this variable

from Crypto.Util.number import getPrime, bytes_to_long, inverse

readme = b"readme{XXXXXXXXXXXXXXXXXX}"

p = getPrime(1024)
q = getPrime(1024)
N = p*q
phi = (p-1)*(q-1)
e = 65537
d = inverse(e, phi)

my_key = (N, d)

keys = [(N, getPrime(16)) for i in range(10)]

cipher = bytes_to_long(readme)

for key in keys:
    cipher = pow(cipher, key[1], key[0])

print("- My private key",my_key)
print("- keys",keys)
print("- Encrypted DATA",cipher)

Output generates a long data but i cant understand how it works, Any little help would be appreciated :)

0

There are 0 answers