File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1
1
Master
2
- #This document helps to understand python in detail.And tells you More Information
2
+ # This document helps to understand python in detail.And tells you More Information
3
3
=======
4
- #This document helps to understand python in details.
4
+ # This document helps to understand python in details.
5
5
master
6
6
# My Python Examples for everyone
7
7
=======
Original file line number Diff line number Diff line change
1
+ import itertools
2
+
3
+ def generate_password_permutations (length ):
4
+ # Generate numeric password permutations of the given length
5
+ digits = "0123456789"
6
+ for combination in itertools .product (digits , repeat = length ):
7
+ password = "" .join (combination )
8
+ yield password
9
+
10
+ def password_cracker (target_password , max_length = 8 ):
11
+ # Try different password lengths and generate permutations
12
+ for length in range (1 , max_length + 1 ):
13
+ password_generator = generate_password_permutations (length )
14
+ for password in password_generator :
15
+ if password == target_password :
16
+ return password
17
+ return None
18
+
19
+ if __name__ == "__main__" :
20
+ # Target numeric password (change this to the password you want to crack)
21
+ target_password = "9133278"
22
+
23
+ # Try cracking the password
24
+ cracked_password = password_cracker (target_password )
25
+
26
+ if cracked_password :
27
+ print (f"Password successfully cracked! The password is: { cracked_password } " )
28
+ else :
29
+ print ("Password not found. Try increasing the max_length or target a different password." )
30
+
You can’t perform that action at this time.
0 commit comments