Thanks for getting back to me. Looking at the function it says it is non
reversible. If so wouldn't that mean I was unable to read the password
once it was store? I might not have been clear enough in my description,
I need to be able to get the password at a later date if needed.


Charlie 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of intekhab rizvi
Sent: 01 February 2008 13:33
To: [email protected]
Subject: Re: [php_mysql] encryption of fields

Their is the inbuild function in mysql called password() which allow you
to save password in encripted format. you dont need to write an extra
script for it

Pls check below querys

Insert Query
$sql = "INSERT INTO $db_table (`uid`, `pass`, `name`, `add`, `cont_no`)
VALUES ('$_POST[uid]', password('$_POST[pass]'), '$_POST[name]',
'$_POST[address]', '$_POST[number]')";

Where $_Post[pass] is the name of password textfield

Select Query

$sql = SELECT * FROM $db_table WHERE uid = '$_POST[uid]' AND pass =
password('$_POST[pass]');

Thx
I.A.Rizvi

Charlie Markwick <[EMAIL PROTECTED]> wrote:    

I want to create a MySQL table that stores usernames in plaintext and
passwords in a good 
secure encrypted form. I want to be able inspect and  or change the
password as necessary, 
I am anticipating that when I do  this, or add a new entry I would enter
a passphrase. 
I don't want to  store the password in plain text. What is the best way
of approaching this?
 
 Charlie

Reply via email to