-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
38 lines (29 loc) · 1.04 KB
/
Copy pathcode.py
File metadata and controls
38 lines (29 loc) · 1.04 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
from zxcvbn import zxcvbn
def check_password_strength(password):
result = zxcvbn(password)
score = result['score']
feedback = result['feedback']
crack_times = result['crack_times_display']
strength_levels = {
0: "Very Weak",
1: "Weak",
2: "Fair",
3: "Strong",
4: "Very Strong"
}
print("\n========== PASSWORD ANALYSIS ==========")
print(f"Strength Score : {score}/4")
print(f"Strength Level : {strength_levels[score]}")
print("\nEstimated Crack Times:")
for method, time in crack_times.items():
print(f" {method}: {time}")
if feedback['warning'] or feedback['suggestions']:
print("\nFeedback:")
if feedback['warning']:
print(" Warning:", feedback['warning'])
for suggestion in feedback['suggestions']:
print(" Suggestion:", suggestion)
print("=======================================")
if __name__ == "__main__":
password = input("Enter your password: ")
check_password_strength(password)