[SOLVED]Md5 login system? |
Author: |
Message: |
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
Joined: Aug 2004
|
O.P. [SOLVED]Md5 login system?
For my bot utilities script, I'd like to have a multiple admin login system. What I need to know is, how would I go about calculating md5 from a recieved message.
Example: !login lou_habs | mypassword
The script would grab the user and see if it's in the login list, if it is, it grabs the password (after the |) and calculates the md5. Then it checks if the md5 matches with variable "md5".
Short: Grab username, check if it matches, if it does, grab password, calculate md5, see if it matches
This post was edited on 06-27-2006 at 08:07 PM by Lou.
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
|
|
06-27-2006 07:13 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: [HELP]Md5 login system?
|
|
06-27-2006 07:36 PM |
|
|
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
Joined: Aug 2004
|
O.P. RE: [HELP]Md5 login system?
quote: Originally posted by Ezra
Try this JavaScript function
http://pajhome.org.uk/crypt/md5/md5.js
How would I go about using that code? I think it has something to do with these functions but I'm not sure code: /*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
edit: What I mean is, how would I tell my own code to transfer text to md5 afterwards?
This post was edited on 06-27-2006 at 07:49 PM by Lou.
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
|
|
06-27-2006 07:43 PM |
|
|
L. Coyote
Senior Member
Captain Obvious
Posts: 981 Reputation: 49
39 / /
Joined: Aug 2004
Status: Away
|
RE: [HELP]Md5 login system?
Have you thought about looking at the site, Lou? => http://pajhome.org.uk/crypt/md5/
quote: When you want to calculate a hash, use:
<script type="text/javascript" >
hash = hex_md5("input string");
</script>
Hack, hack, hack!
Finally became a Systems Analyst!
|
|
06-27-2006 07:48 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: [HELP]Md5 login system?
Just call one of those functions from your code.
For example
var hashedpassw = hex_md5("password");
EDIT: I tested it because that script is JavaScript and not JScript, but it seems to work.
I tested with this:
function OnEvent_Initialize(MessengerStart)
{
Debug.Trace(" MD5: " + hex_md5("hello_world"));
}
and just added the md5.js file in the same folder as the test script.
This post was edited on 06-27-2006 at 07:54 PM by Ezra.
|
|
06-27-2006 07:50 PM |
|
|
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
Joined: Aug 2004
|
O.P. RE: [HELP]Md5 login system?
quote: Originally posted by Leonardo
Have you thought about looking at the site, Lou?
Nope I thought it was just a download
So I could go "Onwhateverevent();{
hash = hex_md5("input string")
return hash;
}
and that would give me the md5 code I need?
This post was edited on 06-27-2006 at 07:52 PM by Lou.
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
|
|
06-27-2006 07:52 PM |
|
|
absorbation
Elite Member
Posts: 3636 Reputation: 81
– / /
Joined: Feb 2005
|
RE: [HELP]Md5 login system?
Hang on, this checks the deatails on an external webpage? If so, md5 information on the webpage, it would be alot more sercure .
|
|
06-27-2006 07:54 PM |
|
|
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
Joined: Aug 2004
|
O.P. RE: [HELP]Md5 login system?
quote: Originally posted by absorbation
Hang on, this checks the deatails on an external webpage? If so, md5 information on the webpage, it would be alot more sercure .
External? No this would run directly in the scripts file.
I'll try that code you gave ezra and I'll post back.
edit: It works perfectly. Thank you
This post was edited on 06-27-2006 at 08:03 PM by Lou.
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
|
|
06-27-2006 07:55 PM |
|
|
Ezra
Veteran Member
Forgiveness is between them and God
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
|
RE: [HELP]Md5 login system?
quote: Originally posted by .Lou
quote: Originally posted by Leonardo
Have you thought about looking at the site, Lou?
Nope I thought it was just a download
So I could go "Onwhateverevent();{
hash = hex_md5("input string")
return hash;
}
and that would give me the md5 code I need?
well... why would you return the has on an event?
and you don't need to make another function. If you add that script file in the folder it's like it's one big file, so you can just call the function like it's in your script.
var hash = hex_md5("password");
|
|
06-27-2006 07:59 PM |
|
|
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
Joined: Aug 2004
|
O.P. RE: [HELP]Md5 login system?
quote: Originally posted by Ezra
and you don't need to make another function. If you add that script file in the folder it's like it's one big file, so you can just call the function like it's in your script.
No its because I want to check the recieved message, if it's !login <username> | <password> then itll take <password> and see if it matches
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
|
|
06-27-2006 08:05 PM |
|
|
|