Solved

Add encrypted passwords to database

Posted on 2012-04-04
4
223 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 30

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 30

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now