python md5加密

2022/2/5 9:42:32

本文主要是介绍python md5加密,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

from hashlib import md5  
from string import ascii_letters,digits  
from itertools import permutations  
from time import time
import pymysql,sys
all_letters=ascii_letters+digits+'.,;'
ma=["4787b9dab081dd08bd290622980d3cbb","22036718004f0e3b1b4e2080784a4126","464b08b928f442a29509b14672193ed6","cabd9831fb15cc9ed9116ee8ce9c80b0","844c8b37f228c33216bccaf95b2ac4ec","4787b9dab081dd08bd290622980d3cbb"]
def decrypt_md5(md5_value):  
    if len(md5_value)!=32:


print('error')  
        return  
    md5_value=md5_value.lower()  
    for k in range(5,10):  
        for item in permutations(all_letters,k):  
            item=''.join(item)  
            #print('.',end='')
            result=[]
            key1=item
            key2=md5(item.encode()).hexdigest()
            result.append(([key1,key2,]))
            charu(result)
            if key2==md5_value:  
                return item
def charu(uuk):
    con = connect.cursor()
    try:
        con.executemany('insert ignore into md5(k1,k2)values(%s,%s)',uuk)
        connect.commit()
        print("保存数据成功")
    except Exception as e:
        connect.rollback()
kkey="q8+RRKkEqv4zyuzjIMV8G2BP7DnQk4t4AWJDkBYaHSLYieM1Yo12HXX+kjtBpHqHcOlBFYiYDtFZEgolwvZlOoftH/vqqLSMhzS0Aq6rnT3FI0uJ0ItZk1Ecv9TKDSfQFfwFC2PPr3im0cARl5vKw0BJ2XoXcozl0oZUoKaZn4OZXmQnPs0VYzeqLhGi3inwUxlX+/Wb292rh9lA6q7c3MnYa6RVFGjaqcT5ruyAmlqBJSQtWU58glEB44x6fKpgPenFb5IEc32IMZMHsyFBw3qwwnmkcQOYl4dsnfQ+ieYgFfY+Y0rlecfG0xEX7skGG+uztujf1WxFNOGkNTdt9w=="
key2=md5(kkey.encode()).hexdigest()
print(key2)

 

搜索

复制



这篇关于python md5加密的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程