Forum Moderators: coopster

Message Too Old, No Replies

Use hashed password in mysql connect()?

         

firefly2442

5:01 pm on Mar 4, 2008 (gmt 0)

10+ Year Member



Hello,

[us3.php.net...]

When using mysql_connect(), it works great for connecting to my database but I hate having to store the password in cleartext. I read in a config.php file which has the password but I would really like to use a hash password instead. For example, instead of this:

$link = mysql_connect('localhost', 'user', 'cleartext_password');

I want this:

$link = mysql_connect('localhost', 'user', '5d41402abc4b2a76b9719d911017c592');

Is this possible? Thanks! :)

Vis3R

7:02 pm on Mar 4, 2008 (gmt 0)

10+ Year Member



I don't think so, since one-way hashes can't be decoded. Unless you set the database's password to the hash iteself, then the hash becomes your password.

[edited by: Vis3R at 7:03 pm (utc) on Mar. 4, 2008]