caeser凯撒密码&rot13
import base64
# caeser凯撒密码1-27
content = "qiPGS{3apElcg1ba_1f_r4fl}"
result = ""
for i in range(1,27):
for c in content:
oc = ord(c)
if oc >= 65 and oc <=90:
result += chr(((oc+i)-65)%26 +65)
elif oc >= 97 and oc <=122:
result += chr(((oc+i)-97)%26 +97)
else:
result += c
print("rot=",i,result,result.lower())
result = ""
# Rot13
content = "qiPGS{3apElcg1ba_1f_r4fl}"
i = 13
result = ""
for c in content:
oc = ord(c)
if oc >= 65 and oc <=90:
result += chr(((oc+i)-65)%26 +65)
elif oc >= 97 and oc <=122:
result += chr(((oc+i)-97)%26 +97)
else:
result += c
print("rot=",i,result)