CTF-DAY9
[BJDCTF 2020]Polybius
题目:
密文:ouauuuoooeeaaiaeauieuooeeiea
hint:VGhlIGxlbmd0aCBvZiB0aGlzIHBsYWludGV4dDogMTQ=
flag:解出明文后,请加上BJD{}
分析:
题目提示长度为14,而密文长度为28
明文长度是密文长度的一半,是棋盘密码。
from itertools import permutations# 字母棋盘的生成
key = [['a', 'b', 'c', 'd', 'e'],['f', 'g', 'h', 'i/j', 'k'],['l', 'm', 'n', 'o', 'p'],['q', 'r', 's', 't', 'u'],['v', 'w', 'x', 'y', 'z']]c = 'ouauuuoooeeaaiaeauieuooeeiea'
s = "aeiou"
for num in permutations(s, 5): # 元素全排列ordstr = ''for i in c:a = str(num.index(i)) # 取下标ordstr += aordstrList = list(map(int, ordstr)) # 将下标转换为整数flag = ''for i in range(0, len(c), 2):flag += key[ordstrList[i]][ordstrList[i+1]] # 两两一组获取对应明文print(flag)#flagispolybius
CTFSHOW刷题
密码学签到
密文是:
}wohs.ftc{galf
直接逆序输出
s = '}wohs.ftc{galf'
print(s[::-1])
#flag{ctf.show}
crypto2 —— JSFuck
题目:
直接JS打印
相关原理可参考:
https://www.cnblogs.com/mq0036/p/13931405.html
https://github.com/aemkei/jsfuck
crypto3
题目
直接控制台打印
编码转换实现:https://utf-8.jp/public/aaencode.html
crypto4
p=447685307 q=2037 e=17
提交flag{d}即可
直接计算d = inverse(e,(p-1)*(q-1)) = 53616899001
crypto5
p=447685307 q=2037 e=17 c=704796792
提交flag{m}
直接计算
d = inverse(e,(p-1)(q-1))
m = pow(c,d,pq) = 904332399012
crypto6
密文:
U2FsdGVkX19mGsGlfI3nciNVpWZZRqZO2PYjJ1ZQuRqoiknyHSWeQv8ol0uRZP94
MqeD2xz+
密钥:
加密方式名称
以U2FsdGVkX1开头,极有可能是Rabbit加密
crypto7
OOK编码
crypto8
Brainfuck编码
crypto9
解压需要密码,爆破一下
得到一个dat文件
题目说是serpent加密
解密工具:http://serpent.online-domain-tools.com/
crypto10
Quoted-printable编码,解码工具:https://config.net.cn/tools/Quoted-Printable-Encoding.html