Editor: Watch this article, please don't surprise, remember that some people in the order of the group in question were asking if the MD5 algorithm had a tool to achieve breakthrough.
The answer is yes. So, use ASP to achieve, nor is it a task that is not completed ...
The code is very hard, I hope that when you transfer the master, please add the reprint information.
Code Demo. Description Coding by sunrise_chen Please enter the original code: After the MD5 conversion is:
8 Code Summary Coding By Sunrise_Chen. Description MD5's full name is Message-Digest Algorithm 5 (Information - Summary Algorithm), developed by Mit Laboratory For Computer Science and RSA Data Security Inc, in the 1990s, MD2, MD3 and MD4 have been developed. Its role is to make large capacity information to be "compressed" into a confidential format before signing private privacy with digital signature software (that is, transforms an arbitrary length of byte string into a certain length). Whether it is MD2, MD4 or MD5, they all need to obtain a random length of information and generate a 128-bit information summary. Although the structure of these algorithms is more similar, the design of MD2 is completely different from MD4 and MD5, because MD2 is designed for 8-bit machines, while MD4 and MD5 are 32-bit computers. The descriptions of these three algorithms and C language source code have detailed descriptions in Internet RFCS 1321, http://www.ietf.org/rfc/rfc1321.txt), this is the most authoritative document, by Ronald L. Rivest submitted to IEFT in August 1992.
Rivest developed an MD2 algorithm in 1989. In this algorithm, the information is first supplied to the information, so that the byte length of the information is a multiple of 16. Then, at a 16-bit test and append to the end of the information. And calculate the hash value based on this new information. Later, Rogier and Chauvaud found that if the test and the MD2 conflict will be generated. The result of the encryption of the MD2 algorithm is unique - neither repeat.
In order to enhance the safety of the algorithm, RiveSt has developed an MD4 algorithm in 1990. The MD4 algorithm also needs to fill the information to ensure that the byte length of the information plus 448 can be divided by 512 (information byte length MOD 512 = 448). Then, one of the initial lengths of information indicated by 64-bit binary is added. The information is processed into blocks of 512-bit DAMG? RD / Merkle iterative structure, and each block is to be processed by three different steps. Den Boer and Bosselaers and others quickly discovered the first step and third steps in the MD4 version. Dobbertin demonstrates how to use a regular personal computer to find a conflict in the full version of the MD4 in a few minutes (this conflict is actually a vulnerability, which will result in encryption of different content but may get the same encryption. result). There is no doubt that MD4 is eliminated.
Although the MD4 algorithm has such a large vulnerability in the security, it has a guiding role in the presence of several information security encryption algorithms that have been developed thereon. In addition to MD5, there are also SHA-1, RIPE-MD, and HAVAL, etc.
One year later, that is, in 1991, Rivest developed technology more approached MD5 algorithm. It adds the concept of "safe-band" (safty-beelts) based on MD4. Although MD5 is slightly slower than MD4, it is safer. This algorithm is obvious by four and MD4 designs with a little different steps. In the MD5 algorithm, the size of the information - summary and the necessary conditions of the filler are identical to the MD4. Den Boer and Bosselaers have discovered pseudo-collisions in the MD5 algorithm, but there is no other resulting result. Van Orschot and Wiener have considered a function of violent search conflicts in hash, and they guess a machine that is designed to search for MD5 conflicts (this machine is approximately manufactured in 1994 It is a million US dollars) to find a conflict every 24 days. However, from 1991 to 2001, there is no new algorithm for MD6 or other names that have alternative MD5 algorithms, and we can see that this flaw does not have much impact on MD5 security. All of these is not enough to become MD5 problems in practical applications. Also, since the use of the MD5 algorithm does not need to pay any copyright costs, in general (non-top secret applications. But even if the application is in the top secret field, MD5 is not a very good intermediate technology), MD5 It should be considered very safe.
8 Code Analysis Coding by Sunrise_chen. Source Code <% '------------------------------------ 'Cocoon Disk Manager V3 - MD5 Function' ASP Realization '- Available from a Foreign Website' ------------------------- ------------- Private Const BITS_TO_A_BYTE = 8 Private Const BYTES_TO_A_WORD = 4 Private Const BITS_TO_A_WORD = 32 Private m_lOnBits (30) Private m_l2Power (30) Private Function LShift (lValue, iShiftBits) If iShiftBits = 0 Then LShift = lValue Exit Function ElseIf iShiftBits = 31 Then If lValue And 1 Then LShift = & H80000000 Else LShift = 0 End If Exit Function ElseIf iShiftBits <0 Or iShiftBits> 31 Then Err.Raise 6 End If If (lValue And m_l2Power (31 - iShiftBits)) Then LShift = ((lValue And m_lOnBits (31 - (iShiftBits 1))) * m_l2Power (iShiftBits)) Or & H80000000 Else LShift = ((lValue And m_lOnBits (31 - iShiftBits)) * m_l2Power (iShiftBits)) End If End Function Private Function Rshift (Lvalue, iShiftBits) if iShiftBits = 0 Then Rshift = LVALUE Exit Function ElseIf iShiftBits = 31 Then If lValue And & H80000000 Then RShift = 1 Else RShift = 0 End If Exit Function ElseIf iShiftBits <0 Or iShiftBits> 31 Then Err.Raise 6 End If RShift = (lValue And & H7FFFFFFE) / m_l2Power (iShiftBits) IF (Lvalue and & H80000000) THEN RSHIFT = (RSHIFT OR (& H40000000 / M_L2Power (IshiftBits - 1))) End if End Function Private Function RotateLeft (Lvalue, iShiftBits) RotateLeft =
LShift (lValue, iShiftBits) Or RShift (lValue, (32 - iShiftBits)) End Function Private Function AddUnsigned (lX, lY) Dim lX4 Dim lY4 Dim lX8 Dim lY8 Dim lResult lX8 = lX And & H80000000 lY8 = lY And & H80000000 lX4 = lX And & H40000000 lY4 = lY And & H40000000 lResult = (lX And & H3FFFFFFF) (lY And & H3FFFFFFF) If lX4 And lY4 Then lResult = lResult Xor & H80000000 Xor lX8 Xor lY8 ElseIf lX4 Or lY4 Then If lResult And & H40000000 Then lResult = lResult Xor & HC0000000 Xor lX8 Xor lY8 Else lResult = lResult Xor & H40000000 Xor lX8 Xor lY8 End If Else lResult = lResult Xor lX8 Xor lY8 End If AddUnsigned = lResult End Function Private Function md5_F (x, y, z) md5_F = (x And y) Or (( NOT X) AND Z) END FUNCTION Private function MD5_G (X, Y, Z) MD5_G = (x and z) OR (Y AND (Not Z)) End Function Private Function MD5_H (X, Y, Z) MD5_H = (X Xor y xor z) End function private function MD5_i (x, y, z) MD5_i = (Y XOR (x or (not z))) End function private SUB MD5_FF (A, B, C, D, X, S, AC) a = addunsigned (A, addunsigned (addunsigned (MD5_F (B, C, D), X), AC)) A = RotateLeft (A, S) A = AddUnsigned (A, B ) End Sub Private SUB MD5_GG (A, B, C, D, X, S, AC) a = addunsigned (A, AddunSigned (AddunSigned (MD5_G (B, C, D), X), AC)))) A = RotateLeft A, S) a = addunsigned (a, b) End Sub Private Sub MD5_HH (A, B, C, D, X, S, AC) a = addunsigned (A, addunsigned (addunsigned (MD5_H (B, C, D) , X), AC)) A = ROTATELEFT (A, S) A = AddunSigned (A, B) End Sub Private Sub MD5_II (A, B, C, D, X, S, AC) a = addunsigned (A, AddUnsigned (AddunSigned (MD5_I (B, C, D), X), AC)) A =
RotateLeft (a, s) a = AddUnsigned (a, b) End Sub Private Function ConvertToWordArray (sMessage) Dim lMessageLength Dim lNumberOfWords Dim lWordArray () Dim lBytePosition Dim lByteCount Dim lWordCount Const MODULUS_BITS = 512 Const CONGRUENT_BITS = 448 lMessageLength = Len (sMessage) lNumberOfWords = (((lMessageLength ((MODULUS_BITS - CONGRUENT_BITS) / BITS_TO_A_BYTE)) / (MODULUS_BITS / BITS_TO_A_BYTE)) 1) * (MODULUS_BITS / BITS_TO_A_WORD) ReDim lWordArray (lNumberOfWords - 1) lBytePosition = 0 lByteCount = 0 Do Until lByteCount> = lMessageLength lWordCount = lByteCount / BYTES_TO_A_WORD lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE lWordArray (lWordCount) = lWordArray (lWordCount) Or LShift (Asc (Mid (sMessage, lByteCount 1, 1)), lBytePosition) lByteCount = lByteCount 1 Loop LWORDCOUNT = lbytecount / bytes_to_a_word lbyteposition = (lbytecount mode_to_a_word) * bits_to_a_byte lwordArray (LWORDCOUNT) = LWORDARRAY (LWORDCOUNT) OR LShift (& H80, lBytePosition) lWordArray (lNumberOfWords - 2) - Dim lByte Dim lCount For lCount = RShift (lMessageLength, 29) ConvertToWordArray = lWordArray End Function Private Function WordToHex (lValue) = = LShift (lMessageLength, 3) lWordArray (1 lNumberOfWords) 0 To 3 lByte = rShift (lValue, lCount * BITS_TO_A_BYTE) And m_lOnBits (BITS_TO_A_BYTE - 1) WordToHex = WordToHex & Right ( "0" & Hex (lByte), 2) Next End Function Public Function MD5 (sMessage) m_lOnBits (0) = Clng (1) m_lonbits (1) = clng (3) m_lonbits (2) = clng (7) m_lonbits (3) = CLNG (15) M_LONBITS (4) =
CLNG (31) M_LONBITS (5) = ClNG (63) M_LONBITS (6) = CLNG (127) M_LONBITS (7) = CLNG (255) M_LONBITS (8) = CLNG (511) M_LONBITS (9) = CLNG (1023) M_Lonbits (10) = ClNG (2047) M_LONBITS (11) = clng (4095) M_LONBITS (12) = ClNG (8191) M_Lonbits (13) = clng (16383) M_LONBITS (14) = CLNG (32767) M_LONBITS (15) = CLNG (65535) M_LONBITS (16) = CLONBITS (17) = ClNG (262143) M_Lonbits (18) = CLNG (524287) M_Lonbits (19) = clng (1048575) M_LONBITS (20) = CLNG (2097151) m_lonbits 21) = CLNG (4194303) M_LONBITS (22) = CLNG (8388607) M_LONBITS (23) = CLNG (16777215) m_lonbits (24) = ClNG (33554431) M_Lonbits (25) = CLNG (67108863) M_LONBITS (26) = CLNG 134217727) m_lOnBits (27) = CLng (268435455) m_lOnBits (28) = CLng (536870911) m_lOnBits (29) = CLng (1073741823) m_lOnBits (30) = CLng (2147483647) m_l2Power (0) = CLng (1) m_l2Power (1 ) = Clng (2) m_l2power (2) = clng (4) m_l2power (3) = clng (8) m_l2power (4) = clng (16) m_l2power (5) = clng (32) m_l2power (6) = CLNG (64) ) M_l2power (7) = clng (128) M_L2Power (8) = Clng (256) m_l2power (9) = clng (512) m_l2power (10) = clng (1024) m_l2power (11) = clng (2048) m_l2power (12) = clng (4096) m_l2power (13) = CLNG (8192) m_l2power (14) = clng (16384) m_l2power (15) = clng (32768) m_l2power (16) = CLNG (65536) m_l2power (17) = clng (131072) m_l2power (18) = CLNG (262144) M_L2Power (19) = CLng (524288) m_l2Power (20) = CLng (1048576) m_l2Power (21) = CLng (2097152) m_l2Power (22) = CLng (4194304) m_l2Power (23) = CLng (8388608) m_l2Power (24) = CLng (16777216) m_l2Power (25) = CLNG (33554432) m_l2power (26) =
CLng (67108864) m_l2Power (27) = CLng (134217728) m_l2Power (28) = CLng (268435456) m_l2Power (29) = CLng (536870912) m_l2Power (30) = CLng (1073741824) Dim x Dim k Dim AA Dim BB Dim CC DIM DD DIM A DIM B DIM C DIM D Const S11 = 7 Const S12 = 12 Const S13 = 17 Const S14 = 22 Const S21 = 5 Const S22 = 9 Const S23 = 14 Const S24 = 20 Const S31 = 4 Const S32 = 11 const S33 = 16 const S34 = 23 const S41 = 6 const S42 = 10 const S43 = 15 const S44 = 21 x = ConvertToWordArray (sMessage) a = & H67452301 b = & HEFCDAB89 c = & H98BADCFE d = & H10325476 For k = 0 To UBound (x ) Step 16 aa = a bb = b cc = C DD = D MD5_FF A, B, C, D, X (K 0), S11, & HD76AA478 MD5_FF D, A, B, C, X (K 1), S12, & HE8C7B756 MD5_FF C, D, A, B, X (K 2), S13, & H242070DB MD5_FF B, C, D, A, X (K 3), S14, & HC1BDCEEE MD5_FF A, B, C, D, X (k 4), S11, & HF57C0FAF MD5_FF D, A, B, C, X (K 5), S12, & H4787C62A MD5_FF C, D, A, B, X (K 6), S13, & HA8304613 MD5_FF B , C, D, A, X (k 7), S14, & HFD469501 MD5_FF A, B, C, D, X (K 8), S11, & H698098D8 MD5_FF D, A, B, C, X (K 9), S12, & H8B44F7AF MD5_FF C, D, A, B, X (k 10), S13, & HFFFF5BB1 MD5_FF B, C, D, A, X (K 11), S14, & H895CD7BE MD5_FF A, B, C, D, X (K 12), S11, & H6B901122 MD5_FF D, A, B, C, X (K 13), S12, & HFD987193 MD5_FF C, D, A, B, X (K 14), S13, & HA679438E MD5_FF B, C, D, A, X (K 15), S14, & H49B40821 MD5_GG A, B, C, D, X (K 1), S21, &
HF61E2562 MD5_GG D, A, B, C, X (K 6), S22, & HC040B340 MD5_GG C, D, A, B, X (k 11), S23, & H265E5A51 MD5_GG B, C, D, A, X ( K 0), S24, & HE9B6C7AA MD5_GG A, B, C, D, X (k 5), S21, & HD62F105D MD5_GG D, A, B, C, X (K 10), S22, & H2441453 MD5_GG C, D , A, B, X (K 15), S23, & HD8A1E681 MD5_GG B, C, D, A, X (K 4), S24, & HE7D3FBC8 MD5_GG A, B, C, D, X (K 9), S21, & H21E1CDE6 MD5_GG D, A, B, C, X (K 14), S22, & HC33707D6 MD5_GG C, D, A, B, X (K 3), S23, & HF4D50D87 MD5_GG B, C, D, A, X (k 8), S24, & H455A14ED MD5_GG A, B, C, D, X (K 13), S21, & HA9E3E905 MD5_GG D, A, B, C, X (K 2), S22, & HFCEFA3F8 MD5_GG C , D, A, B, X (7), S23, & H676F02D9 MD5_GG B, C, D, A, X (K 12), S24, & H8D2A4C8A MD5_HH A, B, C, D, X (K 5 ), S31, & HFFFA3942 MD5_HH D, A, B, C, X (k 8), S32, & H8771F681 MD5_HH C, D, A, B, X (K 11), S33, & H6D9D6122 MD5_HH B, C, D, A, X (K 14), S34, & HFDE5380C MD5_HH A, B, C, D, X (K 1), S31, & HA4Beea44 MD5_HH D, A, B, C, X (K 4), S32, & H4B Decfa9 MD5_HH C, D, A, B, X (K 7), S33, & HF6BB4B60 MD5_HH B, C, D, A, X (K 10), S34, & HBebfbc70 MD5_HH A, B, C, D, X ( K 13), S31, & H289B7EC6 MD5_HH D, A, B, C, X (K 0), S32, & HEAA127FA MD5_HH C, D, A, B, X (K 3), S33, & HD4EF3085 MD5_HH B, C , D, A, X (k 6), S34, & H4881D05 MD5_HH A, B, C, D, X (K 9), S31, & HD9D4D039 MD5_HH D, A, B, C, X (K 12), S32, & HE6DB99E5 MD5_HH C, D, A, B, X (K 15), S33, & H1FA27CF8 MD5_HH B, C, D, A, X (K 2), S34, &