Solved

Add encrypted passwords to database

Posted on 2012-04-04
4
227 Views
Last Modified: 2012-04-04
When creating a user sign up form how do I send the password value to the databse (mySQL) encrypted?

Is this set up in the database structure or on the php page sending the info from the form?
0
Comment
Question by:BrighteyesDesign
  • 2
  • 2
4 Comments
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 333 total points
ID: 37805727
0
 
LVL 31

Assisted Solution

by:Marco Gasi
Marco Gasi earned 167 total points
ID: 37805781
A very basic function looks like this one:

?>
<?php
$salt = "SOMEWORD";
$password_hash = md5($salt . md5($_POST['password'] . $salt));
?>

Cheers
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 333 total points
ID: 37805892
example of mysql encryption:
INSERT into user (first_name, address) VALUES (AES_ENCRYPT('Obama', 'usa2010'),AES_ENCRYPT('Obama', 'usa2010'))

Open in new window



example of php encryption:
<?php
$pwd= "123456";
echo md5($pwd);
?>

Open in new window

0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 37805894
You can find something more sophisticated but easy to implement here: http://www.richardlord.net/blog/php-password-security
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question