培根密码脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了培根密码脚本相关的知识,希望对你有一定的参考价值。

Upper = {
            "A":"aaaaa","a":"AAAAA",
            "B":"aaaab","b":"AAAAB",
            "C":"aaaba","c":"AAABA",
            "D":"aaabb","d":"AAABB",
            "E":"aabaa","e":"AABAA",
            "F":"aabab","f":"AABAB",
            "G":"aabba","g":"AABBA",
            "H":"aabbb","h":"AABBB",
            "I":"abaaa","i":"ABAAA",
            "J":"abaab","j":"ABAAA",
            "K":"ababa","k":"ABAAB",
            "L":"ababb","l":"ABABA",
            "M":"abbaa","m":"ABABB",
            "N":"abbab","n":"ABBAA",
            "O":"abbba","o":"ABBAB",
            "P":"abbbb","p":"ABBBA",
            "Q":"baaaa","q":"ABBBB",
            "R":"baaab","r":"BAAAA",
            "S":"baaba","s":"BAAAB",
            "T":"baabb","t":"BAABA",
            "U":"babaa","u":"BAABB",
            "V":"babab","v":"BAABB",
            "W":"babba","w":"BABAA",
            "X":"babbb","x":"BABAB",
            "Y":"bbaaa","y":"BABBA",
            "Z":"bbaab","z":"BABBB"
            }
str = ‘‘
alp=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

f = open(r"C:\Users\test404\Desktop\tes.txt")  #将培根密码放在txt文本中 

for line in f.readlines():
    line = line.strip(\n)  
    for value in alp:
        if line == Upper[value]:
        str = str+value
print str

 

 
 

以上是关于培根密码脚本的主要内容,如果未能解决你的问题,请参考以下文章

CTF---密码学入门第二题 我喜欢培根

2021-05-07

常用python日期日志获取内容循环的代码片段

实验吧-密码学

Lineageos 培根构建失败

基本密码