比较Low的解密方案:
根据图形可以知道他们之间的对应关系。(映射关系)
# -*- coding:utf-8 -*-
# **********************************
# ** http://weibo.com/lixiaodaoaaa #
# ** create at 2017/6/11 00:09 ***
# ****** by:lixiaodaoaaa ***********
import string
def myTrans(letter):
if len(letter.strip()) < 1:
return " "
if letter == "y":
return "a"
if letter == "z":
return "b"
if letter == ".":
return "."
letterCode = ord(letter)
return chr(letterCode + 2)
myStr = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
resultStr = ""
print(myTrans(" "))
print("purpose", ord("a"))
print(ord("y"))
print(ord("z"))
# -*- coding:utf-8 -*-
# **********************************
# ** http://weibo.com/lixiaodaoaaa #
# ** create at 2017/6/11 00:57 ***
# ****** by:lixiaodaoaaa ***********
import string
old_url = "http://www.pythonchallenge.com/pc/def/map.html"
if __name__ == '__main__':
table1 = "abcdefghijklmnopqrstuvwxyz"
table2 = "cdefghijklmnopqrstuvwxyzab"
new_table = string.maketrans(table1, table2)
newStr = string.translate("map", new_table)
print old_url.replace("map", newStr)