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
付 費 解 密 (頁 面 存 檔備份,存 於互聯網 檔案館 )
|