密码强度判断

import string
password = input("请输入密码:")
strength, digits, lower, upper, punctuation = 0,0,0,0,0
for c in password :
if c in string.digits:
digits = 1
elif c in string.ascii_lowercase:
lower = 1
elif c in string.ascii_uppercase:
upper = 1
elif c in string.punctuation:
punctuation = 1
if len(password) < 8:
strength = 0
else:
strength = digits+lower+upper+punctuation
if strength < 2:
print("弱")
elif strength == 2:
print("中")
elif strength == 3:
print("强")
elif strength == 4:
print("极强")

 

密码强度判断

 

上一篇:1-11 Burpsuite 目录扫描探测


下一篇:BurpSuite+Proxifer 抓取PC客户端HTTP数据包