[go: up one dir, main page]

0% found this document useful (0 votes)
25 views1 page

PSWRD Guesser Pycde

The document contains a Python script that attempts to guess a user-defined password by generating random combinations of characters. It uses a predefined list of numbers and letters to create guesses until it matches the input password. The script tracks the number of attempts made to find the correct password.

Uploaded by

p09vishnu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

PSWRD Guesser Pycde

The document contains a Python script that attempts to guess a user-defined password by generating random combinations of characters. It uses a predefined list of numbers and letters to create guesses until it matches the input password. The script tracks the number of attempts made to find the correct password.

Uploaded by

p09vishnu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import random

# Guessing password
pas = input("Enter the password to hack: ")
# Definition of possible characters (numbers + letters)
keys = ["1","2","3","4","5","6","7","8","9","0",
"a","b","c","d","e","f","g","h","i","j","k",
"l","m","n","o","p","q","r","s","t","u","v",
"w","x","y","z"]
# Variable Initialization
pwg = ""
attempts = 0 # Compteur d'essais
# Loop until you find the right password
while pwg != pas:
pwg = "" # Réinitialisation du mot de passe deviné
for i in range(len(not)): # Creating a password of the same length
guessPass = random. choice(keys) # Choosing a random character
pwg += guessPass # Adding in the right order
attempts += 1 # Incrémentation du compteur
print(f"Attempt {attempts}: {pwg}") # display password tested
print(f"\nPassword found after {attempts} attempts: {pwg}")

You might also like