题目变异凯撒,说明没有使用一般的凯撒加密

看到一个密码,我们可以找一下规律
首先密文不完全是字母,但是经典凯撒加密的密文一定都是字母,说明这个题目可能是ASCLL码表偏移,而不是字母表偏移

经典凯撒加密是字母和字母的偏移对应,如上图

观察一下ASCLL码表和字符串,可以感觉到我们的想法很可能正确
还是根据CTF题目的特点
afZ_应当对应flag
我们运行一下脚本看一下afZ_和flag的关系

text1="afZ_"
text2="flag"
for i in range(0,len(text1)):
offset=ord(text2[i])-ord(text1[i])
print(offset)
输出为
5
6
7
8
说明这个题目应该就是ASCLL码的偏移,偏移量从5开始递增
我们按照这个找出的加密原理写出解密脚本

text="afZ_r9VYfScOeO_UL^RWUc"
flag=""
for i in range(0,len(text)):
flag+=chr(ord(text[i])+(i+5))
print(flag)
flag{Caesar_variation}