MySQL can do the whole job. The client doesn't need to do the encryption. Just use the password() function in your select and updates. --Aaron
Java examples: String insertStatementStr = "INSERT into users VALUES (?,?,?,?,PASSWORD(?),?,?, ?, ?)"; ResultSet myResultSet = stmt.executeQuery("SELECT * FROM users WHERE user_name = '"+u_name+"' AND password = password('"+password+"') AND STATUS = 'CURRENT'"); -----Original Message----- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 10:58 AM To: 'Peter Gibbons-BU'; [EMAIL PROTECTED] Subject: RE: creating a password field.. Peter, I have no idea what your front end is, and this is what will do the actual encryption, all mysql does is holds the data. So whatever your front end programming language is, it will have to do the encryption. Below is the link for php encryption http://www.php.net/manual/en/function.md5.php -----Original Message----- From: Peter Gibbons-BU [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 11:32 AM To: '[EMAIL PROTECTED]' Subject: creating a password field.. Hi, i'd like to create a password field like in the user table in the mysql database. The data would need to be encrypted. Can mysql do the whole job. I would need it ideally to automatically decrypt it for me when I do a select.. any suggestions - code example would be really helpful.. peter This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system, do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php