杭电ctf杀手

       这个文本是单词掺杂在[a-z]字符里的.一句完整的英语显然是好几个完整的单词连一起的.所以,我们可以分割这个大字符串,可以利用常见单词2000个做字典,用python跑一下.以上是思路,代码如下

       

def wordcount(dictory,zifuchuan):
    count=0
    for i in range(len(dictory)):
        if(dictory[i] in zifuchuan):
            count=count+1
    return count
dictory=open('myword.txt','r').read().split()
aim=open('aimword.txt','r').read()
data=aim.split()
length=[]
for i in range(len(data)):
    if(wordcount(dictory,data[i])>10):
        length.append([wordcount(dictory,data[i]),data[i]])
length.sort()
for i in range(len(length) - 1, len(length) - 20 - 1, -1):
    print(length[i][1] + "\t" + str(length[i][0]))


其中aimword.txt是需要解读的文件,myword.txt是字典文件。

结果如下: 

第一句就是flag,“what will you see if you throw the butter out the window”.英语谜语butterfly

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值