p = 302825536744096741518546212761194311477 q = 325045504186436346209877301320131277983
求出d
使用gmpy
解密并打印出flag
使用rsa模块
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import rsa
n = 0xD99E952296A6D960DFC2504ABA545B9442D60A7B9E930AFF451C78EC55D555EB e = 0x10001 p = 302825536744096741518546212761194311477 q = 325045504186436346209877301320131277983 d = 0x4547B732CBC3527104CB57C4728D6899B44C4994FAE2713D6B594BC0F522A41 ret = "" privatekey = rsa.PrivateKey(n , e , d , p , q) withopen("encrypted.message1" , "rb") as f: ret += (rsa.decrypt(f.read(), privatekey).decode()) withopen("encrypted.message2" , "rb") as f: ret += (rsa.decrypt(f.read(), privatekey).decode()) withopen("encrypted.message3" , "rb") as f: ret += (rsa.decrypt(f.read(), privatekey).decode()) print(ret)