当前位置:网站首页>BUUCTF-Baby RSA
BUUCTF-Baby RSA
2022-07-27 21:07:00 【[email protected]】
1.题目代码:
# p+q : 0x1232fecb92adead91613e7d9ae5e36fe6bb765317d6ed38ad890b4073539a6231a6620584cea5730b5af83a3e80cf30141282c97be4400e33307573af6b25e2ea
# (p+1)(q+1) : 0x5248becef1d925d45705a7302700d6a0ffe5877fddf9451a9c1181c4d82365806085fd86fbaab08b6fc66a967b2566d743c626547203b34ea3fdb1bc06dd3bb765fd8b919e3bd2cb15bc175c9498f9d9a0e216c2dde64d81255fa4c05a1ee619fc1fc505285a239e7bc655ec6605d9693078b800ee80931a7a0c84f33c851740
# e : 0xe6b1bee47bd63f615c7d0a43c529d219
# d : 0x2dde7fbaed477f6d62838d55b0d0964868cf6efb2c282a5f13e6008ce7317a24cb57aec49ef0d738919f47cdcd9677cd52ac2293ec5938aa198f962678b5cd0da344453f521a69b2ac03647cdd8339f4e38cec452d54e60698833d67f9315c02ddaa4c79ebaa902c605d7bda32ce970541b2d9a17d62b52df813b2fb0c5ab1a5
# enc_flag : 0x50ae00623211ba6089ddfae21e204ab616f6c9d294e913550af3d66e85d0c0693ed53ed55c46d8cca1d7c2ad44839030df26b70f22a8567171a759b76fe5f07b3c5a6ec89117ed0a36c0950956b9cde880c575737f779143f921d745ac3bb0e379c05d9a3cc6bf0bea8aa91e4d5e752c7eb46b2e023edbc07d24a7c460a34a9a
2.复现:
主要就是通过p+q和(p+1)*(q+1)来算n的值。
import libnum
pjiaq=0x1232fecb92adead91613e7d9ae5e36fe6bb765317d6ed38ad890b4073539a6231a6620584cea5730b5af83a3e80cf30141282c97be4400e33307573af6b25e2ea
pjia1xqjia1=0x5248becef1d925d45705a7302700d6a0ffe5877fddf9451a9c1181c4d82365806085fd86fbaab08b6fc66a967b2566d743c626547203b34ea3fdb1bc06dd3bb765fd8b919e3bd2cb15bc175c9498f9d9a0e216c2dde64d81255fa4c05a1ee619fc1fc505285a239e7bc655ec6605d9693078b800ee80931a7a0c84f33c851740
e = 0xe6b1bee47bd63f615c7d0a43c529d219
d =0x2dde7fbaed477f6d62838d55b0d0964868cf6efb2c282a5f13e6008ce7317a24cb57aec49ef0d738919f47cdcd9677cd52ac2293ec5938aa198f962678b5cd0da344453f521a69b2ac03647cdd8339f4e38cec452d54e60698833d67f9315c02ddaa4c79ebaa902c605d7bda32ce970541b2d9a17d62b52df813b2fb0c5ab1a5
c=0x50ae00623211ba6089ddfae21e204ab616f6c9d294e913550af3d66e85d0c0693ed53ed55c46d8cca1d7c2ad44839030df26b70f22a8567171a759b76fe5f07b3c5a6ec89117ed0a36c0950956b9cde880c575737f779143f921d745ac3bb0e379c05d9a3cc6bf0bea8aa91e4d5e752c7eb46b2e023edbc07d24a7c460a34a9a
# (p+1)(q+1)=pq+p+q+1
# (p-1)(q-1)=pq-p-q-1
# (p-1)(q-1)=(p+1)(q+1)-2(p+q)-2
#n=pq=((p+1)(q+1)+(p-1)(q-1))/2
phi=pjia1xqjia1-2*pjiaq-2
n=(phi+pjia1xqjia1)//2
m=pow(c,d,n)
print(libnum.n2s(int(m)))
# b'flag{cc7490e-78ab-11e9-b422-8ba97e5da1fd}'版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_61774705/article/details/124674479
边栏推荐
- Ideas, methods and steps of making folding fans with 3DMAX
- Binary conversion method
- [signal denoising] signal denoising based on Kalman filter with matlab code
- org.junit.runners.model. InvalidTestClassError: Invalid test class ‘com.zhj.esdemo. MysqlTests‘: 1.
- 解决5G使用痛点,魅族17 mSmart 5G快省稳技术发布
- 总投资600亿!富士康半导体高端封测项目正式落户青岛
- Features of hardwired controller:
- Join hands with Changjiang storage, jiangbolong launches the world's smallest expansion card
- 尚硅谷尚品项目汇笔记(一)
- Sudden, wechat important notice
猜你喜欢

Date的使用

CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021

远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug

Character stream learning 14.3

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

Interviewer: let's talk about the specific process of network data transmission
![[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)

2022年土木,建筑与环境工程国际会议(ICCAEE 2022)

NDK series (6): let's talk about the way and time to register JNI functions
![[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code](/img/10/de712b67a7538be03f8fb722271949.png)
[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code
随机推荐
Software test function test full set of common interview questions [function test] interview summary 4-2
[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code
Features of hardwired controller:
Apple releases new iPhone se: equipped with A13 bionic processor, priced from 3299 yuan
请求合并哪家强——接口请求合并的3种技巧,性能直接爆表
Application of user portrait in precise push of wechat official account of scientific journals
Interviewer: let's talk about the specific process of network data transmission
Calling dht11/22 temperature and humidity sensor in Proteus simulation Arduino
JS提升:JS中的数组扁平化问题
reduce错误示范
股价暴涨180.46%!国产大硅片龙头沪硅产业上市:近4年净利累计不足6000万
虚拟存储器与Cache的比较
低代码开发前景如何,大家都真的看好低代码开发吗?
Common Taylor expansion
基于mediapipe的姿态识别和简单行为识别
Solve 5g pain points, Meizu 17 smart 5g fast and stable technology release
Realize today's news website based on native JS
The share price soared 180.46%! Shanghai silicon industry, the leader of domestic large silicon wafers, is listed: the cumulative net profit in recent four years is less than 60million
RPA流程自动化机器人是什么技术?如何实现办公自动化?
突发,微信重要通知