第三届上海市大学生网络安全大赛------classical

decrypt

1,词频分析
第三届上海市大学生网络安全大赛------classical_第1张图片
在这里插入图片描述
接着解密:
LyjtL3fvnSRlo2xvKIjrK2ximSHkJ3ZhJ2Hto3x9

import base64
s='LyjtL3fvnSRlo2xvKIjrK2ximSHkJ3ZhJ2Hto3x9'
import pycipher
import copy
for i in range(26):
    c=''
    for j in range(len(s)):
        if s[j].isalpha():
            if s[j].islower():
                c += chr(((ord(s[j]) + i-97) %26)+97)
            else:
                c+=chr(65+(ord(s[j])-65+i)%26)
        else:
            c+=s[j]
    print(c)
    print(base64.b64decode(c))

你可能感兴趣的:(凯撒密码,编码)