xSavagEx
Posts: 4
Joined: Sun Jan 08, 2017 2:03 pm
Occupation: Student

URGENT!!! Python Password Cracker: No output

Postby xSavagEx » Sun Jan 08, 2017 2:24 pm

I am in the 6th grade and I've been doing this Python Password Cracker project. The code just doesn't see to be cooperating. I use the compiler Visual Studio on the operating system Windows 7 (If this even matters). I tried putting only the code for search method 3 on the compiler and nothing comes for the output. So, I go to the site where I learn coding, Sololearn.com. They have a code playground to type in your own code if you don't have a compiler. They same result came there too, No output! Can someone help me? I'm not trying to rush you or be rude, but I need a response by the January 10th, 2017 because the project is due by the 13 (I was busy trying to work the code). I really need a response so I can get into NARSEF (North Alabama Regional Science Engineering Fair). Thanks in advance.

Here's the code for Search Method 3 that I put in the compiler. The exact everything.

Code: Select all

# search method 3 uses a list of dictionary words. In this case, we have a list
# of the 500 most commonly used passwords in 2005 as collected by Mark Burnett
# for his book "Perfect Passwords" (ISBN 978-1597490412). Because the list comes
# from so many people around the world, we had to remove some of the passwords.
# People like to use passwords that they think will shock other people, so
# sometimes they're not fit for polite company.


def search_method_3(file_name):
    global totalguesses
    result = False
   
    # Start by reading the list of words into a Python list
    f = open(file_name)
    words = f.readlines()
    f.close
    # We need to know how many there are
    number_of_words = len(words)
    print("Using method 3 with "+str(number_of_words)+" in the list")
   
    ## Depending on the file system, there may be extra characters before
    ## or after the words.
    for i in range(0, number_of_words):
        words[i] = cleanup(words[i])

    # Let's try each one as the password and see what happens
    starttime = time.time()
    tests = 0
    still_searching = True
    word1count = 0           # Which word we'll try next

    while still_searching:
        ourguess_pass = words[word1count]
        print("Guessing: "+ourguess_pass)
        # Try it the way it is in the word list
        if (check_userpass(which_password, ourguess_pass)):
            print ("Success! Password "+str(which_password)+" is " + ourguess_pass)
            still_searching = False   # we can stop now - we found it!
            result = True
        else:
            print ("Darn. " + ourguess_pass + " is NOT the password.")
        tests = tests + 1
        totalguesses = totalguesses + 1
        # Now let's try it with the first letter capitalized
        if still_searching:
            ourguess_pass = Cap(ourguess_pass)
            print("Guessing: "+ourguess_pass)
            if (check_userpass(which_password, ourguess_pass)):
                print ("Success! Password "+str(which_password)+" is " + ourguess_pass)
                still_searching = False   # we can stop now - we found it!
                result = True
            else:
                print ("Darn. " + ourguess_pass + " is NOT the password.")
            tests = tests + 1
            totalguesses = totalguesses + 1

        word1count = word1count + 1
        if (word1count >=  number_of_words):
            still_searching = False

    seconds = time.time()-starttime
    report_search_time(tests, seconds)
    return result

xSavagEx
Posts: 4
Joined: Sun Jan 08, 2017 2:03 pm
Occupation: Student

Re: URGENT!!! Python Password Cracker: No output

Postby xSavagEx » Sun Jan 08, 2017 3:57 pm

I've downloaded both files needed to be downloaded and put them in the same file. Crack2.py will close the moment I put a # 1-6 and press enter. Also, wherever it says file_name, are you supposed to put "passwords" in there? Whenever I put that it still gives no output. Please help!


Return to “Grades 6-8: Math and Computer Science”