Ooops! Correction:

Incorrect -- connect("DBI:mysql:HOST", "DB", 'DB_PASSWORD');
Should be -- connect( "dbi:mysql:dbname", "username", 'DBpassword');

Ron
=======================================
"Ron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
This is my two-bits on your question.  I hope this helps.

Ex: ENCODE('str', 'password') str is the string of the chosen password and
password is the mySQL encryption password for encoding/decoding the password
string.

ENCODES returns a binary string and may be decoded with DECODE().  You
should use BLOB for the column since this result is binary.

# Connect to the database through DBI (insert data to temporary table)
$dbh = DBI->connect("DBI:mysql:HOST", "DB", 'DB_PASSWORD');
$cursor_insert = $dbh->prepare("insert into table_name ('$username',
ENCODE(str, password))");
$cursor_insert->execute;



# Connect to the database through DBI
$dbh = DBI->connect("DBI:mysql:HOST", "DB", 'DB_PASSWORD');
$cursor_select = $dbh->prepare("select username, DECODE(str, password)");
$cursor_select->execute;

Ron
=================================================
"Rory Oconnor" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'm writing a small perl script that will help web users manage an
"account" (i.e. their record in a mysql table).  I want to store their
password in a field, but I don't want to store it in regular text.  I'm
not sure if this is a perl or MySQL function, but I think there is some
method of "encrypting" the password in the field.

Has anyone done that before?  Any help appreciated!

Thanks,

Rory






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to