need someone familiar with MD4 and SSE2

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2009
Posts: 33
Reputation: dzhugashvili is an unknown quantity at this point 
Solved Threads: 0
dzhugashvili dzhugashvili is offline Offline
Light Poster

need someone familiar with MD4 and SSE2

 
0
  #1
Aug 15th, 2009
hello. I need help implementing an SSE2-accelerated MD4 implementation. I found one that I think may work at http://www.freerainbowtables.com/php...t=904&start=30
it is the post by Corni:
“So, I took a crashcourse in how to implement MD4 and in what the hell is SSE2 and how do you use it, and implemented the reference implementation in SSE…”
but need help implementing it. It is a little over my head. All I want to do is conduct 4 MD4 encryptions simultaneously using SSE2.

I have this, for example:

  1. char candidate0[]="password0";
  2. char candidate1[]="password1";
  3. char candidate2[]="password2";
  4. char candidate3[]="password3";

I believe I need to pad them and append the length, or whatever the MD4 algorithm requires, before feeding them into the compressSse() function which will do the rest of the work to turn them into 4 MD4 hashes.

Maybe somebody knows of a better SSE2-accelerated MD4 routine? Easier/ faster? I also plan to use this for NTLM and MSCACHE, so I would like to retain the flexibility to use or not to use UNICODE conversion. I think the implementation above might include UNICODE conversion. I would like to keep that separate, so I can use it for NTLM and MD4.

here is pseudocode for my planned future implementation in a password brute forcer:

  1. int cached_hashes=0;//counts how many plaintexts are ready, when 4, compute
  2. char candidate[];//the candidate password
  3. char plaintexts[4][];//stores all 4 plaintexts
  4. unsigned char ready_candidate[16];//plaintexts prepared for the compressSse() function
  5. unsigned char encrypted[16];//the encrypted password we are trying to recover
  6.  
  7. while(bruteforcing)
  8. {
  9. candidate++;
  10. memcpy(plaintexts[cached_hashes],candidate,strlen(candidate));
  11. //possibly UNICODE conversion here, depending on hash type
  12. prepare candidate- padding, whatever- store in ready_candidate
  13. memcpy(input[cached_hashes],ready_candidate,16);
  14. cached_hashes++;
  15. if(cached_hashes==4)//if 4 candidates ready and stored...
  16. {
  17. //MD4 encrypt them all simultaneously
  18. compressSse();
  19. cached_hashes=0;
  20. //I'm assuming that compressSse() writes the MD4 hashes
  21. //back into input[] elements, respectively
  22. for(int i=0;i<4;i++)
  23. if(!memcmp(input[i],encrypted,16)
  24. cout<<"plaintext is "<<plaintext[i]<<"!\n";
  25. }
  26. }

I generate one candidate at a time, and then wait until I have collected 4 candidates and then encrypt them all simultaneously. Then I check the results one-by-one, again.

I think once I can get an SSE2-accelerated MD4 implementation up and running, I should be able to modify it to turn it into an SSE2-accelerated MD5 implementation
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 33
Reputation: dzhugashvili is an unknown quantity at this point 
Solved Threads: 0
dzhugashvili dzhugashvili is offline Offline
Light Poster

Re: need someone familiar with MD4 and SSE2

 
0
  #2
Aug 17th, 2009
Hey. I thought I would bring this thread up again since there seems to be more traffic during the week. Anybody know how I would go about this?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC