⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 md5的介绍,算法和实现.htm

📁 MD5算法的相关资料
💻 HTM
📖 第 1 页 / 共 3 页
字号:
  Xin(13), "a9e3e905", 5 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F2 d, a, b, c, 
  Xin(2), "fcefa3f8", 9 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F2 c, d, a, b, 
  Xin(7), "676f02d9", 14 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F2 b, c, d, a, 
  Xin(12), "8d2a4c8a", 20 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; ' 第三轮循环 <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; MD5F3 a, b, c, d, Xin(5), "fffa3942", 4 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F3 d, a, b, c, Xin(8), "8771f681", 11 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F3 c, d, a, b, Xin(11), "6d9d6122", 16 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F3 b, c, d, a, Xin(14), "fde5380c", 23 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F3 a, b, c, d, Xin(1), "a4beea44", 4 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F3 d, a, b, c, Xin(4), "4bdecfa9", 11 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F3 c, d, a, b, Xin(7), "f6bb4b60", 16 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F3 b, c, d, a, Xin(10), "bebfbc70", 23 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F3 a, b, c, d, Xin(13), "289b7ec6", 4 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F3 d, a, b, c, Xin(0), "e27fa", 11 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  MD5F3 c, d, a, b, Xin(3), "d4ef3085", 16 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F3 
  b, c, d, a, Xin(6), "04881d05", 23 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F3 a, b, 
  c, d, Xin(9), "d9d4d039", 4 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F3 d, a, b, c, 
  Xin(12), "e6db99e5", 11 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F3 c, d, a, b, 
  Xin(15), "1fa27cf8", 16 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F3 b, c, d, a, 
  Xin(2), "c4ac5665", 23 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; ' 第四轮循环 <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; MD5F4 a, b, c, d, Xin(0), "f4292244", 6 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 d, a, b, c, Xin(7), "432aff97", 10 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 c, d, a, b, Xin(14), "ab9423a7", 15 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 b, c, d, a, Xin(5), "fc93a039", 21 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 a, b, c, d, Xin(12), "655b59c3", 6 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 d, a, b, c, Xin(3), "8f0ccc92", 10 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 c, d, a, b, Xin(10), "ffeff47d", 15 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 b, c, d, a, Xin(1), "85845dd1", 21 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; MD5F4 a, b, c, d, Xin(8), "6fa87e4f", 6 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F4 d, a, b, c, Xin(15), "fe2ce6e0", 10 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F4 c, d, a, b, Xin(6), "a3014314", 15 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F4 b, c, d, a, Xin(13), "4e0811a1", 21 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; MD5F4 a, b, c, d, Xin(4), "f7537e82", 6 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  MD5F4 d, a, b, c, Xin(11), "bd3af235", 10 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  MD5F4 c, d, a, b, Xin(2), "2ad7d2bb", 15 <BR>&nbsp; &nbsp; &nbsp; &nbsp; MD5F4 
  b, c, d, a, Xin(9), "eb86d391", 21 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; buf(0) 
  = BigAdd(buf(0), a) <BR>&nbsp; &nbsp; &nbsp; &nbsp; buf(1) = BigAdd(buf(1), b) 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; buf(2) = BigAdd(buf(2), c) <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; buf(3) = BigAdd(buf(3), d) <BR>&nbsp; &nbsp; Next loopouter 
  <BR><BR>&nbsp; &nbsp; hashthis = "" <BR>&nbsp; &nbsp; For loopit = 0 To 3 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; For loopinner = 3 To 0 Step -1 <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hashthis = hashthis + Chr(Val("&amp;H" + 
  Mid$(buf(loopit), 1 + 2 * loopinner, 2))) <BR>&nbsp; &nbsp; &nbsp; &nbsp; Next 
  loopinner <BR>&nbsp; &nbsp; Next loopit <BR><BR>MD5_Calc = hashthis <BR>End 
  Function <BR><BR>Function BigMod32Add(ByVal value1 As String, ByVal value2 As 
  String) As String <BR>&nbsp; &nbsp; BigMod32Add = Right$(BigAdd(value1, 
  value2), 8) <BR>End Function <BR><BR>Public Function BigAdd(ByVal value1 As 
  String, ByVal value2 As String) As String <BR>Dim valueans As String <BR>Dim 
  loopit As Integer, tempnum As Integer <BR><BR>&nbsp; &nbsp; tempnum = 
  Len(value1) - Len(value2) <BR>&nbsp; &nbsp; If tempnum &lt; 0 Then <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; value1 = Space$(Abs(tempnum)) + value1 <BR>&nbsp; &nbsp; 
  ElseIf tempnum &gt; 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; value2 = 
  Space$(Abs(tempnum)) + value2 <BR>&nbsp; &nbsp; End If <BR><BR>&nbsp; &nbsp; 
  tempnum = 0 <BR>&nbsp; &nbsp; For loopit = Len(value1) To 1 Step -1 <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; tempnum = tempnum + Val("&amp;H" + Mid$(value1, loopit, 
  1)) + Val("&amp;H" + Mid$(value2, loopit, 1)) <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  valueans = Hex$(tempnum Mod 16) + valueans <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  tempnum = Int(tempnum / 16) <BR>&nbsp; &nbsp; Next loopit <BR><BR>&nbsp; 
  &nbsp; If tempnum &lt;&gt; 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans = 
  Hex$(tempnum) + valueans <BR>&nbsp; &nbsp; End If <BR><BR>&nbsp; &nbsp; BigAdd 
  = Right(valueans, 8) <BR>End Function <BR><BR>Public Function RotLeft(ByVal 
  value1 As String, ByVal rots As Integer) As String <BR>Dim tempstr As String 
  <BR>Dim loopit As Integer, loopinner As Integer <BR>Dim tempnum As Integer 
  <BR><BR>&nbsp; &nbsp; rots = rots Mod 32 <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; 
  If rots = 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; RotLeft = value1 <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; Exit Function <BR>&nbsp; &nbsp; End If <BR><BR>&nbsp; 
  &nbsp; value1 = Right$(value1, 8) <BR>&nbsp; &nbsp; tempstr = String$(8 - 
  Len(value1), "0") + value1 <BR>&nbsp; &nbsp; value1 = "" <BR><BR>&nbsp; &nbsp; 
  ' 转换成二进制形式 <BR>&nbsp; &nbsp; For loopit = 1 To 8 <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; tempnum = Val("&amp;H" + Mid$(tempstr, loopit, 1)) <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; For loopinner = 3 To 0 Step -1 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; If tempnum And 2 ^ loopinner Then <BR>&nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value1 = value1 + "1" <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; Else <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; value1 = value1 + "0" <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; End If <BR>&nbsp; &nbsp; &nbsp; &nbsp; Next loopinner <BR>&nbsp; &nbsp; 
  Next loopit <BR>&nbsp; &nbsp; tempstr = Mid$(value1, rots + 1) + Left$(value1, 
  rots) <BR><BR>&nbsp; &nbsp; ' 转换为十六进制 <BR>&nbsp; &nbsp; value1 = "" <BR>&nbsp; 
  &nbsp; For loopit = 0 To 7 <BR>&nbsp; &nbsp; &nbsp; &nbsp; tempnum = 0 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; For loopinner = 0 To 3 <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; If Val(Mid$(tempstr, 4 * loopit + loopinner + 1, 
  1)) Then <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  tempnum = tempnum + 2 ^ (3 - loopinner) <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; End If <BR>&nbsp; &nbsp; &nbsp; &nbsp; Next loopinner <BR>&nbsp; &nbsp; 
  &nbsp; &nbsp; value1 = value1 + Hex$(tempnum) <BR>&nbsp; &nbsp; Next loopit 
  <BR><BR>&nbsp; &nbsp; RotLeft = Right(value1, 8) <BR>End Function 
  <BR><BR>Function BigAND(ByVal value1 As String, ByVal value2 As String) As 
  String <BR>Dim valueans As String <BR>Dim loopit As Integer, tempnum As 
  Integer <BR><BR>&nbsp; &nbsp; tempnum = Len(value1) - Len(value2) <BR>&nbsp; 
  &nbsp; If tempnum &lt; 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; value2 = 
  Mid$(value2, Abs(tempnum) + 1) <BR>&nbsp; &nbsp; ElseIf tempnum &gt; 0 Then 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; value1 = Mid$(value1, tempnum + 1) <BR>&nbsp; 
  &nbsp; End If <BR><BR>&nbsp; &nbsp; For loopit = 1 To Len(value1) <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; valueans = valueans + Hex$(Val("&amp;H" + Mid$(value1, 
  loopit, 1)) And Val("&amp;H" + Mid$(value2, loopit, 1))) <BR>&nbsp; &nbsp; 
  Next loopit <BR><BR>&nbsp; &nbsp; BigAND = valueans <BR>End Function 
  <BR><BR>Function BigNOT(ByVal value1 As String) As String <BR>Dim valueans As 
  String <BR>Dim loopit As Integer <BR><BR>&nbsp; &nbsp; value1 = Right$(value1, 
  8) <BR>&nbsp; &nbsp; value1 = String$(8 - Len(value1), "0") + value1 
  <BR>&nbsp; &nbsp; For loopit = 1 To 8 <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans 
  = valueans + Hex$(15 Xor Val("&amp;H" + Mid$(value1, loopit, 1))) <BR>&nbsp; 
  &nbsp; Next loopit <BR><BR>&nbsp; &nbsp; BigNOT = valueans <BR>End Function 
  <BR><BR>Function BigOR(ByVal value1 As String, ByVal value2 As String) As 
  String <BR>Dim valueans As String <BR>Dim loopit As Integer, tempnum As 
  Integer <BR><BR>&nbsp; &nbsp; tempnum = Len(value1) - Len(value2) <BR>&nbsp; 
  &nbsp; If tempnum &lt; 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans = 
  Left$(value2, Abs(tempnum)) <BR>&nbsp; &nbsp; &nbsp; &nbsp; value2 = 
  Mid$(value2, Abs(tempnum) + 1) <BR>&nbsp; &nbsp; ElseIf tempnum &gt; 0 Then 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans = Left$(value1, Abs(tempnum)) 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; value1 = Mid$(value1, tempnum + 1) <BR>&nbsp; 
  &nbsp; End If <BR><BR>&nbsp; &nbsp; For loopit = 1 To Len(value1) <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; valueans = valueans + Hex$(Val("&amp;H" + Mid$(value1, 
  loopit, 1)) Or Val("&amp;H" + Mid$(value2, loopit, 1))) <BR>&nbsp; &nbsp; Next 
  loopit <BR><BR>&nbsp; &nbsp; BigOR = valueans <BR>End Function 
  <BR><BR>Function BigXOR(ByVal value1 As String, ByVal value2 As String) As 
  String <BR>Dim valueans As String <BR>Dim loopit As Integer, tempnum As 
  Integer <BR><BR>&nbsp; &nbsp; tempnum = Len(value1) - Len(value2) <BR>&nbsp; 
  &nbsp; If tempnum &lt; 0 Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans = 
  Left$(value2, Abs(tempnum)) <BR>&nbsp; &nbsp; &nbsp; &nbsp; value2 = 
  Mid$(value2, Abs(tempnum) + 1) <BR>&nbsp; &nbsp; ElseIf tempnum &gt; 0 Then 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; valueans = Left$(value1, Abs(tempnum)) 
  <BR>&nbsp; &nbsp; &nbsp; &nbsp; value1 = Mid$(value1, tempnum + 1) <BR>&nbsp; 
  &nbsp; End If <BR><BR>&nbsp; &nbsp; For loopit = 1 To Len(value1) <BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; valueans = valueans + Hex$(Val("&amp;H" + Mid$(value1, 
  loopit, 1)) Xor Val("&amp;H" + Mid$(value2, loopit, 1))) <BR>&nbsp; &nbsp; 
  Next loopit <BR><BR>&nbsp; &nbsp; BigXOR = Right(valueans, 8) <BR>End Function 
  <BR>———————————————————————————————————————————— <BR><BR>呵呵 
  洋洋洒洒的一大篇可是我查找了不少资料才写出来 ^_^ 大概可以当成我们学校的Assignment了 呵呵 感谢大家看完&nbsp; &nbsp; 
  最后给大家出到题吧 大家可以试试自己的运气啊 就是: <BR>51E5D4BD3323A02CCCDD0472AE2DC20B&nbsp; 
  这组数是我通过MD5算法加密一组字符串后产生的一组密码 大家猜猜我加密的字符串是什么&nbsp; ^_^ 提示一下————加空格一共20位&nbsp; 
  ^_^&nbsp; <BR><BR>^_^&nbsp; 88 <BR><BR><BR><BR><BR>仅以次文献给我们可爱的组织CCG 希望它能蒸蒸日上! 
  <BR><BR>娃娃(NYDoll) <BR>属于中国破解组织CHiNA CrACKiNG GrOUp </BLOCKQUOTE>
<HR>

<P>&nbsp;</P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -