Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password Guesser Project
#14
(Nov-19-2017, 04:43 PM)nilamo Wrote:
Quote:
for char1 in AlphaNum:    
    guessList[0] = AlphaNum[char1]

What are you trying to do here?  char1 already is a character in AlphaNum.  So why not just guessList[0] = char1?
Maybe more comments in my code will make it easier for you to understand:

#!/usr/bin/env python3
#PasswordGuesser.py
import sys

AlphaNum = "abc"
password = "cab"
guess = ""
AN_size = AlphaNum[len(AlphaNum)-1]
pastEnd = AlphaNum[len(AlphaNum)]
def passwordGuesser(n, i):#guessList[n], AlphaNum[i]
    #while guess != password:
        guess = ''.join(guessList)#convert guessList back to a string to be tested
        if guess == password:
            print("The password is " + guess)
            sys.exit()
        else:
            guessList = list(guess)#convert from immutable string to changable list
            firstChar = guessList[0]
            lastChar = guessList[-1]
            currChar = guessList[n]#pointer to the current char
            
            nextChar = guessList[n+1]#pointer to next char (currChar must have reached last char in AlphaNum,
                                     #before the nextChar moves/points to the next char in AlphaNum)
            
            previousChar = guessList[n-1]#This is needed to check two things:
                                         #if the previous char is the first char (guessList[0]), and if so, then
                                         #guessList[0] will always reset to the first char in AlphaNum again before
                                         #guessList[1] moves/points to the next char in AlphaNum
                                         #OR, if the previous char is not guessList[0], then we just need to make sure
                                         #that the previous char has pointed to (has reached) the last char in AlphaNum
                                         #before it resets to AlphaNum[0] and makes the current char move/point to the
                                         #next char in AlphaNum.
            
            if currChar <= AN_size and currChar < lastChar and previousChar == pastEnd:#if the current char has not yet reached/pointed to the
                                                            #last char in AlphaNum, and the current char is not the last char of our current
                                                            #guessList, and the previous char has already reached the last char in AlphaNum,
                
                currChar = AlphaNum[i+1]#then make the current guessList char point to the next char in AlphaNum,
                previousChar = AlphaNum[0]#and reset the previous char to point to AlphaNum[0]
                
            elif currChar == pastEnd and currChar == lastChar:#otherwise, if the current guessList char has already pointed to every char
                                                              #in AlphaNum, and that current guessList char is the last (rightmost) char in
                                                              #our current guessList
                
                    replaceList.append(AlphaNum[0])#then increase the guessList length
                guessList = passwordGuesser(n, i)
Again, think about the old car odometer algorithm I spoke of in my previous post, as it's critical to understanding what I'm trying to do.
Reply


Messages In This Thread
Password Guesser Project - by RedSkeleton007 - Oct-22-2017, 05:46 AM
RE: Password Guesser Project - by Lux - Oct-22-2017, 02:55 PM
RE: Password Guesser Project - by RedSkeleton007 - Oct-22-2017, 08:05 PM
RE: Password Guesser Project - by Lux - Oct-22-2017, 09:21 PM
RE: Password Guesser Project - by RedSkeleton007 - Oct-23-2017, 02:10 AM
RE: Password Guesser Project - by Lux - Oct-29-2017, 01:54 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-01-2017, 05:44 PM
RE: Password Guesser Project - by nilamo - Nov-01-2017, 06:41 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-13-2017, 03:53 AM
RE: Password Guesser Project - by metulburr - Nov-13-2017, 04:01 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-13-2017, 05:10 AM
RE: Password Guesser Project - by nilamo - Nov-19-2017, 04:43 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-20-2017, 07:03 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-27-2017, 05:33 AM
RE: Password Guesser Project - by nilamo - Nov-27-2017, 06:42 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-28-2017, 08:58 PM
RE: Password Guesser Project - by nilamo - Nov-29-2017, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Brute Force Password Guesser 2skywalkers 1 3,223 Oct-05-2018, 08:04 PM
Last Post: ichabod801
  Brute Force Pad Lock Guesser RedSkeleton007 4 4,010 Mar-03-2018, 07:42 AM
Last Post: RedSkeleton007
  Speeding up Brute force password guesser Gamervote 5 6,923 Jul-20-2017, 02:52 PM
Last Post: nilamo
  Password Hacker Science Project BenjC 2 4,979 Apr-17-2017, 07:36 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020