CTF/system32.kr
[system32.kr] RSA105
pental
2020. 9. 28. 16:34
n : 14563994539777678316321336781712344883711529518189434139233680882263409604514153869699501702104322682479573897503872406635890483506906896813982089686642192006130896329932374470690714494675193648369783731927754727548782563723442681780574596631901415395263336968261396444462141129255716197310580275877681304858562705807686921384452565148850113267428665758030506035314679252439022969913295597306528946210184007253645129375949497711293612867692547866985135149571625792745784234869796370504461309988327790266777539646009367784188629367635437858554533733747458534618750336302736798813966890424262766487012612696221075689613
e : 7
c : 3257687211413179849713234287228115652852064803596545802006316144655701336714918948672668217982037728069055370417273850104541474476810598369542627961429180060096555295519064954697207788677528957569208943432299557549774333187664920215674167987939460257141632237998790136575185293301081863083862494006009415801599660234577382347813571039134562532471377834137776834839392965274882404992875421226913724316557631483699200757
e가 매우 작고, n이 매우 큰 경우 = 모뮬러 n 연산이 안됐을 가능성
# -*- coding: utf-8 -*-
import gmpy2
c = 3257687211413179849713234287228115652852064803596545802006316144655701336714918948672668217982037728069055370417273850104541474476810598369542627961429180060096555295519064954697207788677528957569208943432299557549774333187664920215674167987939460257141632237998790136575185293301081863083862494006009415801599660234577382347813571039134562532471377834137776834839392965274882404992875421226913724316557631483699200757
e = 7
result = gmpy2.iroot(c, e)
print(result)
result_value = 441266888562578531526025159649238309197954079705341664980093
string = bytes.fromhex(str(result_value))
print(string)