1 / 13

MD5 Cryptographic Hash

MD5 Cryptographic Hash. Team Rogue VI Jile Gao(jxg3950@rit.edu) Matthew Allen(mma3543@rit.edu. Agenda. MD5 Primitive Original Design Original Measurements Analysis Revised Design Revised Measurements Revised Analysis What we learned? Discussion of future work Questions.

braden
Download Presentation

MD5 Cryptographic Hash

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MD5 Cryptographic Hash Team Rogue VI Jile Gao(jxg3950@rit.edu) Matthew Allen(mma3543@rit.edu

  2. Agenda • MD5 Primitive • Original Design • Original Measurements • Analysis • Revised Design • Revised Measurements • Revised Analysis • What we learned? • Discussion of future work • Questions

  3. The MD5 Primitive • Written by R Rivest at MIT in 1991 • MD5 replaces MD4 • Accepts a message of arbitrary length and outputs a 128 bit digest/signature • Designed to be fast on 32 bit machines • No large S-Tables

  4. Original Design • Used the reference implementation to decipher the spec • Static Object • Read in from file in 1024 byte chunks and processed in 64 byte smaller chunks • Each chunk is transformed to four 32 bit ints that are used as part of the next transform • The last chunk is different • The final digest is the last four ints output from transform in low to high bit sequence

  5. Original Measurements • Bad… Just plain BAD • Longer than 12 hours run time(14400ms per) • Redesigned to remove the IO problems and just work with the encrypts • 3000000 in 114.432s or 38.14ms per • Arraycopy was the worst offender(42.5%) • Transform was next at 19.3%

  6. Analysis • Nothing we can do with arraycopy other than find a way to stop copying so much • Several times in the implementation there are new arrays created • There are only four rounds so it can’t be unrolled

  7. Revised Design • Turned into a dynamic object • Turned state array into state variables • Removed array creation from functions • Unrolled I from II(etc)(inlined) • Inlined the bitwise rotates

  8. Revised Measurements • Much better • 3000000 in 92.724 or 30.90ms per • Roughly a 20% increase in performance

  9. Revised Analysis • The inlining of the rotates and I(etc) functions greatly helped • Transform is the only user modifiable function with high percentages and is about as optimized as possible • Arraycopy is non-controllable • Arraycopy 55.1% of results • Transform 21.3% of results

  10. What we learned? • Inlining reduces the number of method calls and speeds up processing • Converting arrays to variables reduces the number of repeated memory allocations • The spec is convoluted and potentially difficult to understand • The reference implementation is useful in translating the spec • The profiler didn’t point out anything useful

  11. Discussion of future work • Unrolling the decode function • For the truly insane, inline the FF, GG, HH and II functions inside transform

  12. Review • MD5 Primitive • Original Design • Original Measurements • Analysis • Revised Design • Revised Measurements • Revised Analysis • What we learned? • Discussion of future work

  13. Questions?

More Related