MD5
![本页使用了标题或全文手工转换](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Zh_conversion_icon_m.svg/35px-Zh_conversion_icon_m.svg.png)
设计 | 罗纳 |
---|---|
1992 | |
MD2、MD4、MD5、MD6 | |
128 | |
512 | |
结构 | Merkle–Damgård construction |
4[1] |
MD5訊息
1996
历史与 密 码学
[编辑]1992
MD5
应用
[编辑]MD5曾被
算法
[编辑]![](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MD5.png/300px-MD5.png)
MD5
伪代码
[编辑]//Note: All variables are unsigned 32 bits and wrap modulo 2^32 when calculating
var int[64] r, k
//r specifies the per-round shift amounts
r[ 0..15]:= {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22}
r[16..31]:= {5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20}
r[32..47]:= {4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23}
r[48..63]:= {6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}
//Use binary integer part of the sines of integers as constants:
for i from 0 to 63
k[i] := floor(abs(sin(i + 1)) × 2^32)
//Initialize variables:
var int h0 := 0x67452301
var int h1 := 0xEFCDAB89
var int h2 := 0x98BADCFE
var int h3 := 0x10325476
//Pre-processing:
append "1" bit to message
append "0" bits until message length in bits ≡ 448 (mod 512)
append bit length of message as 64-bit little-endian integer to message
//Process the message in successive 512-bit chunks:
for each 512-bit chunk of message
break chunk into sixteen 32-bit little-endian words w[i], 0 ≤ i ≤ 15
//Initialize hash value for this chunk:
var int a := h0
var int b := h1
var int c := h2
var int d := h3
//Main loop:
for i from 0 to 63
if 0 ≤ i ≤ 15 then
f := (b and c) or ((not b) and d)
g := i
else if 16 ≤ i ≤ 31
f := (d and b) or ((not d) and c)
g := (5×i + 1) mod 16
else if 32 ≤ i ≤ 47
f := b xor c xor d
g := (3×i + 5) mod 16
else if 48 ≤ i ≤ 63
f := c xor (b or (not d))
g := (7×i) mod 16
temp := d
d := c
c := b
b := leftrotate((a + f + k[i] + w[g]),r[i]) + b
a := temp
Next i
//Add this chunk's hash to result so far:
h0 := h0 + a
h1 := h1 + b
h2 := h2 + c
h3 := h3 + d
End ForEach
var int digest := h0 append h1 append h2 append h3 //(expressed as little-endian)
MD5散 列
[编辑]MD5("The quick brown fox jumps over the lazy dog") = 9e107d9d372bb6826bd81d3542a419d6
MD5("The quick brown fox jumps over the lazy cog") = 1055d3e698d289f2af8663725127bd4b
MD5("") = d41d8cd98f00b204e9800998ecf8427e
缺陷
[编辑]2004
2009
参 见
[编辑]参考 文献
[编辑]- ^ RFC 1321, section 3.4, "Step 4. Process Message in 16-Word Blocks", page 5.
- ^
梁 斌 .第 3章 “搜索 引擎的 下 载系统”第 4节“网页抓 取 原理 ”.走 进搜索 引擎. 孙学瑛 (责任编辑)第 1版 . 电子工 业出版 社 . 2007年 10月 : 51. ISBN 978-7-121-04922-4 (中 文 (中国 大 陆)). - ^ Wang, Xiaoyun; Feng, Dengguo; Lai, Xuejia; Yu, Hongbo. Collisions for Hash Functions MD4, MD5, HAVAL-128 and RIPEMD. 2020-06-09 [2020-06-09]. (
原始 内容 存 档于2020-06-09) –通 过ePrint IACR. - ^ den Boer, Bert; Bosselaers, Antoon. Collisions for the compression function of MD5. Advances in Cryptology — EUROCRYPT ’93. Berlin, Heidelberg: Springer Berlin Heidelberg. 1994: 293–304. ISBN 978-3-540-57600-6. ISSN 0302-9743. doi:10.1007/3-540-48285-7_26.
- ^ Wang, Xiaoyun; Lai, Xuejia; Feng, Dengguo; Chen, Hui; Yu, Xiuyuan. Cryptanalysis of the Hash Functions MD4 and RIPEMD. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg. 2005: 1–18. ISBN 978-3-540-25910-7. ISSN 0302-9743. doi:10.1007/11426639_1.
- ^ Tao Xie and Dengguo Feng. How To Find Weak Input Differences For MD5 Collision Attacks (PDF). 30 May 2009 [2010-09-21]. (
原始 内容 存 档 (PDF)于2012-05-05).
- Berson, Thomas A. Differential Cryptanalysis Mod 232 with Applications to MD5. EUROCRYPT: 71–80. 1992. ISBN 978-3-540-56413-3.
- Bert den Boer; Antoon Bosselaers. Collisions for the Compression Function of MD5. 1993: 293–304. ISBN 978-3-540-57600-6.
|booktitle=
被 忽 略 (帮助) - Hans Dobbertin, Cryptanalysis of MD5 compress. Announcement on Internet, May 1996 [1] (页面
存 档备份,存 于互联网档案 馆). - Dobbertin, Hans. The Status of MD5 After a Recent Attack. CryptoBytes. 1996, 2 (2) [2006-07-30]. (
原始 内容 存 档于2006-08-13). - Cong, Zijie.
提 高 哈希安全 性 的 一 些错误做法 . Clifton Labratory. 2009.[失效 連結 ]
外部 链接
[编辑]- W3C关于MD5
的 建 议 (页面存 档备份,存 于互联网档案 馆) - MD5 哈希
生成 器 (页面存 档备份,存 于互联网档案 馆) - MD5
在 线加密 (页面存 档备份,存 于互联网档案 馆) - MD5
免 费解密 (页面存 档备份,存 于互联网档案 馆) - MD5
付 费解密 (页面存 档备份,存 于互联网档案 馆)
|