凯撒移位密码python_古典密码学 凯撒密码 Python 实现 Caesar Cipher in Python
原理将26个英文字母分别对应一个数字,循环移位。移位的个数是密钥。如密钥是B,则移位1位;如密钥是C,则移位2位,以此类推。密钥是C(移位2位)对应图如图所示:代码classCaesarCipher:map1={"A":0,"B":1,"C":2,"D":3,"E":4,"F":5,"G":6,"H":7,"I":8,"J":9,"K":10,"L":11,"M":12,"N":13,"O":14