Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password and http 1

Status
Not open for further replies.

petersJazz

Programmer
Jan 28, 2002
222
EU
hi,

is there a simple way to encrypt a password given in a form so that it will be sent crypted to server where a php script will decrypt it?
 
You have to click on links to see what they have, petersJazz. BPRS's obviously underscored [red]this[/red] is a link to a webpage that has an answer to your question.

I personally use a one-way hash of the password for this kind of thing and store the hash in the database. That way no one will be able to retrieve the password, and matching the hashed value against the hashed value works the same as matching a decrypted password against a stored password.

Lee
 
Sorry, I missed the link. Your comment makes sence, thank you a lot. But now I have to find out how to do it. I have very limited experiance in client side programming, us to do everything on server.

Peter
 
Hi Diancecht,

the links in the article lead me nowhere?

regards
 
Looks nice but it is very complicated and I have no idee how to implement it on a web page.
 
Here's a quick one that I've used for a number of years. I won't guarantee it can't be cracked or that it won't produce duplicate values.

Code:
function checklogin(onestring)
{
var mult=1, hnumber=0;
for (var si=0;si<onestring.length;si++)
  {
  var onenumber=onestring.charCodeAt(si) * mult;
  hnumber += onenumber;
  mult *= 3;
  }
return hnumber;
}

Lee
 
OK, thank you, but I dont understand how html and javascript are linked. Im reading som introductions now.
 
Encrypt the password when the form is submitted, put the value in a hidden input, and then the script on the server that processes the form will get the value.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top