Python预估破译密码所需时间

密码长度、组成不同时,破译密码需要的时间也不同
用python判断一下破解该密码需要多长时间

# # 判断破译密码所需要的时间,对着理论表格敲代码就行了。
password = input()
length = len(password)
upcase = 'QWERTYUIOPASDFGHJKLZXCVBNM'
lowcase = 'qwertyuiopasdfghjklzxcvbnm'
num = '0123456789'
symbol = '~!@#$%^&*()_+{}|":?><`,./;[]\=-?\'。、()!?'
# # 最开始设置含有字母、数字、字符为False
contain_upcase = False
contain_lowcase = False
contain_num = False
contain_symbol = False

# # local = bool(re.findall(password, alpha))  # # 找到返回True,没找到返回False
# # print(local)

if length == 1:
    if password in num:
        print('破解密码需要:200皮秒')
    if password in symbol:
        print('破解密码需要:300皮秒')
    if password in upcase:
        print('破解密码需要:600皮秒')
    if password in lowcase:
        print('破解密码需要:600皮秒')
elif length == 2:
    for i in password:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
    if password.isnumeric():  # # 纯数字
        print('破解密码需要:2纳秒')
    if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # # 大小写
        print('破解密码需要:67纳秒')
    if contain_lowcase and not contain_upcase and not contain_symbol and not contain_num:  # # 纯小写
        print('破解密码需要:16纳秒')
    if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # # 数字、符号
        print('破解密码需要:15纳秒')
    if contain_num and contain_upcase and not contain_lowcase and not contain_upcase:  # # 数字大写
        print('破解密码需要:32纳秒')
    if contain_upcase and not contain_lowcase and not contain_upcase and not contain_symbol:  # #纯大写
        print('破解密码需要:16纳秒')
    if contain_lowcase and contain_symbol and not contain_num and not contain_upcase:  # # 小写符号
        print('破解密码需要:42纳秒')
    if not contain_lowcase and contain_symbol and not contain_num and contain_upcase:  # # 大写符号
        print('破解密码需要:42纳秒')
elif length == 3:
    if password.isnumeric():  # # 纯数字
        print('破解密码需要:24纳秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:  # # 纯小写
            print('破解密码需要:400纳秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # #小写大写
            print('破解密码需要:3毫秒')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:  # #小写大写数字
            print('破解密码需要:5毫秒')

        if not contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:400纳秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:3毫秒')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:32纳秒')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:42纳秒')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:3毫秒')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:7毫秒')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1毫秒')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:1毫秒')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:300纳秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:84纳秒')
elif length == 4:
    if password.isnumeric():  # # 纯数字
        print('破解密码需要:1秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:  # # 纯小写
            print('破解密码需要:1秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # #小写大写
            print('破解密码需要:100毫秒')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:  # #小写大写数字
            print('破解密码需要:300毫秒')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 小写大写数字符号
            print('破解密码需要:800毫秒')

        if not contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:11毫秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:100毫秒')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:41毫秒')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:9毫秒')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:100毫秒')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:500毫秒')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:41毫秒')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:70毫秒')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:9毫秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:1毫秒')
elif length == 5:
    if password.isnumeric():  # # 纯数字
        print('破解密码需要:1秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:  # # 纯小写
            print('破解密码需要:1秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # #小写大写
            print('破解密码需要:9毫秒')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:  # #小写大写数字
            print('破解密码需要:22毫秒')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 小写大写数字符号
            print('破解密码需要:67毫秒')

        if not contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:200毫秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:8毫秒')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1毫秒')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:2毫秒')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:8毫秒')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:33毫秒')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1毫秒')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:2毫秒')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:200毫秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:1毫秒')
elif length == 6:
    if password.isnumeric():  # # 纯数字
        print('破解密码需要:0.001秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:  # # 纯小写
            print('破解密码需要:1秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol: # #小写大写
            print('破解密码需要:400毫秒')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol: # #小写大写数字
            print('破解密码需要:1秒')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol: # # 小写大写数字符号
            print('破解密码需要:5秒')

        if not contain_lowcase and contain_upcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:7毫秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol: # # 大写符号数字
            print('破解密码需要:400毫秒')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:54毫秒')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:100毫秒')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase: # # 小写数字符号
            print('破解密码需要:400毫秒')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num: # # 小写大写符号
            print('破解密码需要:2秒')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase: # # 大写数字
            print('破解密码需要:54毫秒')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase: # # 大写符号
            print('破解密码需要:100毫秒')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase: # #数字符号
            print('破解密码需要:6毫秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num: # # 符号
            print('破解密码需要:200毫秒')
elif length == 7:
    if password.isnumeric():
        print('破解密码需要:0.001秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:25秒')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:1分钟')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:6分钟')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:1秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol: # # 大写符号数字
            print('破解密码需要:22秒')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1秒')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:4秒')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase: # # 小写数字符号
            print('破解密码需要:22秒')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num: # # 小写大写符号
            print('破解密码需要:2分钟')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase: # # 大写数字
            print('破解密码需要:1秒')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase: # # 大写符号
            print('破解密码需要:4秒')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase: # #数字符号
            print('破解密码需要:0.00001秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num: # # 符号
            print('破解密码需要:1秒')
elif length == 8:
    if password.isnumeric():
        print('破解密码需要:1秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:5秒')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:22分钟')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:1小时')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:8小时')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:5秒')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:19分钟')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1分钟')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:3分钟')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:1分钟')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:2小时')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1分钟')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:3分钟')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:3秒')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:1秒')
elif length == 9:
    if password.isnumeric():
        print('破解密码需要:1秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:2分钟')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:19小时')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:3天')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:3星期')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:2分钟')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:16小时')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:42分钟')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:2小时')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:16小时')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:1星期')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:42分钟')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:2小时')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:1分钟')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:0.00001秒')
elif length == 10:
    if password.isnumeric():
        print('破解密码需要:1秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:58分钟')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1星期')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:7星期')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:5年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:58分钟')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:1个月')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1天')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:3天')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:1个月')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:1年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1天')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:3天')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:39分钟')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:14秒')
elif length == 11:
    if password.isnumeric():
        print('破解密码需要:2秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1天')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:5年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:41年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:400年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:1天')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:4年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1个月')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:5个月')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:4年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:96年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1个月')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:5个月')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:16小时')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:3分钟')
elif length == 12:
    if password.isnumeric():
        print('破解密码需要:25秒')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:3星期')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:300年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:2千年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:3万4千年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:3个月')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:2千年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:3年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:17年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:2千年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:6千年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:3年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:17年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:2星期')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:54分钟')
elif length == 13:
    if password.isnumeric():
        print('破解密码需要:4分钟')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1万6千年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:10万年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:2百万年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:1年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:1万2千年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:1千年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:7百年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:1万2千年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:40万年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:1千年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:7千年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:1年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:13小时')
elif length == 14:
    if password.isnumeric():
        print('破解密码需要:41分钟')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:51年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:80万年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:9百万年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:2亿年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:51年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:600万年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:4千年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:3万年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:60万年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:2千9百万年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:4千年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:3万年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:29年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:1星期')
elif length == 15:
    if password.isnumeric():
        print('破解密码需要:6小时')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1千年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:4千3百万年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:6亿年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:1百5十亿年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:1千年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:3千2百万年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:10万年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:100万年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:3千2百万年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:10亿年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:10万年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:100万年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:700年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:4个月')
elif length == 16:
    if password.isnumeric():
        print('破解密码需要:2天')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:3万4千年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:20亿年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:3百7十亿年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:1万亿年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:3万4千年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:10亿年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:6百万年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:5千万年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:10亿年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:1000亿年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:600万年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:5000万年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:1万8千年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:5年')
elif length == 17:
    if password.isnumeric():
        print('破解密码需要:4星期')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:80万年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:1000亿年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:2万亿年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:93万亿年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:80万年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:8百4十亿年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:20亿年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:20亿年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:840亿年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:8兆年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:20亿年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:20亿年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:40万年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:78年')
elif length == 18:
    if password.isnumeric():
        print('破解密码需要:9个月')
    else:
        for i in password:
            if i in lowcase:
                contain_lowcase = True
            if i in upcase:
                contain_upcase = True
            if i in num:
                contain_num = True
            if i in symbol:
                contain_symbol = True
        if contain_lowcase and not contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:2千3百万年')
        if contain_lowcase and contain_upcase and not contain_num and not contain_symbol:
            print('破解密码需要:6万亿年')
        if contain_lowcase and contain_upcase and contain_num and not contain_symbol:
            print('破解密码需要:100万亿年')
        if contain_lowcase and contain_upcase and contain_num and contain_symbol:
            print('破解密码需要:7千万亿年')

        if contain_upcase and not contain_lowcase and not contain_num and not contain_symbol:  # # 纯大写
            print('破解密码需要:2千3百万年')
        if not contain_lowcase and contain_upcase and contain_num and contain_symbol:  # # 大写符号数字
            print('破解密码需要:4兆年')
        if contain_lowcase and contain_num and not contain_upcase and not contain_symbol:  # # 小写数字
            print('破解密码需要:840亿年')
        if contain_lowcase and contain_symbol and not contain_upcase and not contain_num:  # # 小写符号
            print('破解密码需要:840亿年')
        if contain_lowcase and contain_num and contain_symbol and not contain_upcase:  # # 小写数字符号
            print('破解密码需要:4兆年')
        if contain_lowcase and contain_upcase and contain_symbol and not contain_num:  # # 小写大写符号
            print('破解密码需要:500兆年')
        if contain_upcase and contain_num and not contain_symbol and not contain_lowcase:  # # 大写数字
            print('破解密码需要:80亿年')
        if contain_upcase and contain_symbol and not contain_num and not contain_lowcase:  # # 大写符号
            print('破解密码需要:840亿年')
        if contain_num and contain_symbol and not contain_upcase and not contain_lowcase:  # #数字符号
            print('破解密码需要:1千1百万年')
        if contain_symbol and not contain_upcase and not contain_lowcase and not contain_num:  # # 符号
            print('破解密码需要:1000年')

随笔记录

侵删

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值