943,582 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 585
  • C++ RSS
Aug 15th, 2009
0

need someone familiar with MD4 and SSE2

Expand Post »
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:
Quote ...
“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:

C++ Syntax (Toggle Plain Text)
  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:

C++ Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
dzhugashvili is offline Offline
35 posts
since Jun 2009
Aug 17th, 2009
0

Re: need someone familiar with MD4 and SSE2

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?
Reputation Points: 10
Solved Threads: 0
Light Poster
dzhugashvili is offline Offline
35 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Trying to read a txt file in c++
Next Thread in C++ Forum Timeline: learn MFC





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC