Jump to content
  • Advertisement
Sign in to follow this  
stevek2k

C++ md5 hashing

This topic is 4502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm currently working on a local client wrote in C++ that interacts with mysql, kind of local website if you will. Just finished the login system on the website end, database and almost the C end, thing is for storing the password I used md5 hashing and I cant figure out how to hash the damn incoming C++ password with any great ease. Seemingly there are two ways of doing it 1.use the rsa md5 headers, which seem to be broke for me, dont know what the prob is there or 2. use the windows crypt api (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographymd5classtopic.asp) now bearing in mind i have some experience with C++ but not to much can anyone give me an idea of how either of the above work, preferable the easiest one :) Thanks

Share this post


Link to post
Share on other sites
Advertisement
There are plenty of available MD5 implementations in C++ if you'd prefer to have actual code to look at.

Otherwise, the Windows Cryptography API is probably your best shot. The link you have is to a .Net wrapper for that API, which won't be easy to use in vanilla C++. You can find documentation for accessing the CryptAPI directly here which should be fairly straightforward as long as you're at least marginally familiar with Win32 programming.

Of course you also have the option of just asking MySQL to do the hashing for you: SELECT MD5("foo") but that's not terribly efficient and probably isn't a good idea if you need to do a lot of hashing outside the data layer.

Share this post


Link to post
Share on other sites
Lol thanks, taking a look at those sites now, i've been up and down the internet trying to find some good resources, as for the mysql md5 can't believe i never thought of that but pity i cant use even as a quick fix cus im using a flavoured salt which im gonna bump up security on laters

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!