Bluehost.com Web Hosting $6.95

MD5 password encyption - how?

This is a discussion on MD5 password encyption - how? within the FreeRADIUS Users forums, part of the Networking and Network Related category; I was hoping someone could explain what I'm doing wrong here. I'm confused to how I should go ...


Go Back   Usenet Forums > Networking and Network Related > FreeRADIUS Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-13-2005
Arun Mundray
 
Posts: n/a
Default MD5 password encyption - how?

I was hoping someone could explain what I'm doing wrong here. I'm confused
to how I should go about encrypting the password using MD5 on a client. To
keep this simple i'm using a password less the 16 chars. So why doesn't this
work? In a buffer i'm adding a random vector to the secret, then running MD5
and XORing the result with password. The result is placed (copied) as the
user-password, and the vector value copied to the packet header. Seems
right? But clearly it isn't! The packet seems well formed but the user
password is decrypted as garbage (Radius -X).

/* MD5 Make a hash of the data */

createIndentifier(vector);

/* Calculate the md5 digest */
secretlen = strlen(secret);
memcpy(md5buf, secret, secretlen);
memcpy(md5buf + secretlen, vector, RADIUS_RANDOM_VECTOR_LEN);

MD5_Init (&sum);
MD5_Update (&sum, md5buf, secretlen + RADIUS_RANDOM_VECTOR_LEN);
MD5_Final (digest, &sum);

memset(passbuf, 0, RADIUS_RANDOM_VECTOR_LEN);
strcpy(passbuf, password);

for (i = 0; i < RADIUS_RANDOM_VECTOR_LEN; i++)
{
// run through the 16 values of the digest and XOR with password
result[i] = digest[i] ^ passbuf[i];
}

Thanks,

Arun M.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:48 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0