码迷,mamicode.com
首页 > 其他好文 > 详细

bugku crypto easy-crypto

时间:2019-04-29 15:26:52      阅读:393      评论:0      收藏:0      [点我收藏+]

标签:字符串   inter   The   for   fun   string   bsp   col   pre   

0010 0100 01 110 1111011 11 11111 010 000 0 001101 1010 111 100 0 001101 01111 000 001101 00 10 1 0 010 0 000 1 01111 10 11110 101011 1111101

长度不一的01字符串 就要考虑是不是摩斯密码 用这个py脚本:

from __future__ import print_function
a = input("input the string:")
s = a.split(" ")
dict = {01: A,
        1000: B,
        1010: C,
        100:D,
        0:E,
        0010:F,
        110: G,
        0000: H,
        00: I,
        0111:J,
        101: K,
        0100: L,
        11: M,
        10: N,
        111: O,
        0110: P,
        1101: Q,
        010: R,
        000: S,
        1: T,
        001: U,
        0001: V,
        011: W,
        1001: X,
        1011: Y,
        1100: Z,
        01111: 1,
        00111: 2,
        00011: 3,
        00001: 4,
        00000: 5,
        10000: 6,
        11000: 7,
        11100: 8,
        11110: 9,
        11111: 0,
        001100: ?,
        10010: /,
        101101: (),
        100001: -,
        010101: .,
        110011:,,
        011010:@,
        111000::,
        101010::,
        10001:=,
        011110:"",
        101011:!,
        001101:_,
        010010:",
        10110:(,
        1111011:{,
        1111101:}
        };
for item in s:
    print (dict[item],end=‘‘)

得到:

FLAG{M0RSE_CODE_1S_INTEREST1N9!}

提交错误 全改成小写就对了:

flag{m0rse_code_1s_interest1n9!}

 

bugku crypto easy-crypto

标签:字符串   inter   The   for   fun   string   bsp   col   pre   

原文地址:https://www.cnblogs.com/dyhaohaoxuexi/p/10790462.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!