题目:
import base64
def caesar(plaintext):
str_list = list(plaintext)
i = 0
while i < len(plaintext):
if not str_list[i].isalpha():
str_list[i] = str_list[i]
else:
a = "A" if str_list[i].isupper() else "a"
str_list[i] = chr((ord(str_list[i]) - ord(a) + 5) % 26 + ord(a) or 5)
i = i + 1
return ''.join(str_list)
flag = "*************************"
str = caesar(flag)
print(str)
#str="U1hYSFlLe2R0em1mYWpwc3RiaGZqeGZ3fQ=="
根据最后str的格式,应该为base64编码过的,先解码得到
SXXHYK{dtzmfajpstbhfjxfw}
再看代码,数字不变,大小写字母右移五位,还原后得到
NSSCTF{youhaveknowcaesar}