真男人,不能太短

题目

咸鱼俊这个二五仔,就是不听王文武的提醒:男人不能太短,不能太短啊!!!

HINT

RSA破解

解题报告

看到public key 以及HINT 确认是RSA 所以就是求RSA各项数值n,e,p,q等的过程

关于RSA的资料在这里

从公钥提取出n和e,有在线工具 http://tool.chacuo.net/cryptrsapubkey

也可以在Linux下用Openssl

openssl rsa -pubin -text -modulus -in warmup -in public.key

还可以利用rsatoolhttps://github.com/lovebed/rsatools 得到

n = 9855460668796519587811317486171880382152076448823594480175361244807568812 0603

e = 65537

然后使用yafu/Sage/msieve等分解n得到p和q

p = 290755649601246609635317169519076419849

q = 338960246595815914177570453420417017347

利用rsatool以及py脚本(可以自己写,百度也有很多)构造密钥

.enc文件可以用工具EA-key解开,也可以百度脚本来解

python rsatool.py -p 290755649601246609635317169519076419849 -q 338960246595815914177570453420417017347 -o priv.key openssl rsautl -decrypt -in flag.enc -inkey priv.key -out flag cat flag

总括来说 就是要了解RSA算法 如何通过公钥获得私钥

Flag

HSCTF{Be_Re@1_M4n}

results matching ""

    No results matching ""