Here is the program. It works great on the IDLE but, it crashes after asking if you know the password length. I can't seem to figure out want i'm missing. I would love any help.
import itertools import string import sys, os, cmd from datetime import datetime FMT = '%Y-%m-%d %H:%M:%S' passwordstried = 0 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0,] #symbols = [ lowercaseletters = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","g","h","j","k","l","z","x","c","v","b","n","m"] uppercaseletters = ["Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","G","H","J","K","L","Z","X","C","V","B","N","M"] stuff = lowercaseletters + uppercaseletters + numbers if (input("Do you have the length of the password?") == 'y'): lengthstartingvalue = int(input("Password length: ")) else: lengthstartingvalue = 0 starttime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') print(starttime) starttime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') for L in range(lengthstartingvalue, len(stuff)+1): for subset in itertools.combinations_with_replacement(stuff, L): print(subset) passwordstried = passwordstried + 1 if (L>lengthstartingvalue-1): break endtime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') elapsed = datetime.strptime(endtime, FMT) - datetime.strptime(starttime, FMT) print ('Time elapsed:',elapsed) print ('Passwords tried:',passwordstried)
input()as the last statement so that the window stays open until you hit <enter>