Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Add encrypted passwords to database

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
BrighteyesDesign
Asked:
BrighteyesDesign
  • 2
  • 2
3 Solutions
 
Meir RivkinFull stack Software EngineerCommented:
0
 
Marco GasiFreelancerCommented:
A very basic function looks like this one:

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

Cheers
0
 
Meir RivkinFull stack Software EngineerCommented:
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
 
Marco GasiFreelancerCommented:
You can find something more sophisticated but easy to implement here: http://www.richardlord.net/blog/php-password-security
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now