Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

85 users online



encrypting

encrypting

Currently viewing this thread: 1 (0 members and 1 guests)


bcfc4life

bcfc4life

Status: Offline!

encrypting

i have read the thread about forgot password and i want to know how to encrypt a password and how to get it when logging in.

Any help is appreciated

___________________

http://www.rforsyth54.pwp.blueyonder.co.uk/images/rob.jpg

damell

damell

Status: Offline!

look up md5 function, mysql password() function also works.

___________________

//damell

Unini

Unini

overall Funny Guy
Status: Offline!

The best way to encrypt a password would be to use the md5 function

PHP:

<?php
$password 
'test';
$password md5($password);  //creates a MD5 hash
?>

that would return an encrypted string.
Store it where ever you want

To log in use the following

PHP:

<?php
//$userpassword is the password the user has filled in
//$oldpassword would be the md5 hash that you created earlier
$userpassword md5($userpassword); // Create a MD5 hash

if($userpassword == $oldpassword//Check the 2 passwords
{
  
// If passwords match
  
echo 'Congratulations!';
} else {
  
// if password dont match
  
echo 'I dont know how to tell you this, but...';
}
?>

that should help you get on the way Smile

___________________

"I find it kinda funny, I find it kinda sad,
The dreams in wich I'm dying are the best i've ever had"

proweb

proweb

Status: Offline!

i just worked out how i can encrypt ****ty scripts admin panles that are supposed to use .htpasswd woooooohooooo Grin

___________________

ProWebUK || Professional web services || www.ProWebUK.com

if video games affected us as children, then we would all be running around in dark rooms, munching magical pills and dancing to repetitive music!

Gnome-Cookie

Gnome-Cookie

Status: Offline!

Hehe, very useful information here.

___________________

http://members.lycos.co.uk/dark2053/ninja.gif
Hehe, isn't he cute.

DDU2003

DDU2003

Status: Offline!

I would say using md5() is the best way to go. You won't be able to retrieve/view passwords after they are encrypted, but you can solve this by creating a script that automatically resets the password to something which your users can get emailed to them when they request a new password.

You can also encrypt the data through other means, but it's much more complicated and involves a lot of complicated code which I would say is not worth it for 90% of projects.

-- DDU2003

___________________

---

DDU2003

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.008 seconds.