当前位置:网站首页>BUUCTF-bbbbbbrsa
BUUCTF-bbbbbbrsa
2022-07-27 23:54:00 【[email protected]】
1. Title code :
from base64 import b64encode as b32encode
from gmpy2 import invert,gcd,iroot
from Crypto.Util.number import *
from binascii import a2b_hex,b2a_hex
import random
flag = "******************************"
nbit = 128
p = getPrime(nbit)
q = getPrime(nbit)
n = p*q
print p
print n
phi = (p-1)*(q-1)
e = random.randint(50000,70000)
while True:
if gcd(e,phi) == 1:
break;
else:
e -= 1;
c = pow(int(b2a_hex(flag),16),e,n)
print b32encode(str(c))[::-1]
# 2373740699529364991763589324200093466206785561836101840381622237225512234632
p = 177077389675257695042507998165006460849
n = 37421829509887796274897162249367329400988647145613325367337968063341372726061
c = ==gMzYDNzIjMxUTNyIzNzIjMyYTM4MDM0gTMwEjNzgTM2UTN4cjNwIjN2QzM5ADMwIDNyMTO4UzM2cTM5kDN2MTOyUTO5YDM0czM3MjM
2. Reappear
n,p,c We all know , It's actually blasting e, The scope is also given .
from gmpy2 import invert,gcd
import libnum
p = 177077389675257695042507998165006460849
n = 37421829509887796274897162249367329400988647145613325367337968063341372726061
c = 2373740699529364991763589324200093466206785561836101840381622237225512234632
q=n//p
phi=(p-1)*(q-1)
e=70000
while 1:
if(e<=1):
break
if(gcd(e,phi)==1):
d=invert(e,phi)
m=pow(c,d,n)
if(str(libnum.n2s(int(m)))[2]=='f'):
print(libnum.n2s(int(m)))
e=e-1
# b'f\xff\x8e\xaa\x8e\x82\xbd\x0f\x05\x18\xbe\xc5\x82\xd5\x9a\xd8f\xad\x92n\xc6J\xe4\x1a\xb0r=m7\xe6\xac'
# b'flag{rs4_1s_s1mpl3!#}'
# b'f\xcfNT\x9a\x90\xba\xe8\x98\x94\xc5?0\xc5\xa6\x0f5z\xcb\xeew\x07\xff\xab?u`\x91\x1f\xb4 '
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207272106553138.html
边栏推荐
- Current situation and future of Nb IOT industry: cross the threshold of 100million shipments and rush to 5g connection!
- CaEGCN: Cross-Attention Fusion based Enhanced Graph Convolutional Network for Clustering 2021
- TCP的粘包拆包问题+解决方案
- What technology is RPA process automation robot? How to realize office automation?
- BUUCTF-[BJDCTF2020]RSA1
- MySQL data query (where)
- Error:svn: E155010: ‘/Users/.../Desktop/wrokspace/xxx‘ is scheduled for addition, but is missing
- Key points of data management
- In 2019, the world's top ten semiconductor manufacturers: Intel returned to the first place, and apple rose sharply against the trend
- Latex常用总结(2):输入矩阵(输入矩阵、对角阵、方程组等)
猜你喜欢
随机推荐
org.junit.runners.model.InvalidTestClassError: Invalid test class ‘com.zhj.esdemo.MysqlTests‘: 1.
BUU-CTF basic rsa
How to use FTP to realize automatic update of WinForm
File&递归14.1
2022 International Conference on civil, building and Environmental Engineering (iccaee 2022)
BUUCTF-[BJDCTF2020]RSA1
Redis hash underlying data structure
Lua basic grammar learning
Bank marketing predicts the success rate of a customer's purchase of financial products
Redis的分布式锁
UE4 official AEC blueprint case course learning notes
My annual salary is 1million, and I don't have clothes more than 100 yuan all over my body: saving money is the top self-discipline
字符流学习14.3
UE4官方AEC蓝图案例课程学习笔记
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
Construction and application of super large scale knowledge map of ants
[C language] address book (dynamic version)
15million per day! BYD masks won a US $1billion order in California
[December Haikou] the 6th International Conference on ships, marine and Maritime Engineering in 2022 (naome 2022)
资深如何确定软件测试结束的标准








