Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char = 'abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ1234567890@#$&!-_'
- class creation:
- def make_my_own():
- return input('password here: ')
- def random_password():
- try:
- length = int(input('lengh of randomly generated password: '))
- except:
- length = 4
- print("You didn't put a number. Pretty uncool you know, so it'll automatically be 4")
- y = ''
- import random
- for x in range(length):
- y += random.choice(char)
- return y
- def choice():
- passwordchoice = input('random or your own [random]/[own]: ')
- if passwordchoice == 'random':
- return creation.random_password()
- elif passwordchoice == 'own':
- return creation.make_my_own()
- else:
- print('invalid choice')
- password = choice()
- def brute():
- guessing = ' '
- addchar = 'a'
- position_char = 0
- position_guessing = 0
- while guessing != password:
- while position_char != len(char):
- guessing = guessing.replace(guessing[position_guessing],addchar)
- position_char += 1
- try:
- addchar = char[position_char]
- except:
- print('i breaked') #test
- break
- print(guessing,addchar,position_char) #test
- guessing += ' '
- position_guessing = position_guessing + 1
- print(position_guessing) #test
- position_char = 0
- #position_guessing = 0
- addchar = 'a'
- print('do i loop') #test
- Brute()
Add Comment
Please, Sign In to add comment