BSides AHM 2021
The flag is encrypted with a simple RSA:
Given two primes
Along with the public key and ciphertext, we're also given the following value
First, expand the sum
Let's calculate
For all
Therefore,
Now you can find the private key
from Crypto.Util.number import inverse
exec(open("../distfiles/output.txt").read())
d = inverse(65537, 2*s)
m = pow(c, d, n)
print(int.to_bytes(m, 2048//8, 'big'))