BUUCTF RSA

打开压缩文件后

BUUCTF RSA

然后进行公钥解析

BUUCTF RSA

分解质因数n

BUUCTF RSA

然后由工具得d

BUUCTF RSA

 最后拿出我珍藏已久的脚本

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

上一篇:java使用Spire.Doc生成的word文件去除水印(头部的警告信息)


下一篇:BUUCTF/RE/Java逆向解密