MD5/Implementation Debug: Difference between revisions

m
Mistake regarding variable update order
(Created page with "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 mod...")
 
m (Mistake regarding variable update order)
Line 1:
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 BD, then C, then DB. During the 64 computations spread over four rounds, each variable will be updated 16 times.
 
Output for "":