0%

[柏鹭杯 2021]试试大数据分解?

2024-10-02 09:20By
Xixii
PEMCrypto

Problem: [柏鹭杯 2021]试试大数据分解?

[[toc]]

思路

  • 解题大致思路

EXP

```from Crypto.Util.number import * import base64 n = 980710843783426929436352108445477207723530613536846588304753445659989738992892689598648497 e = 99991 p = 948539437740472240970258995719507356652939947 q = 1033916782753483187367063564275935620987269651 c1 = open('C://Users//HP//Downloads//C1_RSA//flag.enc1','rb').read() c1 = bytes_to_long(base64.b64decode(c1)) phi = (p-1)*(q-1) d = inverse(e,phi) m = pow(c1,d,n) print(m) print(long_to_bytes(m)) print((long_to_bytes(0x00666c61677b495345432d49))) c2 = open('C://Users//HP//Downloads//C1_RSA//flag.enc2','rb').read() c2 = bytes_to_long(base64.b64decode(c2)) phi = (p-1)*(q-1) d = inverse(e,phi) m = pow(c2,d,n) print(m) print(long_to_bytes(m)) print((long_to_bytes(0x007235574d5f473441666276))) c3 = open('C://Users//HP//Downloads//C1_RSA//flag.enc3','rb').read() c3 = bytes_to_long(base64.b64decode(c3)) phi = (p-1)*(q-1) d = inverse(e,phi) m = pow(c3,d,n) print(m) print(long_to_bytes(m)) print((long_to_bytes(0x00785f6d534d5f556766387a))) c4 = open('C://Users//HP//Downloads//C1_RSA//flag.enc4','rb').read() c4 = bytes_to_long(base64.b64decode(c4)) phi = (p-1)*(q-1) d = inverse(e,phi) m = pow(c4,d,n) print(m) print(long_to_bytes(m)) print((long_to_bytes(0x0052416f4d6b594350787d))) print(long_to_bytes(0x00666c61677b495345432d49)+long_to_bytes(0x007235574d5f473441666276)+long_to_bytes(0x00785f6d534d5f556766387a)+long_to_bytes(0x0052416f4d6b594350787d)) ## 总结 * 对该题的考点总结
还没有人赞赏,快来当第一个赞赏的人吧!
  
© 著作权归作者所有
加载失败
广告
×
评论区
添加新评论