Skip to content

Commit c6b3738

Browse files
Merge pull request #1930 from NitkarshChourasia/master
Numeric Password Cracker
2 parents 5929c11 + 231c9b8 commit c6b3738

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
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
33
=======
4-
#This document helps to understand python in details.
4+
# This document helps to understand python in details.
55
master
66
# My Python Examples for everyone
77
=======

numeric_password_cracker.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+

0 commit comments

Comments
 (0)