avatar

攻防世界crypto题解+crypto脚本整理

base64

https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=0&id=5109&page=1

base64加密脚本

import base64

# str为待加密字符串
str='Y3liZXJwZWFjZXtXZWxjb21lX3RvX25ld19Xb3JsZCF9'
str=str.encode("utf-8")
str_encode=base64.b64encode(str)
print(str_encode)

base64解密脚本

import base64

# str为待加密字符串
str='Y3liZXJwZWFjZXtXZWxjb21lX3RvX25ld19Xb3JsZCF9'
str=str.encode("utf-8")
str_encode=base64.b64decode(str)
print(str_encode)

Caesar

https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=0&id=5110

暴力破解

# 凯撒密码
# 常规 暴力破解
str=input('输入待破解字符串:')
for i in range(1,27):
for j in str:
if j.isalpha():
if (ord(j)>=97 and ord(j)+i>97+25) or (ord(j)<97 and ord(j)>=65 and ord(j)+i>65+25): # 小写字母
print(chr(ord(j)+i-26),end='')
else:
print(chr(ord(j)+i),end='')

else:
print(j,end='')

print('\n')

Morse

https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=0&id=5111&page=1

str='11 111 010 000 0 1010 111 100 0 00 000 000 111 00 10 1 0 010 0 000 1 00 10 110'
str2=''

for i in str:
if i=='1':
str2+='-'
elif i=='0':
str2+='.'
else:
str2+=i
print(str2)

然后找个在线翻译器

Railfence

https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=0&id=5112&page=1

w型栅栏密码

http://www.atoolbox.net/Tool.php?Id=777

题面:五只小鸡->五栏

不仅仅是Morse

支持包含斜杠的morse解码:http://www.zhongguosou.com/zonghe/moErSiCodeConverter.aspx

解码后发现有大量AB内容

培根密码

http://rumkin.com/tools/cipher/baconian.php

混合编码

https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=0&id=5118&page=1

Author: Michelle19l
Link: https://gitee.com/michelle19l/michelle19l/2020/09/21/攻防世界crypto题解/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Donate
  • 微信
    微信
  • 支付寶
    支付寶