You are here:

MySQL/Database encryption

Advertisement


Question
Hi

Sorry I had to start a new question thread as there was no option to ask a follow up any more that had gone.

Yes it would be good to encrypt all the members details

Thanks

Answer
Dear Sir, That's no problem


Firstly passwords should always use md5 encryption when adding them to the database


I have given an insert query which has aes encryption for the members details and md5 for the password.

$key ='12345rty';
$value1 = $_POST['value1'];
$password = $_POST['password'];
      
$qry = "INSERT INTO mytable (value1, password)VALUES(AES_ENCRYPT('$value1', '$key'), '".md5($password)."')";
$result = mysql_query($qry);


this will insert the details in the database with an encrypted value. Google AES encrypt and decrypt and have a play. the best way to learn is to try.  

MySQL

All Answers


Answers by Expert:


Ask Experts

Volunteer


stuart gregory

Expertise

PHP html, xhtml, css coding and MySQL

Experience

My experiance is all first had as I am web developer and I have, and do build many websites all using php and mysql. This ranges from building a simple search engine to secure php login scripts. Some websites like http://www.web-application-development.info are complete database driven websites.

Organizations
I have a large number of websites which I host and maintain, such as. http://www.webreger.com http://www.universalscience.co.uk http://www.modellingelectronics.co.uk

Education/Credentials
Web application development. (Open University) BSC Honers Computing and development (Open University)

©2016 About.com. All rights reserved.