当前位置:网站首页>2022DASCTF Apr X FATE 防疫挑战赛 CRYPTO easy_real
2022DASCTF Apr X FATE 防疫挑战赛 CRYPTO easy_real
2022-04-23 20:21:00 【雨后初霁&】
逆向一道都不会,寄了。只做了密码的签到题
题目描述
import random
import hashlibflag = 'xxxxxxxxxxxxxxxxxxxx'
key = random.randint(1,10)
for i in range(len(flag)):
crypto += chr(ord(flag[i])^key)
m = crypto的ascii十六进制
e = random.randint(1,100)
print(hashlib.md5(e))
p = 64310413306776406422334034047152581900365687374336418863191177338901198608319
q = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
n = p*q
c = pow(m,e,n)
print(n)
print(c)
#37693cfc748049e45d87b8c7d8b9aacd
#4197356622576696564490569060686240088884187113566430134461945130770906825187894394672841467350797015940721560434743086405821584185286177962353341322088523
#3298176862697175389935722420143867000970906723110625484802850810634814647827572034913391972640399446415991848730984820839735665233943600223288991148186397
从代码中不难看出
#37693cfc748049e45d87b8c7d8b9aacd 对应相应的e的md5值
到相应的网站解密
e=23
其他的分别定义
n=4197356622576696564490569060686240088884187113566430134461945130770906825187894394672841467350797015940721560434743086405821584185286177962353341322088523
c=3298176862697175389935722420143867000970906723110625484802850810634814647827572034913391972640399446415991848730984820839735665233943600223288991148186397
p = 64310413306776406422334034047152581900365687374336418863191177338901198608319
根据代码,我们不难看出,这是典型的rsa加密
直接求出明文的数值
from Crypto.Util.number import inverse,long_to_bytes
n=4197356622576696564490569060686240088884187113566430134461945130770906825187894394672841467350797015940721560434743086405821584185286177962353341322088523
c=3298176862697175389935722420143867000970906723110625484802850810634814647827572034913391972640399446415991848730984820839735665233943600223288991148186397
p = 64310413306776406422334034047152581900365687374336418863191177338901198608319
q=n//p
e=23
phi=(q-1)*(p-1)
d=inverse(e,phi)
m = pow(c, d, n)
print(m);
//m=2976168736142380455841784134407431434784057911773423743751382131043957
//m="ndios_;9kgE;WK8e;W?gWn<\;k|nu"
我们接着观察
key是一个随机值
但是有范围的
我们直接暴力枚举
import random
import hashlib
import math
from Crypto.Util.number import inverse,long_to_bytes
n=4197356622576696564490569060686240088884187113566430134461945130770906825187894394672841467350797015940721560434743086405821584185286177962353341322088523
c=3298176862697175389935722420143867000970906723110625484802850810634814647827572034913391972640399446415991848730984820839735665233943600223288991148186397
p = 64310413306776406422334034047152581900365687374336418863191177338901198608319
q=n//p
e=23
phi=(q-1)*(p-1)
d=inverse(e,phi)
m = pow(c, d, n)
print(m);
m="ndios_;9kgE;WK8e;W?gWn<\;k|nu"
for key in range(11):
flag=""
for i in range(len(m)):
flag+=chr(ord(m[i])^key)
print(flag)
直接出flag
打了这么多比赛,还是菜。
很多题目赛后根本没复现,真是失败的菜鸡,呜呜呜。
校内可以交流的师傅太少,听说最近联合战队在招新,准备去试试。
版权声明
本文为[雨后初霁&]所创,转载请带上原文链接,感谢
https://blog.csdn.net/a257131460266666/article/details/124368463
边栏推荐
- [graph theory brush question-5] Li Kou 1971 Find out if there is a path in the graph
- Mysql database and table building: the difference between utf8 and utf8mb4
- PCA based geometric feature calculation of PCL point cloud processing (52)
- Paper writing 19: the difference between conference papers and journal papers
- PCL点云处理之直线与平面的交点计算(五十三)
- Tensorflow 2 basic operation dictionary
- LeetCode动态规划训练营(1~5天)
- Numpy sort search count set
- R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
- Investigate why close is required after sqlsession is used in mybatties
猜你喜欢
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
Wave field Dao new species end up, how does usdd break the situation and stabilize the currency market?
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
Click an EL checkbox to select all questions
Recommend an open source free drawing software draw IO exportable vector graph
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
Five minutes to show you what JWT is
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
随机推荐
BMP JPEG 图片转换为矢量图像 ContourTrace
Leetcode XOR operation
Introduction to electron tutorial 3 - process communication
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
Leetcode dynamic planning training camp (1-5 days)
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
NC basic usage
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
中金财富公司怎么样,开户安全吗
Numpy mathematical function & logical function
DTMF dual tone multi frequency signal simulation demonstration system
NC basic usage 1
Plato Farm元宇宙IEO上线四大,链上交易颇高
Notes of Tang Shu's grammar class in postgraduate entrance examination English
How does onlyoffice solve no route to host
记录:调用mapper报空指针;<foreach>不去重的用法;
Mysql database backup scheme
R语言survival包coxph函数构建cox回归模型、ggrisk包ggrisk函数和two_scatter函数可视化Cox回归的风险评分图、解读风险评分图、基于LIRI数据集(基因数据集)
nc基础用法3
ArcGIS js api 4. X submergence analysis and water submergence analysis