Solved

Add encrypted passwords to database

Posted on 2012-04-04
4
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses four methods for overlaying images in a container on a web page
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

734 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