昨天翻硬盤,找到一個好東西,可惜自己加了密碼自己不記得了。試了幾個常用的沒試出來,于是寫了這么個小腳本來替我嘗試。。呵呵,還真給解出來了。
python腳本內容如下,跑跑自己加密的壓縮包還不錯
代碼如下:
# -*- coding: utf-8 -*-
import sys,os
def IsElementUniq(list):
"""
判斷list中的元素是否為唯一的
"""
for word in list:
if list.count(word)>1:
return False
return True
def GenPswList():
"""
要求用戶輸入詞,并根據單詞組合密碼,只嘗試四個單詞來組合,并限制密碼長度為20。寫的比較挫
"""
psw=raw_input('input a word>')
wordlist = []
while psw:
wordlist.append(psw)
psw=raw_input('input a word>')
print wordlist
global g_pswlist
g_pswlist = []
for word in wordlist:
g_pswlist.append(word)
for word1 in wordlist:
for word2 in wordlist:
locallist = [word1, word2]
if IsElementUniq(locallist):
tmp = word1 + word2
if len(tmp) < 20:
g_pswlist.append(tmp)
for word1 in wordlist:
for word2 in wordlist:
for word3 in wordlist:
locallist = [word1, word2, word3]
if IsElementUniq(locallist):
tmp = word1 + word2 + word3
if len(tmp) < 20:
g_pswlist.append(tmp)
新聞熱點
疑難解答