练习平台地址
竞赛中心
题目描述
题目内容
就是破译!!!
解题
观察到最后一段是四个字母加上{xxxxx}的形式,很像flag,我们猜测要破译的主要是这个片段
大括号依然存在,那么可能是通过凯撒密码来加密的(位移字母)
编写凯撒密码脚本(加密、26一循环)
def broken(strs):for i in range(1, 26):a = []a += [''.join(chr((ord(j)+i)%91+65) for j in strs)]print('位移'+ str(i) +' '+ a[0])if __name__ == "__main__":inputs = "X8SY"broken(inputs)
或者使用在线网站
在线凯撒密码加密解密
这个F8AG长得像FLAG,猜测最后结果是要将8变成L,找出其他数字与字母的对应关系还原出真正的flag
根据内容猜测
F8AG | 8=L |
BAS7ETVA88 | 7=K |
1F、T1 | 1=O |
9ADE、9A7E | 9=M |
TH5S、SA5D、85VES | 5=I |
0BA、CH50A、A0D | 0=N |
THE54、A4E、1U4 | 4=R |
DEVE8129E0T | 2=P |
BE5650G | 6=J |
汇总成python脚本
def broken(strs):out = ''for i in strs:# 遍历到字母以外的跳过if ord(i) >= 65 and ord(i) <= 90:out += chr((ord(i) -65 + 8)% 26 + 65)else:if i == '0':out += 'N'elif i == '1':out += 'O'elif i == '2':out += 'P'elif i == '4':out += 'R'elif i == '5':out += 'I'elif i == '6':out += 'J'elif i == '8':out += 'L'elif i == '9':out += 'M'else:out += i print(out)if __name__ == "__main__":inputs = '''TW5650Y - 0TS UZ50S S0V LZW UZ50WKW 9505KL4G 1X WVMUSL510 S001M0UWV 910VSG S0 WFLW0K510 1X LZW54 WF5KL50Y 2S4L0W4KZ52 L1 50U14214SLW X5L0WKK S0V TSK7WLTS88 VWNW8129W0L 50 W8W9W0LS4G, 95VV8W S0V Z5YZ KUZ118K SU41KK UZ50S.LZW S001M0UW9W0L ESK 9SVW SL S K5Y050Y UW4W910G L1VSG TG 0TS UZ50S UW1 VSN5V KZ1W9S7W4 S0V FM LS1, V54WUL14 YW0W4S8 1X LZW 50LW40SL510S8 U112W4SL510 S0V WFUZS0YW VW2S4L9W0L 1X LZW 9505KL4G 1X WVMUSL510.
"EW S4W WFU5LWV L1 T41SVW0 1M4 2S4L0W4KZ52 E5LZ LZW 9505KL4G 1X WVMUSL510 L1 9S7W S 810Y-8SKL50Y 592SUL 10 LZW 85NWK 1X UZ50WKW KLMVW0LK LZ41MYZ S 6150L8G-VWK5Y0WV TSK7WLTS88 UM445UM8M9 S0V S E5VW 4S0YW 1X KUZ118 TSK7WLTS88 241Y4S9K," KS5V KZ1W9S7W4. "LZ5K U1995L9W0L 9S47K S01LZW4 958WKL10W 50 LZW 0TS'K G1MLZ S0V TSK7WLTS88 VWNW8129W0L WXX14LK 50 UZ50S." X8SY { YK182V9ZUL9STU5V}'''broken(inputs)
flag
FLAG{GSOLPDMHCTMABCID}
注意事项
1.凯撒密码加解密算法可逆,就是偏移,26字母一循环
2.提交flag的时候要注意删除多余的空格