BUUCTF RSA
作者:互联网
打开压缩文件后
然后进行公钥解析
分解质因数n
然后由工具得d
最后拿出我珍藏已久的脚本
import rsa
e= 65537
n= 86934482296048119190666062003494800588905656017203025617216654058378322103517
p= 285960468890451637935629440372639283459
q= 304008741604601924494328155975272418463
d= 81176168860169991027846870170527607562179635470395365333547868786951080991441
key = rsa.PrivateKey(n,e,d,p,q) #在pkcs标准中,pkcs#1规定,私钥包含(n,e,d,p,q)
with open("H:\\flag.text","rb") as f: #以二进制读模式,读取密文
f = f.read()
print(rsa.decrypt(f,key)) # f:公钥加密结果 key:私钥
得flag
标签:pkcs,BUUCTF,私钥,RSA,rsa,flag,公钥,key 来源: https://blog.csdn.net/m0_61290851/article/details/122451456