加密_easy_crypto

题目链接:https://ctf.bugku.com/challenges

题解:

打开题目,观察这一串数组,发现每一组都是由0和1组成,且长短不一;找到了mrose和ascii的对应表,mrose和ascii对应表链接:https://pan.baidu.com/s/1qaE5AjcORTBrI_In6TNaSw

虽然原理倒是懂了,可是不可能一个一个的进行对比啊,太浪费时间咯。因此,无聊至极,写了一个c#代码进行转换,话不多说,源代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string oldstr;
            oldstr = Console.ReadLine();
            string []str = oldstr.Split(' ');
            for (int i = 0; i < str.Length; i++)
            {
                switch (str[i])
                {
                    case "01":
                        Console.Write("A"); break;
                    case "1000":
                        Console.Write("B"); break;
                    case "1010":
                        Console.Write("C"); break;
                    case "100":
                        Console.Write("D"); break;
                    case "0":
                        Console.Write("E"); break;
                    case "0010":
                        Console.Write("F"); break;
                    case "110":
                        Console.Write("G"); break;
                    case "0000":
                        Console.Write("H"); break;
                    case "00":
                        Console.Write("I"); break;
                    case "0111":
                        Console.Write("J"); break;
                    case "101":
                        Console.Write("K"); break;
                    case "0100":
                        Console.Write("L"); break;
                    case "11":
                        Console.Write("M"); break;
                    case "10":
                        Console.Write("N"); break;
                    case "111":
                        Console.Write("O"); break;
                    case "0110":
                        Console.Write("P"); break;
                    case "1101":
                        Console.Write("Q"); break;
                    case "010":
                        Console.Write("R"); break;
                    case "000":
                        Console.Write("S"); break;
                    case "1":
                        Console.Write("T"); break;
                    case "001":
                        Console.Write("U"); break;
                    case "0001":
                        Console.Write("V"); break;
                    case "011":
                        Console.Write("W"); break;
                    case "1001":
                        Console.Write("X"); break;
                    case "1011":
                        Console.Write("Y"); break;
                    case "1100":
                        Console.Write("Z"); break;

                    case "01111":
                        Console.Write("1"); break;
                    case "00111":
                        Console.Write("2"); break;
                    case "00011":
                        Console.Write("3"); break;
                    case "00001":
                        Console.Write("4"); break;
                    case "00000":
                        Console.Write("5"); break;
                    case "10000":
                        Console.Write("6"); break;
                    case "11000":
                        Console.Write("7"); break;
                    case "11100":
                        Console.Write("8"); break;
                    case "11110":
                        Console.Write("9"); break;
                    case "11111":
                        Console.Write("0"); break;

                    case "001100":
                        Console.Write("?"); break;
                    case "10010":
                        Console.Write("/"); break;
                    case "100001":
                        Console.Write("-"); break;
                    case "010101":
                        Console.Write("."); break;
                    case "110011":
                        Console.Write(","); break;
                    case "011010":
                        Console.Write("@"); break;
                    case "111000":
                        Console.Write(":"); break;
                    case "101010":
                        Console.Write(";"); break;
                    case "10001":
                        Console.Write("="); break;
                    case "011110":
                        Console.Write("'"); break;
                    case "101011":
                        Console.Write("!"); break;
                    case "001101":
                        Console.Write("_"); break;
                    case "010010":
                        Console.Write("\""); break;
                    case "10110":
                        Console.Write("("); break;
                    case "101101":
                        Console.Write(")"); break;
                    case "0001001":
                        Console.Write("$"); break;
                    case "01000":
                        Console.Write("&"); break;
                }
            }
        }
    }
}

跑下代码,运行结果如下:

得到:

FLAGM0RSE_CODE_1S_INTEREST1N9!

但是问题来了,提交flag为  FLAG{M0RSE_CODE_1S_INTEREST1N9!}  时不正确,可能是因为要求答案为小写吧,于是修改flag为小写,注意其中有字符“1”、“0”、“9”,不要与字母弄混了哟

所以本题flag:

flag{m0rse_code_1s_interest1n9!}

 

posted @ 2019-02-11 12:41  gzu_zb  阅读(2476)  评论(0编辑  收藏  举报