Python Password Project Help

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: kgudger, bfinio, Moderators

Locked
wderekm
Posts: 2
Joined: Thu Nov 05, 2015 3:32 pm
Occupation: Parent

Python Password Project Help

Post by wderekm »

I've run into a little problem helping my son with the "Password Security: How Easily Can Your Password Be Cracked?" project. Specifically, "method 2" of searching, which involves a password wheel, takes far too long on our computer to find a six character password (upwards of three hours).

Is there a way to change the code to only search for lowercase letters and numbers, as opposed to uppercase, lowercase, and numbers? I think that would help expedite the program's search and make the project more doable.

Thank you.
HowardE
Posts: 496
Joined: Thu Nov 20, 2014 1:35 pm
Occupation: Science Buddies content developer
Project Question: N/A
Project Due Date: N/A
Project Status: Not applicable

Re: Python Password Project Help

Post by HowardE »

Yes, of course. The project just screams to be modified, tweaked and added to. In that method, the "wheel" is defined by this:

Code: Select all

    wheel = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
You can take out the uppercase letters and just use this:

Code: Select all

    wheel = " abcdefghijklmnopqrstuvwxyz0123456789"
A little further down is a line of code that determines whether it has counted all the way around the wheel. With 26 upper case, 26 lower case and 10 numbers, we had 26+26+10 or 62 characters. Now we just have 26+10 or 36.

Change

Code: Select all

if pass_wheel_array[i] > 62:
to

Code: Select all

if pass_wheel_array[i] > 36:
I'm sure you realize that many people use uppercase characters in passwords. So let me pose a question that might be helpful in your son's presentation of the project. If it takes a computer so much longer to consider uppercase characters in a password, does that make using a mixture of upper and lower in a password better? If you do the calculations, what does that do for the time?

Please write back if you have any other questions.

Howard

(EDIT - I put a blank space after the first quote in each of the first two code lines. That's critical to the way the program operates)
Last edited by HowardE on Fri Nov 06, 2015 10:47 am, edited 1 time in total.
wderekm
Posts: 2
Joined: Thu Nov 05, 2015 3:32 pm
Occupation: Parent

Re: Python Password Project Help

Post by wderekm »

Howard, thank you very much for the help. I had changed the characters in the wheel but overlooked the second change. May I just suggest for anyone else with a similar question, the initial wheel contains a space after the quotation mark (it begins wheel = " ABC...") and I think that should be carried forward with the change. I ran into an error by deleting it.

And yes, I explained to him that the total amount of guesses is exponentially related to the total amount of characters being searched for (i.e. 62^(characters in password) vs 36^(characters in password)), but for application purposes (he wants to run a series of passwords through the program to see how long they each take) we had to cut down the characters.

Thank you again.
HowardE
Posts: 496
Joined: Thu Nov 20, 2014 1:35 pm
Occupation: Science Buddies content developer
Project Question: N/A
Project Due Date: N/A
Project Status: Not applicable

Re: Python Password Project Help

Post by HowardE »

I'm glad you were able to fix your problem. Yes, the space is there to act as a wheel position that amounts to "not in use". It got lost when I posted here and i didn't realize it but it is critical to that code. Thank you for clarifying that.

Wish your son luck with his presentation for me.

Howard
maxwellkoke951
Posts: 1
Joined: Sat Jan 16, 2016 2:48 pm
Occupation: Student

Re: Python Password Project Help

Post by maxwellkoke951 »

Hello, i am doing the same project and am having trouble editing the code in order to get password 0 and 6. I could use some more guidance, I went through the other threads/ forums on this project and am still having trouble.
Thanks,
Max
HowardE
Posts: 496
Joined: Thu Nov 20, 2014 1:35 pm
Occupation: Science Buddies content developer
Project Question: N/A
Project Due Date: N/A
Project Status: Not applicable

Re: Python Password Project Help

Post by HowardE »

Hi maxwellkoke951-

Password 0 is a plain text password that goes through the verification test without being encoded. Passwords 1 through 6 are encoded in MD5 hash, so when the algorithms decide in what they want to try as a password, the guess is converted to a hash with MD5me() first. Then the two hashes are compared. Password 0 is different. It's set up to be compared in plain text so all you need to do is set it to whatever you want the algorithm to guess. As you downloaded the code it was set to "314". Somewhere around line 376 in the code you'll see this:

Code: Select all

    # This is a place for you to set a password of your own
    password0 = "314"
So let's say you modified one of the guessing methods to concentrate on words for colors. You might then change that line to:

Code: Select all

	password0 = "blue"
Can you explain what problem you're having in more detail? As provided, the code will already guess passwords 0 through 5. If you change password 0, the program may or may not guess it, depending on what you changed it to.

Howard
Locked

Return to “Grades 9-12: Math and Computer Science”