您的当前位置:首页正文

[WUSTCTF2020]babyrsa

2024-11-24 来源:个人技术集锦

题目:

c = 28767758880940662779934612526152562406674613203406706867456395986985664083182
n = 73069886771625642807435783661014062604264768481735145873508846925735521695159
e = 65537

       首先,我们审计题目,我们仅知道c,n,e三个条件。于是,我们首先将n分解得到两个质数p和q,使用工具yafu:

       

于是,我们便可以求得我们需要的p和q

接下来,我们仅需要通过rsa的基本算法将题目求解即可:

c = 28767758880940662779934612526152562406674613203406706867456395986985664083182
n = 73069886771625642807435783661014062604264768481735145873508846925735521695159
e = 65537

import gmpy2
import binascii

P = 386123125371923651191219869811293586459
q = 189239861511125143212536989589123569301

phi_n=(P-1)*(q-1)
d=gmpy2.invert(e,phi_n)
m=gmpy2.powmod(c,d,n)

print(binascii.unhexlify(hex(m)[10:]))



b'2020{just_@_piece_0f_cak3}'

显示全文