当前位置:网站首页>BUUCTF-RSA
BUUCTF-RSA
2022-07-27 23:54:00 【[email protected]】
1. subject
Public key :pub.key
-----BEGIN PUBLIC KEY-----
MDwwDQYJKoZIhvcNAQEBBQADKwAwKAIhAMAzLFxkrkcYL2wch21CM2kQVFpY9+7+
/AvKr1rzQczdAgMBAAE=
-----END PUBLIC KEY-----
Perform public key decomposition :

Break down links :RSA Public private key decomposition Exponent、Modulus,Rsa Public private key index 、 coefficient ( modulus ) decompose -- Error checking network
obtain 10 Base number n=86934482296048119190666062003494800588905656017203025617216654058378322103517
decompose n:

import rsa
import gmpy2
e= 65537
n= 86934482296048119190666062003494800588905656017203025617216654058378322103517
p= 285960468890451637935629440372639283459
q= 304008741604601924494328155975272418463
phi=(p-1)*(q-1)
d= gmpy2.invert(e,phi)
key = rsa.PrivateKey(n,e,d,q,p) # stay pkcs In the standard ,pkcs#1 Regulations , The private key contains (n,e,d,p,q)
with open("D:\\ctf\\flag\\flag.enc","rb") as f: # In binary read mode , Read ciphertext
f = f.read()
print(rsa.decrypt(f,key)) # f: Public key encryption results key: Private key
#b'flag{decrypt_256}\n'版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207272106553693.html
边栏推荐
- Use a grayscale filter
- The technology of applet container is very promising, which can greatly improve the efficiency of mobile R & D
- Error:svn: E155010: ‘/Users/.../Desktop/wrokspace/xxx‘ is scheduled for addition, but is missing
- Redis hash underlying data structure
- 基于原生js实现今日新闻网站
- Record the errors about formatc in R language
- Redis 哈希Hash底层数据结构
- 真的很难理解?RecyclerView 缓存机制到底是几级缓存?
- Introduction to several common usage scenarios of message queue
- File&递归14.1
猜你喜欢

Record the errors about formatc in R language
![[RoarCTF2019]RSA](/img/0e/8c8371ccf40094e5b03e502d6ae851.png)
[RoarCTF2019]RSA

The first activity of togaf10 standard reading club was successfully held, and the wonderful moments were reviewed!

xss.haozi.me练习通关

Put cloudflare on the website (take Tencent cloud as an example)

主数据管理理论与实践

Explain the idempotence of distributed system in detail

(十二)51单片机----用DS18B20浅测一下工(江)西的室外温度

【开发教程9】疯壳·开源蓝牙心率防水运动手环-心率监测
![[December Haikou] the 6th International Conference on ships, marine and Maritime Engineering in 2022 (naome 2022)](/img/a4/041268aadd5d8ff493b52ead9c5e79.png)
[December Haikou] the 6th International Conference on ships, marine and Maritime Engineering in 2022 (naome 2022)
随机推荐
JS提升:JS中的数组扁平化问题
为什么需要等待计时2MSL?
Monologue of a software Investor: why don't I pursue fast-growing companies
2022/7/24-7/25
NDK series (6): let's talk about the way and time to register JNI functions
Socket interaction process of three handshakes
Current situation and future of Nb IOT industry: cross the threshold of 100million shipments and rush to 5g connection!
CPU的控制方式
2022年土木,建筑与环境工程国际会议(ICCAEE 2022)
New technology leads new changes in marketing of large and medium-sized enterprises, and UFIDA BiP CRM is launched!
TCP sticking and unpacking problem + Solution
[December Haikou] the 6th International Conference on ships, marine and Maritime Engineering in 2022 (naome 2022)
尚硅谷尚品项目汇笔记(一)
(十二)51单片机----用DS18B20浅测一下工(江)西的室外温度
【zer0pts CTF 2022】 Anti-Fermat
Redefine analysis - release of eventbridge real-time event analysis platform
XSS Payload 学习浏览器解码
[NCTF2019]babyRSA1
基于mediapipe的姿态识别和简单行为识别
BUU-CTF basic rsa