forked from seeditsolution/pythonprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgreatearno
More file actions
26 lines (20 loc) · 712 Bytes
/
Copy pathgreatearno
File metadata and controls
26 lines (20 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# importing random
from random import *
# taking input from user
user_pass = input("Enter your password")
# storing alphabet letter to use thm to crack password
password = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0',]
# initializing an empty string
guess = ""
# using while loop to generate many passwords untill one of
# them does not matches user_pass
while (guess != user_pass):
guess = ""
# generating random passwords using for loop
for letter in range(len(user_pass)):
guess_letter = password[randint(0, 25)]
guess = str(guess_letter) + str(guess)
# printing guessed passwords
print(guess)
# printing the matched password
print("Your password is",guess)