暴力尝试安卓gesture.key

import hashlib
import os
import itertools


f = open(r'D:KEYgesture.key','r')
psd = f.readline()
f.close()
ANS = psd.encode('hex')
print ANS


b = ['00','01','02','03','04','05','06','07','08']


cool = False

for i in range(9,10):
    qq = itertools.permutations(b,i)
    nl = list(qq)
    for j in range(0,len(nl)):
        t1=''.join(nl[j])
        t2 = hashlib.sha1(t1.decode('hex')).hexdigest()
        if(t2==ANS):
            print 'the answer is :'+str(nl[j])
            cool = True
            break;
        if(cool==True):
            break;
    if(cool==True):
        break;

if(cool==False):
    print 'Sorry...'
原文地址:https://www.cnblogs.com/fish7/p/4342625.html