Jump to content

md5 forms


Madatan

Recommended Posts

Okey so I got a login form thats sending the password to a database, I want the password to be converted into md5. How do I do that? and then, how do I do in the login area so it read it as md5?

[code]


form id="form1" name="form1" method="post" action="">
    <input type="text" name="anv" />
  </p>
<p>Email:
<input name="email" type="text" id="email" />
</p>
<p>L&ouml;senord:
<input name="losen" type="password" id="losen" />
<input name="ranger" type="submit" id="ranger" value="Register" />
</p>
</form>
[/code]
Link to comment
Share on other sites

to use md5 encryption you simply need to use teh md5(); function.

I have seen many scripts that process the data posted from a form and do md5 on recipet of the info - which for me completely defeats the object. Sure the string shoudl be encrypted client side (if js is on!) prior to being sent over the network......
Link to comment
Share on other sites


//Translate from md5

Well you dont need to.

In your database you store the encrytped password, then upon checking you take the users entered password, md5 it and check the md5 against the md5 that you stored in your database...Matched? Great then proceed.

$users_password=$_POST['password'];
$md5thepassword=md5($users_password);

blah blah select blah where blah = $md5thepassword

Kinda thing

Make sense?

Will

Link to comment
Share on other sites

MD5() is a 32 Bit One Way encryption
32Bit?
What ever the value
$a = "";
$a = "this is a long sentance, but I cant think of anything to type";

with using md5(), the value is 32 chars long (32 bits)

One Way Encryption

Means, you can not get a MD5 Encrypted string, and translate it back to what it was.

Although rumours have spread that hackers can. But think to yourself, Is your information Soo Important that a hack wants to hack the enctryption.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.