17 lines
507 B
Python
17 lines
507 B
Python
import ContinuedFractions, Arithmetic
|
|
from Cryptodome.Util.number import getPrime, inverse, bytes_to_long, long_to_bytes, GCD
|
|
|
|
#flag len == 23
|
|
n = 770071954467068028952709005868206184906970777429465364126693
|
|
e = 3
|
|
# ct = pow(pt, e, n)
|
|
ct = 388435672474892257936058543724812684332943095105091384265939
|
|
p = 888242373638787482012535770369
|
|
q = 866961515596671343895614356197
|
|
phi = (p - 1)*(q - 1)
|
|
d = inverse(e, phi)
|
|
#res = egcd(e, phi)
|
|
pt = pow(ct,d,n)
|
|
decrypted = long_to_bytes(pt)
|
|
print(decrypted.decode())
|