Really Secure Algorithm

Crypto
30
523

I found this flag somewhere when I was taking a walk, but it seems to have been encrypted with this Really Secure Algorithm!

復号するPythonプログラムを書きます。
def exgcd(m, n):
  if n>0:
    y,x,d = exgcd(n, m%n)
    return x, y-m/n*x, d
  else:
    return 1, 0, m

p = 8337989838551614633430029371803892077156162494012474856684174381868510024755832450406936717727195184311114937042673575494843631977970586746618123352329889
q = 7755060911995462151580541927524289685569492828780752345560845093073545403776129013139174889414744570087561926915046519199304042166351530778365529171009493
e = 65537
c = 7022848098469230958320047471938217952907600532361296142412318653611729265921488278588086423574875352145477376594391159805651080223698576708934993951618464460109422377329972737876060167903857613763294932326619266281725900497427458047861973153012506595691389361443123047595975834017549312356282859235890330349

n = p * q
d = exgcd(e, (p-1)*(q-1))[0] % ((p-1)*(q-1))
s = pow(c, d, n)
h = format(s, 'x')
f = ''
for i in range(0, len(h), 2):
f += chr(int(h[i:i+2], 16))
print(f)
フラグは、
actf{really_securent_algorithm}
です。