Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def brute_force_crack(hashed_pass):
- char_list = create_possible_chars()
- # Store all string combinations
- password = ""
- # Build the combos adding each letter to each prefix and then to combos.
- def build_combos(curr_str):
- nonlocal password
- # Check password to return early
- if password != "":
- return
- if len(curr_str) == 4:
- return
- for letter in char_list:
- # Add letter to curr_str to build up the combo
- curr_str += letter
- if is_password(curr_str, hashed_pass):
- password = curr_str
- break
- build_combos(curr_str)
- # Reset curr_str to be used again in this iteration without the added letter
- curr_str = curr_str[:-1]
- build_combos("")
- return password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement