当前位置:网站首页>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
边栏推荐
- Redis hash underlying data structure
- 【开发教程9】疯壳·开源蓝牙心率防水运动手环-心率监测
- 29.学习Highcharts 使用百分比的堆叠柱形图
- BUUCTF-Baby RSA
- CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
- What is the difference between concurrency and parallelism?
- New technology leads new changes in marketing of large and medium-sized enterprises, and UFIDA BiP CRM is launched!
- Lua基础语法学习
- Redis 哈希Hash底层数据结构
- Master data management theory and Practice
猜你喜欢

org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.

J9数字科普:Sui网络的双共识是如何工作的?

如果我们是那晚负责修复 B 站崩了的开发人员

Unity 实现简单画板画画功能(笔记)

Remotely debug idea, configure remote debug, and add JVM startup parameter -xdebug in the program of remote server

Lua basic grammar learning

Master data management theory and Practice

Record the errors about formatc in R language

详解分布式系统的幂等
![[GWCTF 2019]BabyRSA1](/img/31/6727fd04be13ddd6bd46969fe2c50f.png)
[GWCTF 2019]BabyRSA1
随机推荐
BUU-CTF basic rsa
[December Haikou] the 6th International Conference on ships, marine and Maritime Engineering in 2022 (naome 2022)
Join hands with Changjiang storage, jiangbolong launches the world's smallest expansion card
The first activity of togaf10 standard reading club was successfully held, and the wonderful moments were reviewed!
真的很难理解?RecyclerView 缓存机制到底是几级缓存?
2022/7/26
New technology leads new changes in marketing of large and medium-sized enterprises, and UFIDA BiP CRM is launched!
2022夏暑假每日一题(五)
BUUCTF-bbbbbbrsa
JS提升:JS中的数组扁平化问题
Introduction to several common usage scenarios of message queue
Apple releases new iPhone se: equipped with A13 bionic processor, priced from 3299 yuan
Lua基础语法学习
How Flink uses savepoint
JS array copy speed test 220320
XSS Payload 学习浏览器解码
Smartrefresh nested multiple recycleview sliding conflicts and incomplete layout display
Zabbix4.0使用SNMP代理方式监控vcenter6.5
Realize today's news website based on native JS
NDK 系列(6):说一下注册 JNI 函数的方式和时机