Skip to content

Commit d58e0f6

Browse files
authored
Add files via upload
1 parent 7116b4d commit d58e0f6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# importing random
2+
from random import *
3+
4+
# taking input from user
5+
user_pass = input("Enter your password")
6+
7+
# storing alphabet letter to use thm to crack password
8+
password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
9+
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
10+
'w', 'x', 'y', 'z', ]
11+
12+
# initializing an empty string
13+
guess = ""
14+
15+
# using while loop to generate many passwords untill one of
16+
# them does not matches user_pass
17+
while (guess != user_pass):
18+
guess = ""
19+
# generating random passwords using for loop
20+
for letter in range(len(user_pass)):
21+
guess_letter = password[randint(0, 25)]
22+
guess = str(guess_letter) + str(guess)
23+
# printing guessed passwords
24+
print(guess)
25+
26+
# printing the matched password
27+
print("Your password is", guess)

0 commit comments

Comments
 (0)