zoukankan      html  css  js  c++  java
  • 攻防世界-密码学-告诉你一个秘密

    1.题目信息

    附件为两行数字与字母组成的字符串。

    2. 分析

    字符串中的字母均未超过E,猜测是16进制编码,于是先将字符串进行16进制解码,解码之后看上去像base64编码,于是接着进行base64解码,得到两段全由字母组成的字符串,并且被空格隔开,每小段字符串包含3-4个字母,解密的方法就在眼前——键盘,每小段字符串的字母围起来的字母就是明文。

    3.解题

    Python代码如下:

    from base64 import b64decode
    
    def solve():
        cips=[
                '636A56355279427363446C4A49454A7154534230526D6843',
                '56445A31614342354E326C4B4946467A5769426961453067'
                ]
        msgs=[]
        for cip in cips:
            msgs.append(b64decode(cip.decode('hex')))
        return msgs
    
    if __name__=='__main__':
        print solve()
    

    运行程序得到如下结果:

    $ python solve.py
    ['r5yG lp9I BjM tFhB', 'T6uh y7iJ QsZ bhM ']
    

    接下来在键盘上找每小段字符串的字母围起来的字母,得到flag为tongyuan。

  • 相关阅读:
    一、异常
    自控力_第三章
    Vocabulary Recitation 2020/05/05
    Vocabulary Recitation 2020/05/04
    Vocabulary Recitaion 2020/05/03
    Vocabulary Recitation 2020/05/01
    最大子序列和
    Vocabulary Recitation 2020/04/29
    自控力_第二章
    Vocabulary Recitation 2020/04/27
  • 原文地址:https://www.cnblogs.com/coming1890/p/13497736.html
Copyright © 2011-2022 走看看