ctfshow-CRYPTO
文章目录
基础
密码学签到
crypto2
观察密码是jother编码->摁F12->选择控制台->粘贴编码->回车->拿到flag
crypto3
打开页面发现乱码->另存为.txt文件->打开后发现是颜文字->用aaencode解码->拿到flag
crypto4
RSA题目->套用公式
n=p*q
ɸ(n)=(p-1)*(q-1)
ed=1 mod ɸ(n)
n=p*q=911934958137
ɸ(n)=(p-1)*(q-1)=911487283016
ed=1 mod ɸ(n)
d=536168799001
拿到flag->flag{536168799001}
crypto5
n=p*q
ɸ(n)=(p-1)*(q-1)
ed=1 mod ɸ(n)
c=m^e mod n
m=c^d mod n
n=p*q=911934958137
ɸ(n)=(p-1)*(q-1)=911487283016
ed=1 mod ɸ(n)
d=536168799001
m=c^d mod n
m=904332399012
拿到flag->flag{904332399012}
crypto6
发现乱码->另存为文件
Rabbit加密开头部分通常为U2FsdGVkX1
->密钥为Rabbit
http://www.jsons.cn/rabbitencrypt/
crypto7
Ook!加密
https://www.splitbrain.org/services/ook ->点击Ook! to text->拿到flag
crypto8
Brainfuck加密
https://www.splitbrain.org/services/ook ->拿到flag
crypto9
下载附件 得到一个加密的压缩包 用ARCHPR进行爆破,得到密码4132
得到一个 .dat文件,根据题目提示,是一个serpent加密
http://serpent.online-domain-tools.com/ 解码->拿到flag
crypto10
quoted-printable编码,用一个等号”=”后跟随两个十六进制数字(0–9或A–F)来表示一个非ASCII字符
crypto11
32位md5
md5特征:
(1)长度固定
(2)只可能小写字母和数字
cryptoO
凯撒加密->密钥是1->拿到flag
crypto12
埃特巴什码:最后一个字母代表第一个字母,倒数第二个字母代表第二个字母。
crypto13
import base64
s=''
with open('base.txt', 'r', encoding='UTF-8') as f:
s=f.read()
src=s
while True:
try:
s=base64.b16decode(s)
continue
except:
pass
try:
s=base64.b32decode(s)
continue
except:
pass
try:
s=base64.b64decode(s)
continue
except:
pass
break
print(s)
直接用脚本帮我们解决
crypto14
先将二进制转化为十六进制,再十六进制解码,再解码,得到:3EP/3VNFFmNEAnlHD5dCMmVHD5ad9uG
不能直接进行base64解码 ,这里需要根据base64编码表 对这串代码进行一下 移位替换
密文开头是 3EP/
而flag的base64编码为:ZmxhZw==
3与Z的值相差30
s= '3EP/3VNFFmNEAnlHD5dCMmVHD5ad9uG'
t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
l=""
for i in s:
l += t[(t.index(i)-30)%64]
if len(l)%4!=0:
l=l+"="*(4-(len(l)%4))
print(l)
移位后的值:ZmxhZ3vnnIvmiJHplb/kuI3plb8/fQo=
,进行base64编码->拿到flag
base64编码特征:
(1)在base64中的可打印字符包括字母A-Z、a-z、数字0-9,+ / =
(2)永远是4的倍数,不足四的用=补齐。
萌新_密码5
当铺密码:当前汉字有多少笔画出头,就是转化成数字几
find the table
右击检查->发现审查元素前面有一串数字,根据题目提示,应该是化学元素周期表
9对应 F 57对应La 64对应Ga
拿到flag:flag{doyoulikesnow}
babyrsa
用rsa脚本拿到flag
import gmpy2
from Crypto.Util.number import *
e = 65537
p = 104046835712664064779194734974271185635538927889880611929931939711001301561682270177931622974642789920918902563361293345434055764293612446888383912807143394009019803471816448923969637980671221111117965227402429634935481868701166522350570364727873283332371986860194245739423508566783663380619142431820861051179
q = 140171048074107988605773731671018901813928130582422889797732071529733091703843710859282267763783461738242958098610949120354497987945911021170842457552182880133642711307227072133812253341129830416158450499258216967879857581565380890788395068130033931180395926482431150295880926480086317733457392573931410220501
c = 4772758911204771028049020670778336799568778930072841084057809867608022732611295305096052430641881550781141776498904005589873830973301898523644744951545345404578466176725030290421649344936952480254902939417215148205735730754808467351639943474816280980230447097444682489223054499524197909719857300597157406075069204315022703894466226179507627070835428226086509767746759353822302809385047763292891543697277097068406512924796409393289982738071019047393972959228919115821862868057003145401072581115989680686073663259771587445250687060240991265143919857962047718344017741878925867800431556311785625469001771370852474292194
n = p * q
phi_n = (p - 1) * (q - 1)
d = gmpy2.invert(e, phi_n)
m = pow(c, d, n)
print(long_to_bytes(m))
``
[外链图片转存中…(img-pnRP3ekC-1709784938369)]