參考文章:http://bobao.360.cn/learning/detail/3058.html
Easy RSA
N 和 e是給定的,先吧密文c(0xdc2eeeb2782c)轉(zhuǎn)換成int,然后用
http://factordb.com/分解N(或者用yafu解開(kāi),命令factor(N)),然后用modinv和pow解出m,然后轉(zhuǎn)換成ascii碼,可以用在線網(wǎng)站解出來(lái),或者python2.7下,
print '33613559'.decode('hex'),python3.5下,
codecs.decode('33613559','hex_codec')
Medium RSA
文件解壓以后得到pubkey.pem和flag.enc,用openssl命令opensslrsa?-inpubkey.pem-pubin?-text?-modulus,得到N和E,吧N先轉(zhuǎn)換成10進(jìn)制,然后用yafu分解出p和q,然后用rsatool直接生成私鑰,然后再用openssl解密,openssl rsautl -decrypt -inkey pkey -in ../mediumRSA/flag.enc -out out.txt,得到flag。
ps:http://linux.51yip.com/search/openssl openssl命令用法
Extremely hard RSA
Openssl解碼pubkey.pem,發(fā)現(xiàn)E=3,選擇用低加密指數(shù)攻擊,將flag.enc hex出16進(jìn)制碼,再轉(zhuǎn)10進(jìn)制,然后用腳本爆破,
得到十進(jìn)制數(shù)組,再轉(zhuǎn)16進(jìn)制轉(zhuǎn)ascii碼。得出flag。
hard RSA
Openssl跑出來(lái)看到e=2,查了很久資料發(fā)現(xiàn)是radin加密,然后找到腳本破解
very hard RSA
文件夾下有兩個(gè)flag文件,然后判斷出來(lái)是共膜攻擊,也就是密文相同用不同的e加密,
感覺(jué)寫(xiě)的不是很詳細(xì)(周五為什么不能偷懶那),等有時(shí)間專(zhuān)門(mén)總結(jié)一下RSA相關(guān)知識(shí)。