[jdev] Md5 again...

Remy HAREL remy.harel at GICM.FR
Thu May 6 05:27:04 CDT 2004

 Hi all,

     I'd like to hash this  string

rem at jabber.gicm.net/Gabber

with MD5, when I run echo rem at jabber.gicm.net/Gabber|md5sum I got this 
result :

8a6d946e132886e619bf5eb3bb9e7dbd where as in my jabberd server, I got :

 This is the part of my code c2s/c2s.c which is responsible for encoding 
the string to MD5 :
            md5_state_t temp;
            md5_byte_t result[16];
            char *jidMD5;

            md5_append(&temp,(char*) sess->jid, strlen((char*) sess->jid) );
            md5_finish(&temp, result);

            jidMD5Hex = (char*) malloc(2* sizeof(md5_byte_t)*16 + 1);
            hex_from_raw(result, sizeof(md5_byte_t)*16, jidMD5Hex);

Please someone can help me, I don't understand what is wrong with that.

Remy Harel - remy.harel at gicm.fr
G.I.C.M - Distributed Systems & IT
Linux Registered User #224740

More information about the JDev mailing list