Jump to content

Need help 1 way encrypting passwords.


cooldude832

Recommended Posts

I'm wanting to one way encrypt passwords users enter into my database using the crypt(); function.  However as I read tutorial after tutorial i'm very confused on the syntax of using a salt to ensure you get the same results both ways.  After reading a bit I think baublefish is the best encryption method, but how do I actually write it out.

 

$password = $_REQUEST['password'];
$cryptpassword = crypt($password,??????????);

 

Link to comment
https://forums.phpfreaks.com/topic/54122-need-help-1-way-encrypting-passwords/
Share on other sites

so sha1 doesn't require a user salt added i can just say:

$password = sha1($_REQUEST['password']);
and then compare
$sql "SELECT * FROM USERS WHERE Password = '$password'";

 

is it secure to passs the password with POST or is there some encryption I should include on my form?

 

so sha1 doesn't require a user salt added i can just say:

$password = sha1($_REQUEST['password']);
and then compare
$sql "SELECT * FROM USERS WHERE Password = '$password'";

 

is it secure to passs the password with POST or is there some encryption I should include on my form?

 

 

Secure enough as long as you aren't passing credit card information, than you would want an SSH server which would encrypt the data anyhow.

 

But yea, just do not store the un-encrypted password in the session or the cookie. Anytime you reference that password in code it should be verifying it with the encrypted version, do that and you will be alright.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.