n = 675517326695494061190287679557796696358902817969424171685361

c = 0xe3712876ea77c308083ef596a32c5ce2d7edf22abbc58657e

 

도움 : https://www.alpertron.com.ar/ECM.HTM

 

p = 804811499343607200702893651293

q = 839348502408870119614692320677

phi = 21 666250 324845 688377 538645 829331 393191 999621 542715 910095 508724

 

<flag code>

from Crypto.Util.number import *

n = 675517326695494061190287679557796696358902817969424171685361
c = 0xe3712876ea77c308083ef596a32c5ce2d7edf22abbc58657e
p = 804811499343607200702893651293
q = 839348502408870119614692320677
e = 65537
phi = (p - 1) * (q - 1)
d = inverse(e, phi)
flag = long_to_bytes(pow(c, d, n))

print flag

 

 

FLAG : HackCTF{That's_4_Pr1m3!}

'CTF > HackCTF' 카테고리의 다른 글

[Cryptography] XOR  (0) 2020.02.03
[Cryptography] RSA3  (0) 2020.01.11
[Cryptography] DNA  (0) 2020.01.11
[Cryptography] Classic Cipher -4  (0) 2020.01.11
[Cryptography] Classic Cipher -3  (0) 2020.01.11