- base64
简单的base64解码,在线转码即可,也可以用python解码:
import base64
flag=base64.b64decode('Y3liZXJwZWFjZXtXZWxjb21lX3RvX25ld19Xb3JsZCF9')
- Caesar
凯撒密码,简单的移位密码,分析可知是单一的移位加密,密钥key=12,直接上脚本:
str1='oknqdbqmoq{kag_tmhq_xqmdzqp_omqemd_qzodkbfuaz}'
flag=''
for i in range(len(str1)):
try:
if str1[i]=='{' or str1[i]=='}' or str1[i]=='_':
flag+=str1[i]
else:
flag+=chr(97+(ord(str1[i])-97-12)%26)
except Exception as err:
print(err)
print(flag)
- Morse
莫斯电码,将1转变为字符“-”,0装变为字符“.”,写出脚本,得到flag:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def decode(a):
plain_text=''
s = a.split(" ")
dict = {
'.-':'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','.----':'1','..---':'2','...--':'3','....-':'4','.....':'5',
'-....':'6','--...':'7','---..':'8','----.':'9','-----':'0','..--..':'?','-..-.':'/',
'-.--.-':'()','-....-':'-','.-.-.-':'.'
};
for item in s:
plain_text+=dict[item]
return plain_text
str1='11 111 010 000 0 1010 111 100 0 00 000 000 111 00 10 1 0 010 0 000 1 00 10 110'
cipher_text=''
for i in str1:
try:
if i==' ':
cipher_text+=i
else:
if i=='1':
cipher_text+='-'
elif i=='0':
cipher_text+="."
except Exception as err:
print(err)
print(decode(cipher_text).lower())
- Railfence
由题目描述可知是栅栏密码,且分组数为5:
直接用脚本解密:
#coding = utf-8
e='ccehgyaefnpeoobe{lcirg}epriec_ora_g'
elen = len(e)
filed = []
for i in range(2,elen):
if(elen%i==0):
filed.append(i)
for f in filed:
b = elen
result = {x:'' for x in range(b)}
for i in range(elen):
a = i%b
result.update({a:result[a]+e[i]})
d=''
for i in range(b):
d = d+result[i]
print('分为'+str(f)+'栏时,解密结果为:'+d+'\n')
结果并不对,百度一下单词:Railfence,发现一个在线解密的网站,直接解密得到flag:
解密过程: