[bme-develop] MD5?
Status: Planning
Brought to you by:
sirmik
|
From: Sir M. <obe...@ho...> - 2004-07-31 12:38:25
|
Hi Daniel, copied the code here, could you tell me if I'm understanding it correctly? char hash[strlen(chr_hash)+1]; strcpy(hash,chr_hash); hash is the string encoded? why length + 1? int digestLen = 0; uchar digest[32]; digest contains the encoded string? Common::check_crypt_error(cryptContext,cryptCreateContext(&cryptContext, CRYPT_UNUSED, CRYPT_ALGO_MD5),"ERROR while creating MD5 context"); make a MD5 encoding cryptlib context? Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,hash,strlen(hash)),"ERROR Setting MD5 Hash"); one part of the concatenated string? Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,pass,strlen(pass)),"ERROR Setting MD5 Password"); second part? Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,hash,0),"ERROR hashing"); encrypt it? where's pass? Common::check_crypt_error(cryptContext,cryptGetAttributeString(cryptContext, CRYPT_CTXINFO_HASHVALUE, digest, &digestLen),"ERROR getting hash"); get the encrypted string and move it into digest? Common::check_crypt_error(cryptContext,cryptDestroyContext(cryptContext), "ERROR while destroying"); destroy context: clean up? hex(digest,hex_str); return hex_str; convert digest into hexidecimal? Now for email I have to encode the following(also see http://www.hypothetic.org/docs/msn/notification/messages.php): "creds - is the MD5 hexadecimal digest of the concatenated strings MSPAuth + sl + password. MD5 is discussed on the pings/challenges page." so could the code look like this: Common::check_crypt_error(cryptContext,cryptCreateContext(&cryptContext, CRYPT_UNUSED, CRYPT_ALGO_MD5),"ERROR while creating MD5 context"); Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,MSPAuth,strlen(MSPAuth)),"ERROR Setting MD5 Hash"); Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,sl,strlen(sl)),"ERROR Setting MD5 Password"); Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,password,strlen(password)),"ERROR Setting MD5 Password"); Common::check_crypt_error(cryptContext,cryptEncrypt(cryptContext,hash,0),"ERROR hashing"); uhm??? Common::check_crypt_error(cryptContext,cryptGetAttributeString(cryptContext, CRYPT_CTXINFO_HASHVALUE, digest, &digestLen),"ERROR getting hash"); Common::check_crypt_error(cryptContext,cryptDestroyContext(cryptContext), "ERROR while destroying"); hex(digest,hex_str); ???? hope you can help, after that I have to search for a javascript complient browser that also can be started from Bme....If I'm not mistaken the Dano net+ is the browser I'm searching, as Mozilla(FireFox) doesn't work in that way yet! regards, Tim _________________________________________________________________ Play online games with your friends with MSN Messenger http://messenger.msn.nl/ |