md5 in C++ - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

md5 in C++

RipZRipZ Posts: 11Member
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++?

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : 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?

  • DB1DB1 Posts: 1,142Member
    : : 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 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.

    [italic][blue]Programming is like kids... One mistake and you have to support it for life[/blue][/italic]

  • delphifreddelphifred Posts: 1Member
    : 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.



  • blacklight332blacklight332 Posts: 1Member
    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 [link=http://www.zedwood.com/article/121/cpp-md5-function]c++ md5 function[/link] article on zedwood.
This discussion has been closed.