View difference between Paste ID: EhhP1Qds and b73m02uR
SHOW: | | - or go back to the newest paste.
1
crypt_file = open('ciphertext', 'rb')
2
decrypted_file = open('decrypted', 'a+', encoding = "latin-1")
3
4
printset = set(string.printable)
5
cry = crypt_file.read().strip()
6
7
with open('./rockyou.txt', 'r', encoding='latin-1') as ro:
8
    i = 0
9
    for line in ro:
10
        decrypted = decrypt(line.strip(), cry)
11
        decr_set = set(decrypted)
12
        if (decr_set.issubset(printset) & len(decrypted) > 0):
13
            formatted = "{} - {}".format(line, decrypted)
14
            print(formatted)
15
            decrypted_file.write(formatted + '\n')
16
            break
17
        #print('{} - {} - {}'.format(i,line.strip(),decrypted))
18
        if(i%10000==0):
19
            temp = '\r {} - {}'.format(i,line.strip())
20
            print(temp, end="\r",flush=True)  
21
        i = i + 1