crypto-新手练习区

  • 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:

解密过程:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值