MD5/Implementation Debug
While implementing the MD5 algorithm as specified in RFC 1321, it may be useful to have the output of the intermediate stages, not just the final hash. To that end, here is a modified version of the Java implementation of MD5 with intermediate outputs printed. It adheres to RFC 1321 fairly close (the main difference is indexing T[] from zero instead of one).
It should also be noted that while many implementations (including this one) rotate the four main variables (A, B, C, D) after of the 16 computations in a round, the RFC does not concern itself with this implementation detail, so the values of A, B, C and D after each computation are displayed as the RFC specifies, not using this optimization. After the first computation, A is changed, then D, then C, then B. During the 64 computations spread over four rounds, each variable will be updated 16 times.
Output for "":
Calculating MD5 on "" Input message is 0 byte(s): [ ] Padding length is 64 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 1 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 00000080, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=A5202774 B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=A5202774 B=EFCDAB89 C=98BADCFE D=F59592DD T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=A5202774 B=EFCDAB89 C=E7F06B23 D=F59592DD T[2]=242070DB Applying [BCDA 3 22 4]: A=A5202774 B=1B163203 C=E7F06B23 D=F59592DD T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=32033344 B=1B163203 C=E7F06B23 D=F59592DD T[4]=F57C0FAF Applying [DABC 5 12 6]: A=32033344 B=1B163203 C=E7F06B23 D=2F35D494 T[5]=4787C62A Applying [CDAB 6 17 7]: A=32033344 B=1B163203 C=F5B158DB D=2F35D494 T[6]=A8304613 Applying [BCDA 7 22 8]: A=32033344 B=9BC13CE9 C=F5B158DB D=2F35D494 T[7]=FD469501 Applying [ABCD 8 7 9]: A=3893B991 B=9BC13CE9 C=F5B158DB D=2F35D494 T[8]=698098D8 Applying [DABC 9 12 10]: A=3893B991 B=9BC13CE9 C=F5B158DB D=FCE4A312 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=3893B991 B=9BC13CE9 C=E1EF0576 D=FCE4A312 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=3893B991 B=70768A29 C=E1EF0576 D=FCE4A312 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=F56C7CF1 B=70768A29 C=E1EF0576 D=FCE4A312 T[12]=6B901122 Applying [DABC 13 12 14]: A=F56C7CF1 B=70768A29 C=E1EF0576 D=374943A7 T[13]=FD987193 Applying [CDAB 14 17 15]: A=F56C7CF1 B=70768A29 C=5AA53F75 D=374943A7 T[14]=A679438E Applying [BCDA 15 22 16]: A=F56C7CF1 B=D6819C6A C=5AA53F75 D=374943A7 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=1C7D7513 B=D6819C6A C=5AA53F75 D=374943A7 T[16]=F61E2562 Applying [DABC 6 9 18]: A=1C7D7513 B=D6819C6A C=5AA53F75 D=7BD57A3A T[17]=C040B340 Applying [CDAB 11 14 19]: A=1C7D7513 B=D6819C6A C=C095F13A D=7BD57A3A T[18]=265E5A51 Applying [BCDA 0 20 20]: A=1C7D7513 B=BD782E17 C=C095F13A D=7BD57A3A T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=3D1E3E6C B=BD782E17 C=C095F13A D=7BD57A3A T[20]=D62F105D Applying [DABC 10 9 22]: A=3D1E3E6C B=BD782E17 C=C095F13A D=68B7B3E3 T[21]=02441453 Applying [CDAB 15 14 23]: A=3D1E3E6C B=BD782E17 C=EB41643E D=68B7B3E3 T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=3D1E3E6C B=E422531A C=EB41643E D=68B7B3E3 T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=306EC122 B=E422531A C=EB41643E D=68B7B3E3 T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=306EC122 B=E422531A C=EB41643E D=D28C77C2 T[25]=C33707D6 Applying [CDAB 3 14 27]: A=306EC122 B=E422531A C=A3C663DA D=D28C77C2 T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=306EC122 B=A0572807 C=A3C663DA D=D28C77C2 T[27]=455A14ED Applying [ABCD 13 5 29]: A=13707036 B=A0572807 C=A3C663DA D=D28C77C2 T[28]=A9E3E905 Applying [DABC 2 9 30]: A=13707036 B=A0572807 C=A3C663DA D=AE7813DB T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=13707036 B=A0572807 C=1C31C384 D=AE7813DB T[30]=676F02D9 Applying [BCDA 12 20 32]: A=13707036 B=A2205F1F C=1C31C384 D=AE7813DB T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=DF63EAA1 B=A2205F1F C=1C31C384 D=AE7813DB T[32]=FFFA3942 Applying [DABC 8 11 34]: A=DF63EAA1 B=A2205F1F C=1C31C384 D=C3689F5B T[33]=8771F681 Applying [CDAB 11 16 35]: A=DF63EAA1 B=A2205F1F C=12F3E755 D=C3689F5B T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=DF63EAA1 B=004B6669 C=12F3E755 D=C3689F5B T[35]=FDE5380C Applying [ABCD 1 4 37]: A=5F7A9B2E B=004B6669 C=12F3E755 D=C3689F5B T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=5F7A9B2E B=004B6669 C=12F3E755 D=ABC34E16 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=5F7A9B2E B=004B6669 C=91CA4CB7 D=ABC34E16 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=5F7A9B2E B=C5DC8C15 C=91CA4CB7 D=ABC34E16 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=4497169D B=C5DC8C15 C=91CA4CB7 D=ABC34E16 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=4497169D B=C5DC8C15 C=91CA4CB7 D=76FD93D4 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=4497169D B=C5DC8C15 C=FD95F243 D=76FD93D4 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=4497169D B=0FE32453 C=FD95F243 D=76FD93D4 T[43]=04881D05 Applying [ABCD 9 4 45]: A=3F55EDFD B=0FE32453 C=FD95F243 D=76FD93D4 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=3F55EDFD B=0FE32453 C=FD95F243 D=22A31F54 T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=3F55EDFD B=0FE32453 C=68D84EA2 D=22A31F54 T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=3F55EDFD B=CA7D2DBD C=68D84EA2 D=22A31F54 T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=93AA2577 B=CA7D2DBD C=68D84EA2 D=22A31F54 T[48]=F4292244 Applying [DABC 7 10 50]: A=93AA2577 B=CA7D2DBD C=68D84EA2 D=1688DC85 T[49]=432AFF97 Applying [CDAB 14 15 51]: A=93AA2577 B=CA7D2DBD C=CD85B8CB D=1688DC85 T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=93AA2577 B=561E0689 C=CD85B8CB D=1688DC85 T[51]=FC93A039 Applying [ABCD 12 6 53]: A=5625A114 B=561E0689 C=CD85B8CB D=1688DC85 T[52]=655B59C3 Applying [DABC 3 10 54]: A=5625A114 B=561E0689 C=CD85B8CB D=3450F42B T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=5625A114 B=561E0689 C=392AD0D0 D=3450F42B T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=5625A114 B=1E77FA61 C=392AD0D0 D=3450F42B T[55]=85845DD1 Applying [ABCD 8 6 57]: A=474A9C8C B=1E77FA61 C=392AD0D0 D=3450F42B T[56]=6FA87E4F Applying [DABC 15 10 58]: A=474A9C8C B=1E77FA61 C=392AD0D0 D=DFCE00BC T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=474A9C8C B=1E77FA61 C=36594B14 D=DFCE00BC T[58]=A3014314 Applying [BCDA 13 21 60]: A=474A9C8C B=30130182 C=36594B14 D=DFCE00BC T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=7246FAD3 B=30130182 C=36594B14 D=DFCE00BC T[60]=F7537E82 Applying [DABC 11 10 62]: A=7246FAD3 B=30130182 C=36594B14 D=6E10A476 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=7246FAD3 B=30130182 C=FF4EA3EB D=6E10A476 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=7246FAD3 B=14E45506 C=FF4EA3EB D=6E10A476 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=D98C1DD4 B=04B2008F C=980980E9 D=7E42F8EC [A B C D]: [ D4, 1D, 8C, D9, 8F, 00, B2, 04, E9, 80, 09, 98, EC, F8, 42, 7E ] MD5 Hash: D41D8CD98F00B204E9800998ECF8427E
Output for "a":
Calculating MD5 on "a" Input message is 1 byte(s): [ 61 ] Padding length is 63 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 08, 00, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 1 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 00008061, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000008, 00000000 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=A56017F4 B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=A56017F4 B=EFCDAB89 C=98BADCFE D=F2D58361 T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=A56017F4 B=EFCDAB89 C=E65857A7 D=F2D58361 T[2]=242070DB Applying [BCDA 3 22 4]: A=A56017F4 B=607D9686 C=E65857A7 D=F2D58361 T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=3A9D5BCC B=607D9686 C=E65857A7 D=F2D58361 T[4]=F57C0FAF Applying [DABC 5 12 6]: A=3A9D5BCC B=607D9686 C=E65857A7 D=E0A07DB7 T[5]=4787C62A Applying [CDAB 6 17 7]: A=3A9D5BCC B=607D9686 C=D31DDC83 D=E0A07DB7 T[6]=A8304613 Applying [BCDA 7 22 8]: A=3A9D5BCC B=A8AF6DA5 C=D31DDC83 D=E0A07DB7 T[7]=FD469501 Applying [ABCD 8 7 9]: A=BE580957 B=A8AF6DA5 C=D31DDC83 D=E0A07DB7 T[8]=698098D8 Applying [DABC 9 12 10]: A=BE580957 B=A8AF6DA5 C=D31DDC83 D=F386BEA6 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=BE580957 B=A8AF6DA5 C=F5FDD933 D=F386BEA6 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=BE580957 B=68493D6A C=F5FDD933 D=F386BEA6 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=44244CF8 B=68493D6A C=F5FDD933 D=F386BEA6 T[12]=6B901122 Applying [DABC 13 12 14]: A=44244CF8 B=68493D6A C=F5FDD933 D=D0FE9B27 T[13]=FD987193 Applying [CDAB 14 17 15]: A=44244CF8 B=68493D6A C=6360A45F D=D0FE9B27 T[14]=A679438E Applying [BCDA 15 22 16]: A=44244CF8 B=F01E3CE2 C=6360A45F D=D0FE9B27 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=9C341767 B=F01E3CE2 C=6360A45F D=D0FE9B27 T[16]=F61E2562 Applying [DABC 6 9 18]: A=9C341767 B=F01E3CE2 C=6360A45F D=970AB3A9 T[17]=C040B340 Applying [CDAB 11 14 19]: A=9C341767 B=F01E3CE2 C=E39FFD23 D=970AB3A9 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=9C341767 B=8D25CC66 C=E39FFD23 D=970AB3A9 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=8C444930 B=8D25CC66 C=E39FFD23 D=970AB3A9 T[20]=D62F105D Applying [DABC 10 9 22]: A=8C444930 B=8D25CC66 C=E39FFD23 D=7267097A T[21]=02441453 Applying [CDAB 15 14 23]: A=8C444930 B=8D25CC66 C=2DACB8A3 D=7267097A T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=8C444930 B=373BEAB0 C=2DACB8A3 D=7267097A T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=F175E3AD B=373BEAB0 C=2DACB8A3 D=7267097A T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=F175E3AD B=373BEAB0 C=2DACB8A3 D=9D5DF67E T[25]=C33707D6 Applying [CDAB 3 14 27]: A=F175E3AD B=373BEAB0 C=87B7F475 D=9D5DF67E T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=F175E3AD B=C8F891B4 C=87B7F475 D=9D5DF67E T[27]=455A14ED Applying [ABCD 13 5 29]: A=93842E98 B=C8F891B4 C=87B7F475 D=9D5DF67E T[28]=A9E3E905 Applying [DABC 2 9 30]: A=93842E98 B=C8F891B4 C=87B7F475 D=C7043B64 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=93842E98 B=C8F891B4 C=94A2EBEE D=C7043B64 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=93842E98 B=3745961F C=94A2EBEE D=C7043B64 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=BD607D1E B=3745961F C=94A2EBEE D=C7043B64 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=BD607D1E B=3745961F C=94A2EBEE D=A6F72085 T[33]=8771F681 Applying [CDAB 11 16 35]: A=BD607D1E B=3745961F C=BF8B4F98 D=A6F72085 T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=BD607D1E B=DAF7F308 C=BF8B4F98 D=A6F72085 T[35]=FDE5380C Applying [ABCD 1 4 37]: A=35A82A7A B=DAF7F308 C=BF8B4F98 D=A6F72085 T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=35A82A7A B=DAF7F308 C=BF8B4F98 D=89E0EC97 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=35A82A7A B=DAF7F308 C=5ABE099C D=89E0EC97 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=35A82A7A B=CF7E60DB C=5ABE099C D=89E0EC97 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=75C151E2 B=CF7E60DB C=5ABE099C D=89E0EC97 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=75C151E2 B=CF7E60DB C=5ABE099C D=942E0C86 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=75C151E2 B=CF7E60DB C=0C0E6AC4 D=942E0C86 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=75C151E2 B=CC6F5E9E C=0C0E6AC4 D=942E0C86 T[43]=04881D05 Applying [ABCD 9 4 45]: A=0AC50E18 B=CC6F5E9E C=0C0E6AC4 D=942E0C86 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=0AC50E18 B=CC6F5E9E C=0C0E6AC4 D=79CA7845 T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=0AC50E18 B=CC6F5E9E C=8A4A6356 D=79CA7845 T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=0AC50E18 B=918F93BB C=8A4A6356 D=79CA7845 T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=CAB8FE42 B=918F93BB C=8A4A6356 D=79CA7845 T[48]=F4292244 Applying [DABC 7 10 50]: A=CAB8FE42 B=918F93BB C=8A4A6356 D=6A4DAEEE T[49]=432AFF97 Applying [CDAB 14 15 51]: A=CAB8FE42 B=918F93BB C=36269C3F D=6A4DAEEE T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=CAB8FE42 B=1EE405EB C=36269C3F D=6A4DAEEE T[51]=FC93A039 Applying [ABCD 12 6 53]: A=982C7861 B=1EE405EB C=36269C3F D=6A4DAEEE T[52]=655B59C3 Applying [DABC 3 10 54]: A=982C7861 B=1EE405EB C=36269C3F D=6812A362 T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=982C7861 B=1EE405EB C=71FC7709 D=6812A362 T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=982C7861 B=893501C0 C=71FC7709 D=6812A362 T[55]=85845DD1 Applying [ABCD 8 6 57]: A=FEBD62FD B=893501C0 C=71FC7709 D=6812A362 T[56]=6FA87E4F Applying [DABC 15 10 58]: A=FEBD62FD B=893501C0 C=71FC7709 D=28936A74 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=FEBD62FD B=893501C0 C=53E33526 D=28936A74 T[58]=A3014314 Applying [BCDA 13 21 60]: A=FEBD62FD B=AA4D8AE3 C=53E33526 D=28936A74 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=52309E0B B=AA4D8AE3 C=53E33526 D=28936A74 T[60]=F7537E82 Applying [DABC 11 10 62]: A=52309E0B B=AA4D8AE3 C=53E33526 D=50F422F3 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=52309E0B B=AA4D8AE3 C=49DEE633 D=50F422F3 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=52309E0B B=B8E94637 C=49DEE633 D=50F422F3 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=B975C10C B=A8B6F1C0 C=E299C331 D=61267769 [A B C D]: [ 0C, C1, 75, B9, C0, F1, B6, A8, 31, C3, 99, E2, 69, 77, 26, 61 ] MD5 Hash: 0CC175B9C0F1B6A831C399E269772661
Output for "abc":
Calculating MD5 on "abc" Input message is 3 byte(s): [ 61, 62, 63 ] Padding length is 61 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 18, 00, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 1 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 80636261, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000018, 00000000 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=D6D117B4 B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=D6D117B4 B=EFCDAB89 C=98BADCFE D=344A8432 T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=D6D117B4 B=EFCDAB89 C=2F6FBD72 D=344A8432 T[2]=242070DB Applying [BCDA 3 22 4]: A=D6D117B4 B=7AD956F2 C=2F6FBD72 D=344A8432 T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=C73741EF B=7AD956F2 C=2F6FBD72 D=344A8432 T[4]=F57C0FAF Applying [DABC 5 12 6]: A=C73741EF B=7AD956F2 C=2F6FBD72 D=8BAC3051 T[5]=4787C62A Applying [CDAB 6 17 7]: A=C73741EF B=7AD956F2 C=207DC67B D=8BAC3051 T[6]=A8304613 Applying [BCDA 7 22 8]: A=C73741EF B=928D99F6 C=207DC67B D=8BAC3051 T[7]=FD469501 Applying [ABCD 8 7 9]: A=854B3712 B=928D99F6 C=207DC67B D=8BAC3051 T[8]=698098D8 Applying [DABC 9 12 10]: A=854B3712 B=928D99F6 C=207DC67B D=74E2F284 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=854B3712 B=928D99F6 C=3020401C D=74E2F284 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=854B3712 B=5ED49596 C=3020401C D=74E2F284 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=DDA9B9A6 B=5ED49596 C=3020401C D=74E2F284 T[12]=6B901122 Applying [DABC 13 12 14]: A=DDA9B9A6 B=5ED49596 C=3020401C D=A1051895 T[13]=FD987193 Applying [CDAB 14 17 15]: A=DDA9B9A6 B=5ED49596 C=E396856B D=A1051895 T[14]=A679438E Applying [BCDA 15 22 16]: A=DDA9B9A6 B=72AFF2E0 C=E396856B D=A1051895 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=3E9E9126 B=72AFF2E0 C=E396856B D=A1051895 T[16]=F61E2562 Applying [DABC 6 9 18]: A=3E9E9126 B=72AFF2E0 C=E396856B D=4A1D804E T[17]=C040B340 Applying [CDAB 11 14 19]: A=3E9E9126 B=72AFF2E0 C=E25E1652 D=4A1D804E T[18]=265E5A51 Applying [BCDA 0 20 20]: A=3E9E9126 B=B5B204E4 C=E25E1652 D=4A1D804E T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=59A8FFDA B=B5B204E4 C=E25E1652 D=4A1D804E T[20]=D62F105D Applying [DABC 10 9 22]: A=59A8FFDA B=B5B204E4 C=E25E1652 D=6D002F1E T[21]=02441453 Applying [CDAB 15 14 23]: A=59A8FFDA B=B5B204E4 C=ABFC7920 D=6D002F1E T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=59A8FFDA B=47092C07 C=ABFC7920 D=6D002F1E T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=B7F268CF B=47092C07 C=ABFC7920 D=6D002F1E T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=B7F268CF B=47092C07 C=ABFC7920 D=09388EFF T[25]=C33707D6 Applying [CDAB 3 14 27]: A=B7F268CF B=47092C07 C=FE1623B1 D=09388EFF T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=B7F268CF B=786ACB8F C=FE1623B1 D=09388EFF T[27]=455A14ED Applying [ABCD 13 5 29]: A=790A77FB B=786ACB8F C=FE1623B1 D=09388EFF T[28]=A9E3E905 Applying [DABC 2 9 30]: A=790A77FB B=786ACB8F C=FE1623B1 D=9F47E4F8 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=790A77FB B=786ACB8F C=A62884AA D=9F47E4F8 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=790A77FB B=726342D3 C=A62884AA D=9F47E4F8 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=B3707EBF B=726342D3 C=A62884AA D=9F47E4F8 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=B3707EBF B=726342D3 C=A62884AA D=60127B2E T[33]=8771F681 Applying [CDAB 11 16 35]: A=B3707EBF B=726342D3 C=8D212FF5 D=60127B2E T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=B3707EBF B=3B0875C7 C=8D212FF5 D=60127B2E T[35]=FDE5380C Applying [ABCD 1 4 37]: A=21B117B9 B=3B0875C7 C=8D212FF5 D=60127B2E T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=21B117B9 B=3B0875C7 C=8D212FF5 D=6E7429D5 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=21B117B9 B=3B0875C7 C=3575227E D=6E7429D5 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=21B117B9 B=5A2F5EA5 C=3575227E D=6E7429D5 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=11DE1779 B=5A2F5EA5 C=3575227E D=6E7429D5 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=11DE1779 B=5A2F5EA5 C=3575227E D=FADCAA38 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=11DE1779 B=5A2F5EA5 C=31C465CA D=FADCAA38 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=11DE1779 B=4C6124F4 C=31C465CA D=FADCAA38 T[43]=04881D05 Applying [ABCD 9 4 45]: A=7F2E507B B=4C6124F4 C=31C465CA D=FADCAA38 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=7F2E507B B=4C6124F4 C=31C465CA D=99D9679D T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=7F2E507B B=4C6124F4 C=8FAE6399 D=99D9679D T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=7F2E507B B=7BEB9700 C=8FAE6399 D=99D9679D T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=7B201DF8 B=7BEB9700 C=8FAE6399 D=99D9679D T[48]=F4292244 Applying [DABC 7 10 50]: A=7B201DF8 B=7BEB9700 C=8FAE6399 D=F4E8E96E T[49]=432AFF97 Applying [CDAB 14 15 51]: A=7B201DF8 B=7BEB9700 C=B298CEFD D=F4E8E96E T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=7B201DF8 B=8BF025C4 C=B298CEFD D=F4E8E96E T[51]=FC93A039 Applying [ABCD 12 6 53]: A=06CC5E8A B=8BF025C4 C=B298CEFD D=F4E8E96E T[52]=655B59C3 Applying [DABC 3 10 54]: A=06CC5E8A B=8BF025C4 C=B298CEFD D=5B0D97AA T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=06CC5E8A B=8BF025C4 C=7D632DD0 D=5B0D97AA T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=06CC5E8A B=3BFA2C27 C=7D632DD0 D=5B0D97AA T[55]=85845DD1 Applying [ABCD 8 6 57]: A=7F81CC35 B=3BFA2C27 C=7D632DD0 D=5B0D97AA T[56]=6FA87E4F Applying [DABC 15 10 58]: A=7F81CC35 B=3BFA2C27 C=7D632DD0 D=094454AB T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=7F81CC35 B=3BFA2C27 C=4F9DBE3F D=094454AB T[58]=A3014314 Applying [BCDA 13 21 60]: A=7F81CC35 B=7327D604 C=4F9DBE3F D=094454AB T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=310ADE8F B=7327D604 C=4F9DBE3F D=094454AB T[60]=F7537E82 Applying [DABC 11 10 62]: A=310ADE8F B=7327D604 C=4F9DBE3F D=624D8CB2 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=310ADE8F B=7327D604 C=E484B9D8 D=624D8CB2 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=310ADE8F B=C08226B3 C=E484B9D8 D=624D8CB2 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=98500190 B=B04FD23C C=7D3F96D6 D=727FE128 [A B C D]: [ 90, 01, 50, 98, 3C, D2, 4F, B0, D6, 96, 3F, 7D, 28, E1, 7F, 72 ] MD5 Hash: 900150983CD24FB0D6963F7D28E17F72
Output for "message digest":
Calculating MD5 on "message digest" Input message is 14 byte(s): [ 6D, 65, 73, 73, 61, 67, 65, 20, 64, 69, 67, 65, 73, 74 ] Padding length is 50 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 70, 00, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 1 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 7373656D, 20656761, 65676964, 00807473, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000070, 00000000 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=5ED29DAE B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=5ED29DAE B=EFCDAB89 C=98BADCFE D=E2A2FC32 T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=5ED29DAE B=EFCDAB89 C=9073E056 D=E2A2FC32 T[2]=242070DB Applying [BCDA 3 22 4]: A=5ED29DAE B=B9940C11 C=9073E056 D=E2A2FC32 T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=FA62D3A4 B=B9940C11 C=9073E056 D=E2A2FC32 T[4]=F57C0FAF Applying [DABC 5 12 6]: A=FA62D3A4 B=B9940C11 C=9073E056 D=B88DC1C7 T[5]=4787C62A Applying [CDAB 6 17 7]: A=FA62D3A4 B=B9940C11 C=A089A530 D=B88DC1C7 T[6]=A8304613 Applying [BCDA 7 22 8]: A=FA62D3A4 B=C63616CD C=A089A530 D=B88DC1C7 T[7]=FD469501 Applying [ABCD 8 7 9]: A=FCCED5DB B=C63616CD C=A089A530 D=B88DC1C7 T[8]=698098D8 Applying [DABC 9 12 10]: A=FCCED5DB B=C63616CD C=A089A530 D=9BB4C658 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=FCCED5DB B=C63616CD C=4731C077 D=9BB4C658 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=FCCED5DB B=5FF4A4E8 C=4731C077 D=9BB4C658 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=27C95B7F B=5FF4A4E8 C=4731C077 D=9BB4C658 T[12]=6B901122 Applying [DABC 13 12 14]: A=27C95B7F B=5FF4A4E8 C=4731C077 D=034E9992 T[13]=FD987193 Applying [CDAB 14 17 15]: A=27C95B7F B=5FF4A4E8 C=872D34D8 D=034E9992 T[14]=A679438E Applying [BCDA 15 22 16]: A=27C95B7F B=B760921A C=872D34D8 D=034E9992 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=6D3425B2 B=B760921A C=872D34D8 D=034E9992 T[16]=F61E2562 Applying [DABC 6 9 18]: A=6D3425B2 B=B760921A C=872D34D8 D=551AEFA3 T[17]=C040B340 Applying [CDAB 11 14 19]: A=6D3425B2 B=B760921A C=62CDB24B D=551AEFA3 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=6D3425B2 B=F615FBE5 C=62CDB24B D=551AEFA3 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=3D3C3AFC B=F615FBE5 C=62CDB24B D=551AEFA3 T[20]=D62F105D Applying [DABC 10 9 22]: A=3D3C3AFC B=F615FBE5 C=62CDB24B D=343BFF12 T[21]=02441453 Applying [CDAB 15 14 23]: A=3D3C3AFC B=F615FBE5 C=99351D3C D=343BFF12 T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=3D3C3AFC B=E7F48F59 C=99351D3C D=343BFF12 T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=7247931A B=E7F48F59 C=99351D3C D=343BFF12 T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=7247931A B=E7F48F59 C=99351D3C D=E37CF5F6 T[25]=C33707D6 Applying [CDAB 3 14 27]: A=7247931A B=E7F48F59 C=709F1676 D=E37CF5F6 T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=7247931A B=2460FF57 C=709F1676 D=E37CF5F6 T[27]=455A14ED Applying [ABCD 13 5 29]: A=C64F6E00 B=2460FF57 C=709F1676 D=E37CF5F6 T[28]=A9E3E905 Applying [DABC 2 9 30]: A=C64F6E00 B=2460FF57 C=709F1676 D=4E341514 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=C64F6E00 B=2460FF57 C=99CCFCA3 D=4E341514 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=C64F6E00 B=29209D1F C=99CCFCA3 D=4E341514 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=7B425BCB B=29209D1F C=99CCFCA3 D=4E341514 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=7B425BCB B=29209D1F C=99CCFCA3 D=1D72C0D5 T[33]=8771F681 Applying [CDAB 11 16 35]: A=7B425BCB B=29209D1F C=8139174F D=1D72C0D5 T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=7B425BCB B=77401EFF C=8139174F D=1D72C0D5 T[35]=FDE5380C Applying [ABCD 1 4 37]: A=2E678C51 B=77401EFF C=8139174F D=1D72C0D5 T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=2E678C51 B=77401EFF C=8139174F D=AF1A865C T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=2E678C51 B=77401EFF C=26BBF48D D=AF1A865C T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=2E678C51 B=1EAAD7F9 C=26BBF48D D=AF1A865C T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=FF95DBF7 B=1EAAD7F9 C=26BBF48D D=AF1A865C T[40]=289B7EC6 Applying [DABC 0 11 42]: A=FF95DBF7 B=1EAAD7F9 C=26BBF48D D=9FF8129C T[41]=EAA127FA Applying [CDAB 3 16 43]: A=FF95DBF7 B=1EAAD7F9 C=580F8D8E D=9FF8129C T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=FF95DBF7 B=49BD582A C=580F8D8E D=9FF8129C T[43]=04881D05 Applying [ABCD 9 4 45]: A=C5148EB0 B=49BD582A C=580F8D8E D=9FF8129C T[44]=D9D4D039 Applying [DABC 12 11 46]: A=C5148EB0 B=49BD582A C=580F8D8E D=9551398B T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=C5148EB0 B=49BD582A C=8EE8CB35 D=9551398B T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=C5148EB0 B=8F920A7F C=8EE8CB35 D=9551398B T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=1158F562 B=8F920A7F C=8EE8CB35 D=9551398B T[48]=F4292244 Applying [DABC 7 10 50]: A=1158F562 B=8F920A7F C=8EE8CB35 D=3A3BD4BF T[49]=432AFF97 Applying [CDAB 14 15 51]: A=1158F562 B=8F920A7F C=3250A790 D=3A3BD4BF T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=1158F562 B=ED9AC5D4 C=3250A790 D=3A3BD4BF T[51]=FC93A039 Applying [ABCD 12 6 53]: A=7E40A029 B=ED9AC5D4 C=3250A790 D=3A3BD4BF T[52]=655B59C3 Applying [DABC 3 10 54]: A=7E40A029 B=ED9AC5D4 C=3250A790 D=778E9F99 T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=7E40A029 B=ED9AC5D4 C=555E3D90 D=778E9F99 T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=7E40A029 B=C004FC5D C=555E3D90 D=778E9F99 T[55]=85845DD1 Applying [ABCD 8 6 57]: A=853D163F B=C004FC5D C=555E3D90 D=778E9F99 T[56]=6FA87E4F Applying [DABC 15 10 58]: A=853D163F B=C004FC5D C=555E3D90 D=57FF85D4 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=853D163F B=C004FC5D C=61367F65 D=57FF85D4 T[58]=A3014314 Applying [BCDA 13 21 60]: A=853D163F B=671DC236 C=61367F65 D=57FF85D4 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=162448F8 B=671DC236 C=61367F65 D=57FF85D4 T[60]=F7537E82 Applying [DABC 11 10 62]: A=162448F8 B=671DC236 C=61367F65 D=C02F9D34 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=162448F8 B=671DC236 C=98747D54 D=C02F9D34 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=162448F8 B=9DC60BF3 C=98747D54 D=C02F9D34 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=7D696BF9 B=8D93B77C C=312F5A52 D=D061F1AA [A B C D]: [ F9, 6B, 69, 7D, 7C, B7, 93, 8D, 52, 5A, 2F, 31, AA, F1, 61, D0 ] MD5 Hash: F96B697D7CB7938D525A2F31AAF161D0
Output for "abcdefghijklmnopqrstuvwxyz":
Calculating MD5 on "abcdefghijklmnopqrstuvwxyz" Input message is 26 byte(s): [ 61, 62, 63, 64, 65, 66, 67, 68, 69, 6A, 6B, 6C, 6D, 6E, 6F, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7A ] Padding length is 38 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, D0, 00, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 1 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 64636261, 68676665, 6C6B6A69, 706F6E6D, 74737271, 78777675, 00807A79, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 000000D0, 00000000 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=D6D117A6 B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=D6D117A6 B=EFCDAB89 C=98BADCFE D=AAB1AAAA T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=D6D117A6 B=EFCDAB89 C=227D8CF1 D=AAB1AAAA T[2]=242070DB Applying [BCDA 3 22 4]: A=D6D117A6 B=4503B812 C=227D8CF1 D=AAB1AAAA T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=FE15F787 B=4503B812 C=227D8CF1 D=AAB1AAAA T[4]=F57C0FAF Applying [DABC 5 12 6]: A=FE15F787 B=4503B812 C=227D8CF1 D=A811B278 T[5]=4787C62A Applying [CDAB 6 17 7]: A=FE15F787 B=4503B812 C=B71122FC D=A811B278 T[6]=A8304613 Applying [BCDA 7 22 8]: A=FE15F787 B=DA9BBB0D C=B71122FC D=A811B278 T[7]=FD469501 Applying [ABCD 8 7 9]: A=AE752899 B=DA9BBB0D C=B71122FC D=A811B278 T[8]=698098D8 Applying [DABC 9 12 10]: A=AE752899 B=DA9BBB0D C=B71122FC D=2BBE757F T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=AE752899 B=DA9BBB0D C=7D4BD80B D=2BBE757F T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=AE752899 B=56CFA5CB C=7D4BD80B D=2BBE757F T[11]=895CD7BE Applying [ABCD 12 7 13]: A=1754A316 B=56CFA5CB C=7D4BD80B D=2BBE757F T[12]=6B901122 Applying [DABC 13 12 14]: A=1754A316 B=56CFA5CB C=7D4BD80B D=85567D90 T[13]=FD987193 Applying [CDAB 14 17 15]: A=1754A316 B=56CFA5CB C=00DF74D5 D=85567D90 T[14]=A679438E Applying [BCDA 15 22 16]: A=1754A316 B=608D6B7E C=00DF74D5 D=85567D90 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=2D8071CC B=608D6B7E C=00DF74D5 D=85567D90 T[16]=F61E2562 Applying [DABC 6 9 18]: A=2D8071CC B=608D6B7E C=00DF74D5 D=5DCEE119 T[17]=C040B340 Applying [CDAB 11 14 19]: A=2D8071CC B=608D6B7E C=EDFE7E4B D=5DCEE119 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=2D8071CC B=4C2145B3 C=EDFE7E4B D=5DCEE119 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=570C43E0 B=4C2145B3 C=EDFE7E4B D=5DCEE119 T[20]=D62F105D Applying [DABC 10 9 22]: A=570C43E0 B=4C2145B3 C=EDFE7E4B D=977EFD2A T[21]=02441453 Applying [CDAB 15 14 23]: A=570C43E0 B=4C2145B3 C=C28AB49D D=977EFD2A T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=570C43E0 B=C9F162D4 C=C28AB49D D=977EFD2A T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=25BFAE3B B=C9F162D4 C=C28AB49D D=977EFD2A T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=25BFAE3B B=C9F162D4 C=C28AB49D D=89980104 T[25]=C33707D6 Applying [CDAB 3 14 27]: A=25BFAE3B B=C9F162D4 C=F8C8365F D=89980104 T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=25BFAE3B B=E6D3B398 C=F8C8365F D=89980104 T[27]=455A14ED Applying [ABCD 13 5 29]: A=F54D8710 B=E6D3B398 C=F8C8365F D=89980104 T[28]=A9E3E905 Applying [DABC 2 9 30]: A=F54D8710 B=E6D3B398 C=F8C8365F D=927B72E2 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=F54D8710 B=E6D3B398 C=2E69AFC7 D=927B72E2 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=F54D8710 B=AEB35766 C=2E69AFC7 D=927B72E2 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=B4BF680E B=AEB35766 C=2E69AFC7 D=927B72E2 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=B4BF680E B=AEB35766 C=2E69AFC7 D=4C8FFA80 T[33]=8771F681 Applying [CDAB 11 16 35]: A=B4BF680E B=AEB35766 C=2361ED0A D=4C8FFA80 T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=B4BF680E B=06A5E211 C=2361ED0A D=4C8FFA80 T[35]=FDE5380C Applying [ABCD 1 4 37]: A=B9C0C733 B=06A5E211 C=2361ED0A D=4C8FFA80 T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=B9C0C733 B=06A5E211 C=2361ED0A D=F1E6DC7A T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=B9C0C733 B=06A5E211 C=23A9451B D=F1E6DC7A T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=B9C0C733 B=8D41BF99 C=23A9451B D=F1E6DC7A T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=A3E88EAD B=8D41BF99 C=23A9451B D=F1E6DC7A T[40]=289B7EC6 Applying [DABC 0 11 42]: A=A3E88EAD B=8D41BF99 C=23A9451B D=02C0B11C T[41]=EAA127FA Applying [CDAB 3 16 43]: A=A3E88EAD B=8D41BF99 C=66F6468D D=02C0B11C T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=A3E88EAD B=90A35AF5 C=66F6468D D=02C0B11C T[43]=04881D05 Applying [ABCD 9 4 45]: A=B5D41F9C B=90A35AF5 C=66F6468D D=02C0B11C T[44]=D9D4D039 Applying [DABC 12 11 46]: A=B5D41F9C B=90A35AF5 C=66F6468D D=A04B4904 T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=B5D41F9C B=90A35AF5 C=703D54D8 D=A04B4904 T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=B5D41F9C B=71D10367 C=703D54D8 D=A04B4904 T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=FC32DD6E B=71D10367 C=703D54D8 D=A04B4904 T[48]=F4292244 Applying [DABC 7 10 50]: A=FC32DD6E B=71D10367 C=703D54D8 D=65456B34 T[49]=432AFF97 Applying [CDAB 14 15 51]: A=FC32DD6E B=71D10367 C=B35602CB D=65456B34 T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=FC32DD6E B=33EDB197 C=B35602CB D=65456B34 T[51]=FC93A039 Applying [ABCD 12 6 53]: A=C1E942F1 B=33EDB197 C=B35602CB D=65456B34 T[52]=655B59C3 Applying [DABC 3 10 54]: A=C1E942F1 B=33EDB197 C=B35602CB D=D9BB987C T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=C1E942F1 B=33EDB197 C=23A68048 D=D9BB987C T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=C1E942F1 B=83877D1B C=23A68048 D=D9BB987C T[55]=85845DD1 Applying [ABCD 8 6 57]: A=0077C208 B=83877D1B C=23A68048 D=D9BB987C T[56]=6FA87E4F Applying [DABC 15 10 58]: A=0077C208 B=83877D1B C=23A68048 D=847FC2E7 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=0077C208 B=83877D1B C=A3E2247F D=847FC2E7 T[58]=A3014314 Applying [BCDA 13 21 60]: A=0077C208 B=5E6BC930 C=A3E2247F D=847FC2E7 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=708ED9C2 B=5E6BC930 C=A3E2247F D=847FC2E7 T[60]=F7537E82 Applying [DABC 11 10 62]: A=708ED9C2 B=5E6BC930 C=A3E2247F D=2BAF1354 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=708ED9C2 B=5E6BC930 C=D38F1E7F D=2BAF1354 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=708ED9C2 B=1116E6D8 C=D38F1E7F D=2BAF1354 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=D7D3FCC3 B=00E49261 C=6C49FB7D D=3BE167CA [A B C D]: [ C3, FC, D3, D7, 61, 92, E4, 00, 7D, FB, 49, 6C, CA, 67, E1, 3B ] MD5 Hash: C3FCD3D76192E4007DFB496CCA67E13B
Output for "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":
Calculating MD5 on "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" Input message is 62 byte(s): [ 41, 42, 43, 44, 45, 46, 47, 48, 49, 4A, 4B, 4C, 4D, 4E, 4F, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 5A, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6A, 6B, 6C, 6D, 6E, 6F, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7A, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ] Padding length is 66 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, F0, 01, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 2 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 44434241, 48474645, 4C4B4A49, 504F4E4D, 54535251, 58575655, 62615A59, 66656463, 6A696867, 6E6D6C6B, 7271706F, 76757473, 7A797877, 33323130, 37363534, 00803938 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=C6C10796 B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=C6C10796 B=EFCDAB89 C=98BADCFE D=99A09999 T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=C6C10796 B=EFCDAB89 C=11067980 D=99A09999 T[2]=242070DB Applying [BCDA 3 22 4]: A=C6C10796 B=27BCE07A C=11067980 D=99A09999 T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=F22E6C4E B=27BCE07A C=11067980 D=99A09999 T[4]=F57C0FAF Applying [DABC 5 12 6]: A=F22E6C4E B=27BCE07A C=11067980 D=B4AC9218 T[5]=4787C62A Applying [CDAB 6 17 7]: A=F22E6C4E B=27BCE07A C=A95A2FC0 D=B4AC9218 T[6]=A8304613 Applying [BCDA 7 22 8]: A=F22E6C4E B=A4799506 C=A95A2FC0 D=B4AC9218 T[7]=FD469501 Applying [ABCD 8 7 9]: A=1EB3E7C1 B=A4799506 C=A95A2FC0 D=B4AC9218 T[8]=698098D8 Applying [DABC 9 12 10]: A=1EB3E7C1 B=A4799506 C=A95A2FC0 D=A6E70CFE T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=1EB3E7C1 B=A4799506 C=CA27520B D=A6E70CFE T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=1EB3E7C1 B=8A7612EC C=CA27520B D=A6E70CFE T[11]=895CD7BE Applying [ABCD 12 7 13]: A=3CBDCD45 B=8A7612EC C=CA27520B D=A6E70CFE T[12]=6B901122 Applying [DABC 13 12 14]: A=3CBDCD45 B=8A7612EC C=CA27520B D=B8DEC763 T[13]=FD987193 Applying [CDAB 14 17 15]: A=3CBDCD45 B=8A7612EC C=FA148C8A D=B8DEC763 T[14]=A679438E Applying [BCDA 15 22 16]: A=3CBDCD45 B=5D38E690 C=FA148C8A D=B8DEC763 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=04B9D52A B=5D38E690 C=FA148C8A D=B8DEC763 T[16]=F61E2562 Applying [DABC 6 9 18]: A=04B9D52A B=5D38E690 C=FA148C8A D=783002EB T[17]=C040B340 Applying [CDAB 11 14 19]: A=04B9D52A B=5D38E690 C=D3EE3ED1 D=783002EB T[18]=265E5A51 Applying [BCDA 0 20 20]: A=04B9D52A B=47AE7C81 C=D3EE3ED1 D=783002EB T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=2D7D8A3F B=47AE7C81 C=D3EE3ED1 D=783002EB T[20]=D62F105D Applying [DABC 10 9 22]: A=2D7D8A3F B=47AE7C81 C=D3EE3ED1 D=D1210823 T[21]=02441453 Applying [CDAB 15 14 23]: A=2D7D8A3F B=47AE7C81 C=4B534DC3 D=D1210823 T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=2D7D8A3F B=75292030 C=4B534DC3 D=D1210823 T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=9D2A6E33 B=75292030 C=4B534DC3 D=D1210823 T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=9D2A6E33 B=75292030 C=4B534DC3 D=0E8D2E44 T[25]=C33707D6 Applying [CDAB 3 14 27]: A=9D2A6E33 B=75292030 C=D473B564 D=0E8D2E44 T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=9D2A6E33 B=F2FF6EA0 C=D473B564 D=0E8D2E44 T[27]=455A14ED Applying [ABCD 13 5 29]: A=9B085FA9 B=F2FF6EA0 C=D473B564 D=0E8D2E44 T[28]=A9E3E905 Applying [DABC 2 9 30]: A=9B085FA9 B=F2FF6EA0 C=D473B564 D=4400A9BD T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=9B085FA9 B=F2FF6EA0 C=5993248F D=4400A9BD T[30]=676F02D9 Applying [BCDA 12 20 32]: A=9B085FA9 B=DD789ECC C=5993248F D=4400A9BD T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=21C8D2B7 B=DD789ECC C=5993248F D=4400A9BD T[32]=FFFA3942 Applying [DABC 8 11 34]: A=21C8D2B7 B=DD789ECC C=5993248F D=1D55A18E T[33]=8771F681 Applying [CDAB 11 16 35]: A=21C8D2B7 B=DD789ECC C=056EC119 D=1D55A18E T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=21C8D2B7 B=1B9504F8 C=056EC119 D=1D55A18E T[35]=FDE5380C Applying [ABCD 1 4 37]: A=436B7FE9 B=1B9504F8 C=056EC119 D=1D55A18E T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=436B7FE9 B=1B9504F8 C=056EC119 D=075800C1 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=436B7FE9 B=1B9504F8 C=F404C2F6 D=075800C1 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=436B7FE9 B=CF0341ED C=F404C2F6 D=075800C1 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=888E7D8A B=CF0341ED C=F404C2F6 D=075800C1 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=888E7D8A B=CF0341ED C=F404C2F6 D=BBDAECD8 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=888E7D8A B=CF0341ED C=CE620273 D=BBDAECD8 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=888E7D8A B=047B9419 C=CE620273 D=BBDAECD8 T[43]=04881D05 Applying [ABCD 9 4 45]: A=2DBEE21D B=047B9419 C=CE620273 D=BBDAECD8 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=2DBEE21D B=047B9419 C=CE620273 D=E95C3A43 T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=2DBEE21D B=047B9419 C=EE46E961 D=E95C3A43 T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=2DBEE21D B=F166F514 C=EE46E961 D=E95C3A43 T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=E47FD4F3 B=F166F514 C=EE46E961 D=E95C3A43 T[48]=F4292244 Applying [DABC 7 10 50]: A=E47FD4F3 B=F166F514 C=EE46E961 D=FB887751 T[49]=432AFF97 Applying [CDAB 14 15 51]: A=E47FD4F3 B=F166F514 C=F22AEDCC D=FB887751 T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=E47FD4F3 B=7A13BC5C C=F22AEDCC D=FB887751 T[51]=FC93A039 Applying [ABCD 12 6 53]: A=A691D430 B=7A13BC5C C=F22AEDCC D=FB887751 T[52]=655B59C3 Applying [DABC 3 10 54]: A=A691D430 B=7A13BC5C C=F22AEDCC D=528452F2 T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=A691D430 B=7A13BC5C C=3FC23DF6 D=528452F2 T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=A691D430 B=EFB0E72F C=3FC23DF6 D=528452F2 T[55]=85845DD1 Applying [ABCD 8 6 57]: A=27145703 B=EFB0E72F C=3FC23DF6 D=528452F2 T[56]=6FA87E4F Applying [DABC 15 10 58]: A=27145703 B=EFB0E72F C=3FC23DF6 D=21A11069 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=27145703 B=EFB0E72F C=374FBE79 D=21A11069 T[58]=A3014314 Applying [BCDA 13 21 60]: A=27145703 B=49D9A5B4 C=374FBE79 D=21A11069 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=1CB80F0A B=49D9A5B4 C=374FBE79 D=21A11069 T[60]=F7537E82 Applying [DABC 11 10 62]: A=1CB80F0A B=49D9A5B4 C=374FBE79 D=EA3D3EB4 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=1CB80F0A B=49D9A5B4 C=10F68731 D=EA3D3EB4 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=1CB80F0A B=EF2E3A46 C=10F68731 D=EA3D3EB4 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=83FD320B B=DEFBE5CF C=A9B1642F D=FA6F932A Starting processing on block #1: [ 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 000001F0, 00000000 ] Before all rounds: A=83FD320B B=DEFBE5CF C=A9B1642F D=FA6F932A; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=EDA23ED1 B=DEFBE5CF C=A9B1642F D=FA6F932A T[0]=D76AA478 Applying [DABC 1 12 2]: A=EDA23ED1 B=DEFBE5CF C=A9B1642F D=989939CF T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=EDA23ED1 B=DEFBE5CF C=3C307338 D=989939CF T[2]=242070DB Applying [BCDA 3 22 4]: A=EDA23ED1 B=DDCF0634 C=3C307338 D=989939CF T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=75144433 B=DDCF0634 C=3C307338 D=989939CF T[4]=F57C0FAF Applying [DABC 5 12 6]: A=75144433 B=DDCF0634 C=3C307338 D=C8875807 T[5]=4787C62A Applying [CDAB 6 17 7]: A=75144433 B=DDCF0634 C=C783CB60 D=C8875807 T[6]=A8304613 Applying [BCDA 7 22 8]: A=75144433 B=99B6B699 C=C783CB60 D=C8875807 T[7]=FD469501 Applying [ABCD 8 7 9]: A=A60A3F69 B=99B6B699 C=C783CB60 D=C8875807 T[8]=698098D8 Applying [DABC 9 12 10]: A=A60A3F69 B=99B6B699 C=C783CB60 D=AA6630BE T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=A60A3F69 B=99B6B699 C=64DB26E9 D=AA6630BE T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=A60A3F69 B=64CC7C5A C=64DB26E9 D=AA6630BE T[11]=895CD7BE Applying [ABCD 12 7 13]: A=A70737DA B=64CC7C5A C=64DB26E9 D=AA6630BE T[12]=6B901122 Applying [DABC 13 12 14]: A=A70737DA B=64CC7C5A C=64DB26E9 D=5473F8A7 T[13]=FD987193 Applying [CDAB 14 17 15]: A=A70737DA B=64CC7C5A C=96F6586E D=5473F8A7 T[14]=A679438E Applying [BCDA 15 22 16]: A=A70737DA B=A36F556F C=96F6586E D=5473F8A7 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=A5050AD3 B=A36F556F C=96F6586E D=5473F8A7 T[16]=F61E2562 Applying [DABC 6 9 18]: A=A5050AD3 B=A36F556F C=96F6586E D=28776046 T[17]=C040B340 Applying [CDAB 11 14 19]: A=A5050AD3 B=A36F556F C=27DCD8B4 D=28776046 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=A5050AD3 B=82B8827C C=27DCD8B4 D=28776046 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=E04F070C B=82B8827C C=27DCD8B4 D=28776046 T[20]=D62F105D Applying [DABC 10 9 22]: A=E04F070C B=82B8827C C=27DCD8B4 D=2F3CD2A2 T[21]=02441453 Applying [CDAB 15 14 23]: A=E04F070C B=82B8827C C=C0D22B61 D=2F3CD2A2 T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=E04F070C B=DF35CB56 C=C0D22B61 D=2F3CD2A2 T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=242DD210 B=DF35CB56 C=C0D22B61 D=2F3CD2A2 T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=242DD210 B=DF35CB56 C=C0D22B61 D=576ACE33 T[25]=C33707D6 Applying [CDAB 3 14 27]: A=242DD210 B=DF35CB56 C=5C295967 D=576ACE33 T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=242DD210 B=2291191A C=5C295967 D=576ACE33 T[27]=455A14ED Applying [ABCD 13 5 29]: A=24EBA695 B=2291191A C=5C295967 D=576ACE33 T[28]=A9E3E905 Applying [DABC 2 9 30]: A=24EBA695 B=2291191A C=5C295967 D=4BD0378B T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=24EBA695 B=2291191A C=10C42A2F D=4BD0378B T[30]=676F02D9 Applying [BCDA 12 20 32]: A=24EBA695 B=9C03E2E8 C=10C42A2F D=4BD0378B T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=5BE1D526 B=9C03E2E8 C=10C42A2F D=4BD0378B T[32]=FFFA3942 Applying [DABC 8 11 34]: A=5BE1D526 B=9C03E2E8 C=10C42A2F D=9E414279 T[33]=8771F681 Applying [CDAB 11 16 35]: A=5BE1D526 B=9C03E2E8 C=9F4A1A7E D=9E414279 T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=5BE1D526 B=A2448453 C=9F4A1A7E D=9E414279 T[35]=FDE5380C Applying [ABCD 1 4 37]: A=E14E403D B=A2448453 C=9F4A1A7E D=9E414279 T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=E14E403D B=A2448453 C=9F4A1A7E D=E8CFD670 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=E14E403D B=A2448453 C=60CC183A D=E8CFD670 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=E14E403D B=FE314121 C=60CC183A D=E8CFD670 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=FFF62809 B=FE314121 C=60CC183A D=E8CFD670 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=FFF62809 B=FE314121 C=60CC183A D=E37209AC T[41]=EAA127FA Applying [CDAB 3 16 43]: A=FFF62809 B=FE314121 C=8CB5221C D=E37209AC T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=FFF62809 B=7C7E974C C=8CB5221C D=E37209AC T[43]=04881D05 Applying [ABCD 9 4 45]: A=54C9EB3A B=7C7E974C C=8CB5221C D=E37209AC T[44]=D9D4D039 Applying [DABC 12 11 46]: A=54C9EB3A B=7C7E974C C=8CB5221C D=D4D9C6AC T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=54C9EB3A B=7C7E974C C=2EC86F72 D=D4D9C6AC T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=54C9EB3A B=79C0710A C=2EC86F72 D=D4D9C6AC T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=02095AF1 B=79C0710A C=2EC86F72 D=D4D9C6AC T[48]=F4292244 Applying [DABC 7 10 50]: A=02095AF1 B=79C0710A C=2EC86F72 D=13D245FD T[49]=432AFF97 Applying [CDAB 14 15 51]: A=02095AF1 B=79C0710A C=A8DCFE26 D=13D245FD T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=02095AF1 B=2BA98E3F C=A8DCFE26 D=13D245FD T[51]=FC93A039 Applying [ABCD 12 6 53]: A=E126C1AA B=2BA98E3F C=A8DCFE26 D=13D245FD T[52]=655B59C3 Applying [DABC 3 10 54]: A=E126C1AA B=2BA98E3F C=A8DCFE26 D=96B00FA7 T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=E126C1AA B=2BA98E3F C=6F287FF5 D=96B00FA7 T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=E126C1AA B=FB7BCEE0 C=6F287FF5 D=96B00FA7 T[55]=85845DD1 Applying [ABCD 8 6 57]: A=452C1099 B=FB7BCEE0 C=6F287FF5 D=96B00FA7 T[56]=6FA87E4F Applying [DABC 15 10 58]: A=452C1099 B=FB7BCEE0 C=6F287FF5 D=CA801BA6 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=452C1099 B=FB7BCEE0 C=C197EA8E D=CA801BA6 T[58]=A3014314 Applying [BCDA 13 21 60]: A=452C1099 B=5AC74608 C=C197EA8E D=CA801BA6 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=14AE42C6 B=5AC74608 C=C197EA8E D=CA801BA6 T[60]=F7537E82 Applying [DABC 11 10 62]: A=14AE42C6 B=5AC74608 C=C197EA8E D=A52DAE75 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=14AE42C6 B=5AC74608 C=826AFD76 D=A52DAE75 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=14AE42C6 B=16DD9203 C=826AFD76 D=A52DAE75 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=98AB74D1 B=F5D977D2 C=2C1C61A5 D=9F9D419F [A B C D]: [ D1, 74, AB, 98, D2, 77, D9, F5, A5, 61, 1C, 2C, 9F, 41, 9D, 9F ] MD5 Hash: D174AB98D277D9F5A5611C2C9F419D9F
Output for "12345678901234567890123456789012345678901234567890123456789012345678901234567890":
Calculating MD5 on "12345678901234567890123456789012345678901234567890123456789012345678901234567890" Input message is 80 byte(s): [ 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30 ] Padding length is 48 bytes: [ 80, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 80, 02, 00, 00, 00, 00, 00, 00 ] Total number of 512-bit (16 word) blocks: 2 Initializing A=67452301 B=EFCDAB89 C=98BADCFE D=10325476 Starting processing on block #0: [ 34333231, 38373635, 32313039, 36353433, 30393837, 34333231, 38373635, 32313039, 36353433, 30393837, 34333231, 38373635, 32313039, 36353433, 30393837, 34333231 ] Before all rounds: A=67452301 B=EFCDAB89 C=98BADCFE D=10325476; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=BEB8FF8E B=EFCDAB89 C=98BADCFE D=10325476 T[0]=D76AA478 Applying [DABC 1 12 2]: A=BEB8FF8E B=EFCDAB89 C=98BADCFE D=7D989D89 T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=BEB8FF8E B=EFCDAB89 C=F8CDF95D D=7D989D89 T[2]=242070DB Applying [BCDA 3 22 4]: A=BEB8FF8E B=862797B0 C=F8CDF95D D=7D989D89 T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=8C17DE9F B=862797B0 C=F8CDF95D D=7D989D89 T[4]=F57C0FAF Applying [DABC 5 12 6]: A=8C17DE9F B=862797B0 C=F8CDF95D D=C0F32D81 T[5]=4787C62A Applying [CDAB 6 17 7]: A=8C17DE9F B=862797B0 C=E99FEC1B D=C0F32D81 T[6]=A8304613 Applying [BCDA 7 22 8]: A=8C17DE9F B=C57E78C1 C=E99FEC1B D=C0F32D81 T[7]=FD469501 Applying [ABCD 8 7 9]: A=7C0ACEB7 B=C57E78C1 C=E99FEC1B D=C0F32D81 T[8]=698098D8 Applying [DABC 9 12 10]: A=7C0ACEB7 B=C57E78C1 C=E99FEC1B D=8869D2D8 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=7C0ACEB7 B=C57E78C1 C=5186A8BA D=8869D2D8 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=7C0ACEB7 B=A5F36F8D C=5186A8BA D=8869D2D8 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=5157E49E B=A5F36F8D C=5186A8BA D=8869D2D8 T[12]=6B901122 Applying [DABC 13 12 14]: A=5157E49E B=A5F36F8D C=5186A8BA D=FFAC907E T[13]=FD987193 Applying [CDAB 14 17 15]: A=5157E49E B=A5F36F8D C=27E983A0 D=FFAC907E T[14]=A679438E Applying [BCDA 15 22 16]: A=5157E49E B=AF506A03 C=27E983A0 D=FFAC907E T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=8D18E0E8 B=AF506A03 C=27E983A0 D=FFAC907E T[16]=F61E2562 Applying [DABC 6 9 18]: A=8D18E0E8 B=AF506A03 C=27E983A0 D=07DE0DF2 T[17]=C040B340 Applying [CDAB 11 14 19]: A=8D18E0E8 B=AF506A03 C=EF223167 D=07DE0DF2 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=8D18E0E8 B=04280170 C=EF223167 D=07DE0DF2 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=78929EE0 B=04280170 C=EF223167 D=07DE0DF2 T[20]=D62F105D Applying [DABC 10 9 22]: A=78929EE0 B=04280170 C=EF223167 D=375C6C2C T[21]=02441453 Applying [CDAB 15 14 23]: A=78929EE0 B=04280170 C=B18ACA50 D=375C6C2C T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=78929EE0 B=AD400A91 C=B18ACA50 D=375C6C2C T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=BB45F43F B=AD400A91 C=B18ACA50 D=375C6C2C T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=BB45F43F B=AD400A91 C=B18ACA50 D=D61F8A0F T[25]=C33707D6 Applying [CDAB 3 14 27]: A=BB45F43F B=AD400A91 C=98ADE6B5 D=D61F8A0F T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=BB45F43F B=B70E35A9 C=98ADE6B5 D=D61F8A0F T[27]=455A14ED Applying [ABCD 13 5 29]: A=F8BCFBB0 B=B70E35A9 C=98ADE6B5 D=D61F8A0F T[28]=A9E3E905 Applying [DABC 2 9 30]: A=F8BCFBB0 B=B70E35A9 C=98ADE6B5 D=D760ED39 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=F8BCFBB0 B=B70E35A9 C=99A0F1B8 D=D760ED39 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=F8BCFBB0 B=1BF25662 C=99A0F1B8 D=D760ED39 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=3DBD76CA B=1BF25662 C=99A0F1B8 D=D760ED39 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=3DBD76CA B=1BF25662 C=99A0F1B8 D=FD056171 T[33]=8771F681 Applying [CDAB 11 16 35]: A=3DBD76CA B=1BF25662 C=C7ED7C30 D=FD056171 T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=3DBD76CA B=E0162F49 C=C7ED7C30 D=FD056171 T[35]=FDE5380C Applying [ABCD 1 4 37]: A=3B32C408 B=E0162F49 C=C7ED7C30 D=FD056171 T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=3B32C408 B=E0162F49 C=C7ED7C30 D=7338D8B7 T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=3B32C408 B=E0162F49 C=9EF871AD D=7338D8B7 T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=3B32C408 B=1D4D6F72 C=9EF871AD D=7338D8B7 T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=C661460A B=1D4D6F72 C=9EF871AD D=7338D8B7 T[40]=289B7EC6 Applying [DABC 0 11 42]: A=C661460A B=1D4D6F72 C=9EF871AD D=D2BF04C9 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=C661460A B=1D4D6F72 C=D6D5B879 D=D2BF04C9 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=C661460A B=89E3C4D7 C=D6D5B879 D=D2BF04C9 T[43]=04881D05 Applying [ABCD 9 4 45]: A=697032EC B=89E3C4D7 C=D6D5B879 D=D2BF04C9 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=697032EC B=89E3C4D7 C=D6D5B879 D=FA597BFC T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=697032EC B=89E3C4D7 C=EFC2C171 D=FA597BFC T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=697032EC B=DB4197DA C=EFC2C171 D=FA597BFC T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=57B91ACA B=DB4197DA C=EFC2C171 D=FA597BFC T[48]=F4292244 Applying [DABC 7 10 50]: A=57B91ACA B=DB4197DA C=EFC2C171 D=210C9EBC T[49]=432AFF97 Applying [CDAB 14 15 51]: A=57B91ACA B=DB4197DA C=21EFBD88 D=210C9EBC T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=57B91ACA B=CAA25B01 C=21EFBD88 D=210C9EBC T[51]=FC93A039 Applying [ABCD 12 6 53]: A=633D3F7C B=CAA25B01 C=21EFBD88 D=210C9EBC T[52]=655B59C3 Applying [DABC 3 10 54]: A=633D3F7C B=CAA25B01 C=21EFBD88 D=1A4D3BEB T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=633D3F7C B=CAA25B01 C=CCAA1524 D=1A4D3BEB T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=633D3F7C B=7713F5DF C=CCAA1524 D=1A4D3BEB T[55]=85845DD1 Applying [ABCD 8 6 57]: A=8448B430 B=7713F5DF C=CCAA1524 D=1A4D3BEB T[56]=6FA87E4F Applying [DABC 15 10 58]: A=8448B430 B=7713F5DF C=CCAA1524 D=71C93463 T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=8448B430 B=7713F5DF C=7E294727 D=71C93463 T[58]=A3014314 Applying [BCDA 13 21 60]: A=8448B430 B=660A801D C=7E294727 D=71C93463 T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=614868EB B=660A801D C=7E294727 D=71C93463 T[60]=F7537E82 Applying [DABC 11 10 62]: A=614868EB B=660A801D C=7E294727 D=A09F38A7 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=614868EB B=660A801D C=5133129B D=A09F38A7 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=614868EB B=B4D33102 C=5133129B D=A09F38A7 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=C88D8BEC B=A4A0DC8B C=E9EDEF99 D=B0D18D1D Starting processing on block #1: [ 38373635, 32313039, 36353433, 30393837, 00000080, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000280, 00000000 ] Before all rounds: A=C88D8BEC B=A4A0DC8B C=E9EDEF99 D=B0D18D1D; saving as AA/BB/CC/DD Round 1, using F() Applying [ABCD 0 7 1]: A=353AF7CF B=A4A0DC8B C=E9EDEF99 D=B0D18D1D T[0]=D76AA478 Applying [DABC 1 12 2]: A=353AF7CF B=A4A0DC8B C=E9EDEF99 D=3A4F735A T[1]=E8C7B756 Applying [CDAB 2 17 3]: A=353AF7CF B=A4A0DC8B C=63356537 D=3A4F735A T[2]=242070DB Applying [BCDA 3 22 4]: A=353AF7CF B=45E88F2C C=63356537 D=3A4F735A T[3]=C1BDCEEE Applying [ABCD 4 7 5]: A=3527497E B=45E88F2C C=63356537 D=3A4F735A T[4]=F57C0FAF Applying [DABC 5 12 6]: A=3527497E B=45E88F2C C=63356537 D=AB92660E T[5]=4787C62A Applying [CDAB 6 17 7]: A=3527497E B=45E88F2C C=948347AE D=AB92660E T[6]=A8304613 Applying [BCDA 7 22 8]: A=3527497E B=377C7D0A C=948347AE D=AB92660E T[7]=FD469501 Applying [ABCD 8 7 9]: A=CC912F27 B=377C7D0A C=948347AE D=AB92660E T[8]=698098D8 Applying [DABC 9 12 10]: A=CC912F27 B=377C7D0A C=948347AE D=6945A3D5 T[9]=8B44F7AF Applying [CDAB 10 17 11]: A=CC912F27 B=377C7D0A C=AE23894D D=6945A3D5 T[10]=FFFF5BB1 Applying [BCDA 11 22 12]: A=CC912F27 B=B9EDE40C C=AE23894D D=6945A3D5 T[11]=895CD7BE Applying [ABCD 12 7 13]: A=DB4FF71C B=B9EDE40C C=AE23894D D=6945A3D5 T[12]=6B901122 Applying [DABC 13 12 14]: A=DB4FF71C B=B9EDE40C C=AE23894D D=9B6B4960 T[13]=FD987193 Applying [CDAB 14 17 15]: A=DB4FF71C B=B9EDE40C C=04396A39 D=9B6B4960 T[14]=A679438E Applying [BCDA 15 22 16]: A=DB4FF71C B=58B12EAB C=04396A39 D=9B6B4960 T[15]=49B40821 Round 2, using G() Applying [ABCD 1 5 17]: A=52C00CAE B=58B12EAB C=04396A39 D=9B6B4960 T[16]=F61E2562 Applying [DABC 6 9 18]: A=52C00CAE B=58B12EAB C=04396A39 D=AAD2A216 T[17]=C040B340 Applying [CDAB 11 14 19]: A=52C00CAE B=58B12EAB C=A476AF6F D=AAD2A216 T[18]=265E5A51 Applying [BCDA 0 20 20]: A=52C00CAE B=50F8DE8C C=A476AF6F D=AAD2A216 T[19]=E9B6C7AA Applying [ABCD 5 5 21]: A=0D6E6D91 B=50F8DE8C C=A476AF6F D=AAD2A216 T[20]=D62F105D Applying [DABC 10 9 22]: A=0D6E6D91 B=50F8DE8C C=A476AF6F D=17D64195 T[21]=02441453 Applying [CDAB 15 14 23]: A=0D6E6D91 B=50F8DE8C C=D5B7A850 D=17D64195 T[22]=D8A1E681 Applying [BCDA 4 20 24]: A=0D6E6D91 B=043CB080 C=D5B7A850 D=17D64195 T[23]=E7D3FBC8 Applying [ABCD 9 5 25]: A=74F9377E B=043CB080 C=D5B7A850 D=17D64195 T[24]=21E1CDE6 Applying [DABC 14 9 26]: A=74F9377E B=043CB080 C=D5B7A850 D=01F2ADDD T[25]=C33707D6 Applying [CDAB 3 14 27]: A=74F9377E B=043CB080 C=E775C8CA D=01F2ADDD T[26]=F4D50D87 Applying [BCDA 8 20 28]: A=74F9377E B=CB00B96E C=E775C8CA D=01F2ADDD T[27]=455A14ED Applying [ABCD 13 5 29]: A=8761F38E B=CB00B96E C=E775C8CA D=01F2ADDD T[28]=A9E3E905 Applying [DABC 2 9 30]: A=8761F38E B=CB00B96E C=E775C8CA D=7A516116 T[29]=FCEFA3F8 Applying [CDAB 7 14 31]: A=8761F38E B=CB00B96E C=061BC867 D=7A516116 T[30]=676F02D9 Applying [BCDA 12 20 32]: A=8761F38E B=67092C33 C=061BC867 D=7A516116 T[31]=8D2A4C8A Round 3, using H() Applying [ABCD 5 4 33]: A=91044D5D B=67092C33 C=061BC867 D=7A516116 T[32]=FFFA3942 Applying [DABC 8 11 34]: A=91044D5D B=67092C33 C=061BC867 D=610954EB T[33]=8771F681 Applying [CDAB 11 16 35]: A=91044D5D B=67092C33 C=C0175FA8 D=610954EB T[34]=6D9D6122 Applying [BCDA 14 23 36]: A=91044D5D B=2EE1E3FE C=C0175FA8 D=610954EB T[35]=FDE5380C Applying [ABCD 1 4 37]: A=AE26ED7D B=2EE1E3FE C=C0175FA8 D=610954EB T[36]=A4BEEA44 Applying [DABC 4 11 38]: A=AE26ED7D B=2EE1E3FE C=C0175FA8 D=71D8ECEA T[37]=4BDECFA9 Applying [CDAB 7 16 39]: A=AE26ED7D B=2EE1E3FE C=FF4A94DC D=71D8ECEA T[38]=F6BB4B60 Applying [BCDA 10 23 40]: A=AE26ED7D B=DBD1BFF6 C=FF4A94DC D=71D8ECEA T[39]=BEBFBC70 Applying [ABCD 13 4 41]: A=9C350028 B=DBD1BFF6 C=FF4A94DC D=71D8ECEA T[40]=289B7EC6 Applying [DABC 0 11 42]: A=9C350028 B=DBD1BFF6 C=FF4A94DC D=97E5DA92 T[41]=EAA127FA Applying [CDAB 3 16 43]: A=9C350028 B=DBD1BFF6 C=FACAAF06 D=97E5DA92 T[42]=D4EF3085 Applying [BCDA 6 23 44]: A=9C350028 B=56B3692F C=FACAAF06 D=97E5DA92 T[43]=04881D05 Applying [ABCD 9 4 45]: A=71123AFA B=56B3692F C=FACAAF06 D=97E5DA92 T[44]=D9D4D039 Applying [DABC 12 11 46]: A=71123AFA B=56B3692F C=FACAAF06 D=DC9C8DDB T[45]=E6DB99E5 Applying [CDAB 15 16 47]: A=71123AFA B=56B3692F C=E6A8A386 D=DC9C8DDB T[46]=1FA27CF8 Applying [BCDA 2 23 48]: A=71123AFA B=1DF7010A C=E6A8A386 D=DC9C8DDB T[47]=C4AC5665 Round 4, using I() Applying [ABCD 0 6 49]: A=D29007E7 B=1DF7010A C=E6A8A386 D=DC9C8DDB T[48]=F4292244 Applying [DABC 7 10 50]: A=D29007E7 B=1DF7010A C=E6A8A386 D=7241A77E T[49]=432AFF97 Applying [CDAB 14 15 51]: A=D29007E7 B=1DF7010A C=D3248109 D=7241A77E T[50]=AB9423A7 Applying [BCDA 5 21 52]: A=D29007E7 B=C8797828 C=D3248109 D=7241A77E T[51]=FC93A039 Applying [ABCD 12 6 53]: A=7A504ABD B=C8797828 C=D3248109 D=7241A77E T[52]=655B59C3 Applying [DABC 3 10 54]: A=7A504ABD B=C8797828 C=D3248109 D=211CC65D T[53]=8F0CCC92 Applying [CDAB 10 15 55]: A=7A504ABD B=C8797828 C=A290D6CE D=211CC65D T[54]=FFEFF47D Applying [BCDA 1 21 56]: A=7A504ABD B=9B31B114 C=A290D6CE D=211CC65D T[55]=85845DD1 Applying [ABCD 8 6 57]: A=723FD22D B=9B31B114 C=A290D6CE D=211CC65D T[56]=6FA87E4F Applying [DABC 15 10 58]: A=723FD22D B=9B31B114 C=A290D6CE D=D21D6A3B T[57]=FE2CE6E0 Applying [CDAB 6 15 59]: A=723FD22D B=9B31B114 C=3D79CF74 D=D21D6A3B T[58]=A3014314 Applying [BCDA 13 21 60]: A=723FD22D B=4DC4F33D C=3D79CF74 D=D21D6A3B T[59]=4E0811A1 Applying [ABCD 4 6 61]: A=DA67616B B=4DC4F33D C=3D79CF74 D=D21D6A3B T[60]=F7537E82 Applying [DABC 11 10 62]: A=DA67616B B=4DC4F33D C=3D79CF74 D=C9E47A04 T[61]=BD3AF235 Applying [CDAB 2 15 63]: A=DA67616B B=4DC4F33D C=44EC5A13 D=C9E47A04 T[62]=2AD7D2BB Applying [BCDA 9 21 64]: A=DA67616B B=B12906A0 C=44EC5A13 D=C9E47A04 T[63]=EB86D391 After adding original values (AA/BB/CC/DD): A=A2F4ED57 B=55C9E32B C=2EDA49AC D=7AB60721 [A B C D]: [ 57, ED, F4, A2, 2B, E3, C9, 55, AC, 49, DA, 2E, 21, 07, B6, 7A ] MD5 Hash: 57EDF4A22BE3C955AC49DA2E2107B67A
Implementation in Java: <lang java>class MD5Debug {
private static int INIT_A = 0x67452301; private static int INIT_B = (int)0xEFCDAB89L; private static int INIT_C = (int)0x98BADCFEL; private static int INIT_D = 0x10325476; private static int[] SHIFT_AMTS = new int[] { 7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21 }; private static int[] TABLE_T = new int[64]; static { for (int i = 0; i < 64; i++) TABLE_T[i] = (int)(long)((1L << 32) * Math.abs(Math.sin(i + 1))); } public static byte[] computeMD5(byte[] message) { int messageLenBytes = message.length; int numBlocks = ((messageLenBytes + 8) >>> 6) + 1; int totalLen = numBlocks << 6; byte[] paddingBytes = new byte[totalLen - messageLenBytes]; paddingBytes[0] = (byte)0x80; long messageLenBits = (long)messageLenBytes << 3; for (int i = 0; i < 8; i++) { paddingBytes[paddingBytes.length - 8 + i] = (byte)messageLenBits; messageLenBits >>>= 8; } System.out.println("Input message is " + messageLenBytes + " byte(s): " + toHexArray(message)); System.out.println("Padding length is " + paddingBytes.length + " bytes: " + toHexArray(paddingBytes)); System.out.println("Total number of 512-bit (16 word) blocks: " + numBlocks); int a = INIT_A; int b = INIT_B; int c = INIT_C; int d = INIT_D; int[] buffer = new int[16]; System.out.println("Initializing A=" + toHexString(a) + " B=" + toHexString(b) + " C=" + toHexString(c) + " D=" + toHexString(d)); for (int i = 0; i < numBlocks; i ++) { int index = i << 6; for (int j = 0; j < 64; j++, index++) buffer[j >>> 2] = ((int)((index < messageLenBytes) ? message[index] : paddingBytes[index - messageLenBytes]) << 24) | (buffer[j >>> 2] >>> 8); System.out.println("Starting processing on block #" + i + ": " + toHexArray(buffer)); int originalA = a; int originalB = b; int originalC = c; int originalD = d; System.out.println(" Before all rounds: A=" + toHexString(a) + " B=" + toHexString(b) + " C=" + toHexString(c) + " D=" + toHexString(d) + "; saving as AA/BB/CC/DD"); for (int j = 0; j < 64; j++) { int mod16 = j & 0x0F; int div16 = j >>> 4; int f = 0; int bufferIndex = j; if (mod16 == 0) System.out.println(" Round " + (div16 + 1) + ", using " + "FGHI".charAt(div16) + "()"); switch (div16) { case 0: f = (b & c) | (~b & d); break; case 1: f = (b & d) | (c & ~d); bufferIndex = (bufferIndex * 5 + 1) & 0x0F; break; case 2: f = b ^ c ^ d; bufferIndex = (bufferIndex * 3 + 5) & 0x0F; break; case 3: f = c ^ (b | ~d); bufferIndex = (bufferIndex * 7) & 0x0F; break; } int temp = b + Integer.rotateLeft(a + f + buffer[bufferIndex] + TABLE_T[j], SHIFT_AMTS[(div16 << 2) | (j & 3)]); a = d; d = c; c = b; b = temp; int[] debugVars = { a, b, c, d }; System.out.println(" Applying [" + "BCDABCD".substring(3 - (j & 3), 7 - (j & 3)) + " " + padTwo(bufferIndex) + " " + padTwo(SHIFT_AMTS[(div16 << 2) | (j & 3)]) + " " + padTwo(j + 1) + "]: A=" + toHexString(debugVars[(j + 1) & 3]) + " B=" + toHexString(debugVars[(j + 2) & 3]) + " C=" + toHexString(debugVars[(j + 3) & 3]) + " D=" + toHexString(debugVars[j & 3]) + " T[" + j + "]=" + toHexString(TABLE_T[j])); if (((j + 1) & 3) == 0) System.out.println(); } a += originalA; b += originalB; c += originalC; d += originalD; System.out.println(" After adding original values (AA/BB/CC/DD): A=" + toHexString(a) + " B=" + toHexString(b) + " C=" + toHexString(c) + " D=" + toHexString(d)); } byte[] md5 = new byte[16]; int count = 0; for (int i = 0; i < 4; i++) { int n = (i == 0) ? a : ((i == 1) ? b : ((i == 2) ? c : d)); for (int j = 0; j < 4; j++) { md5[count++] = (byte)n; n >>>= 8; } } System.out.println("[A B C D]: " + toHexArray(md5)); return md5; } public static String padTwo(int n) { String s = String.valueOf(n); if (s.length() == 1) s = " " +s; return s; } public static String toHexString(int n) { char[] outputChars = new char[8]; String HEX_CHARS = "0123456789ABCDEF"; for (int i = 7; i >= 0; i--) { outputChars[i] = HEX_CHARS.charAt(n & 0x0F); n >>>= 4; } return new String(outputChars); }
public static String toHexString(byte b) { String HEX_CHARS = "0123456789ABCDEF"; int n = (int)b & 0xFF; return new String(new char[] { HEX_CHARS.charAt(n >>> 4), HEX_CHARS.charAt(n & 0x0F) } ); } public static String toHexString(byte[] b) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < b.length; i++) sb.append(toHexString(b[i])); return sb.toString(); } public static String toHexArray(byte[] b) { StringBuilder sb = new StringBuilder("[ "); for (int i = 0; i < b.length; i++) { if (i > 0) sb.append(", "); sb.append(toHexString(b[i])); } sb.append(" ]"); return sb.toString(); } public static String toHexArray(int[] b) { StringBuilder sb = new StringBuilder("[ "); for (int i = 0; i < b.length; i++) { if (i > 0) sb.append(", "); sb.append(toHexString(b[i])); } sb.append(" ]"); return sb.toString(); } public static void main(String[] args) { String[] testStrings = { "", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "12345678901234567890123456789012345678901234567890123456789012345678901234567890" }; if (args.length > 0) testStrings = args; for (String s : testStrings) { System.out.println("Calculating MD5 on \"" + s + "\""); byte[] md5 = computeMD5(s.getBytes()); System.out.println("MD5 Hash: " + toHexString(md5)); System.out.println(); } return; }
}</lang>