Jump to content


Photo

md5 forms


  • Please log in to reply
4 replies to this topic

#1 Madatan

Madatan
  • Members
  • PipPipPip
  • Advanced Member
  • 51 posts

Posted 22 August 2006 - 10:41 AM

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?



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>


#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 22 August 2006 - 10:44 AM

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......
follow me on twitter @PHPsycho

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 22 August 2006 - 10:49 AM

$a = $_GET['losen'];

$a = md5($a);

then insert $a into databse

#4 willpower

willpower
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationWarrington, Cheshire, UK

Posted 22 August 2006 - 10:53 AM


//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


Wait...I've got it...Bollocks, it's gone again!

If at first you don't succeed....stop using ASP and get onto PHP

#5 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 22 August 2006 - 11:13 AM

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.
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users