C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
md5 in C++ Posted by RipZ on 12 Feb 2003 at 2:19 PM
How can I md5 a string in c++?
In exampel PHP we use md5("my word here"), but how can I do it in C++?

Report
Re: md5 in C++ Posted by stober on 12 Feb 2003 at 5:21 PM
: How can I md5 a string in c++?
: In exampel PHP we use md5("my word here"), but how can I do it in C++?
:
:

what does md5 do? what is the result of your example?

Report
Re: md5 in C++ Posted by DB1 on 12 Feb 2003 at 10:04 PM
: : How can I md5 a string in c++?
: : In exampel PHP we use md5("my word here"), but how can I do it in C++?
: :
: :
:
: what does md5 do? what is the result of your example?
:
:

MD5 is just a hash algorithm used mostly for password transmission over the net. It's almost useless because anyone who can sniff a network packet can just capture and resend the md5'd string to the server just as easily as capturing and resending an unencrypted string.

Anyway there is no built-in C++ function to hash a stream of data. but you can find some MD5 source all over the net. In windows you can probably #include <wincrypt.h> and use CryptCreateHash() with CALG_MD5 as the ALG_ID then call CryptHashData() to feed the data that needs encrypting. Check MSDN for more info.

Programming is like kids... One mistake and you have to support it for life

Report
Re: md5 in C++ Posted by delphifred on 11 Nov 2008 at 3:36 PM
: MD5 is just a hash algorithm used mostly for password transmission
: over the net. It's almost useless because anyone who can sniff a
: network packet can just capture and resend the md5'd string to the
: server just as easily as capturing and resending an unencrypted
: string.

That's why "nonce" is used. To produce an unique hash for each and every request.



Report
Re: md5 in C++ Posted by blacklight332 on 28 Feb 2009 at 9:22 AM
A lot of people use PHP for md5(), and when they use a C++ implementation it doesn't always return the same hash.

This implementation's hashes match that of php. I found the c++ md5 function article on zedwood.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.