python中有md5解密功能吗? [英] is a there md5 decrypt function in python?
问题描述
可能重复:
是否可以解密md5哈希?
Possible Duplicate:
Is it possible to decrypt md5 hashes?
我用过md5.new()
; md5.update("aaa")
,md5.digest()
形成数据"aaa"
的md5哈希.如何使用python取回数据?
to form a md5 hash of the data "aaa"
. How to get back the data using python?
推荐答案
You cannot decode an md5 hash, as hashing is a process that is best thought of as one-way encoding (that is to say what is hashed cannot be de-hashed; one can only determine what was hashed, either by examining a list of known hashes, or by hashing a set of inputs and matching the resulting hashes with the hash you are trying to "decode").
引用Wikipedia,这种哈希算法的主要特征是:
Quoting Wikipedia, the key features of such a hashing algorithm are:
找不到消息是不可行的 具有给定的哈希值
it is infeasible to find a message that has a given hash,
是 无法修改消息而没有 更改其哈希,
it is infeasible to modify a message without changing its hash,
这是不可行的 用找到两个不同的消息 相同的哈希值.
it is infeasible to find two different messages with the same hash.
如今,此类算法最常见的用途是:
The most common uses of such algorithms today are:
- 存储密码
- 验证文件的内容.
如果要对数据进行双向加密,则需要查看其他Python加密库(通常,Stackoverflow的
If you want to two-way encrypt the data, you need to look at other cryptographic libraries for Python (As usual, Stackoverflow has a recommendation).
这篇关于python中有md5解密功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!