CTF中古典密码有时会有这个,为了便于查找,笔者将以前写过的一些脚本粘上来。
(二).猪圈密码:
图的左右两边字母相对应,如果遇到全是大写要在输入的时候要先转下码。网上还有一类是图,那个就不能了,可能用机器识别可以做
(三).贴上代码:
#!/usr/bin/env python #-*- coding:utf-8 -*- table = { 'a':'j','b':'k','c':'l','d':'m','e':'n','f':'o','g':'p','h':'q','i':'r','j':'a','k':'b', 'l':'c','m':'d','n':'e','o':'f','p':'g','q':'h','r':'i','s':'w','t':'x','u':'y','v':'z', 'w':'s','x':'t','y':'u','z':'v','A':'J','B':'K','C':'L','D':'M','E':'N','F':'O','G':'P', 'H':'Q','I':'R','J':'A','K':'B','L':'C','M':'D','N':'E','O':'F','P':'G','Q':'H','R':'I', 'S':'W','T':'X','U':'Y','V':'Z','W':'S','X':'T','Y':'U','Z':'V' } data = raw_input("Please Input your str:") new = "" for ch in data: if ch.isalpha(): new += table[ch] else: new += ch print("result: %s"%new)
(四).若有不足,还请斧正
原文:http://blog.51cto.com/daye8ku/2057540