Hi Remy!

Remy HAREL schrieb am 2004-04-30 15:52:44:
>   I'm looking for a function that would return a MD5 word on 128 bits 
> encryption based on a char* that would be given in argument, just 
> something like :

I don't know what you want to do. But I want to suggest that in most
cases you should use SHA-1 or some other bigger hash function than MD5.

>  (char * ) md5function(char * arg1 )

/* needed variables */
md5_state_t temp;
md5_byte_t result[16]);

/* the md5 calls */
md5_init(&temp);
md5_append(&temp, arg1, strlen(arg1));
md5_finish(&temp, result);

... the result is now in result ... but it's binary! You might convert
it to base64 or hex ... that's up to you and what you want the digest
for.



Tot kijk
    Matthias
-- 
Fon: +49-(0)70 0770 07770       http://matthias.wimmer.name/
HAM: DB1MW                      xmpp:[EMAIL PROTECTED]

Attachment: signature.asc
Description: Digital signature

_______________________________________________
jdev mailing list
[EMAIL PROTECTED]
https://jabberstudio.org/mailman/listinfo/jdev

Reply via email to