How to apply password and encrypt functions in MySQL on PHP?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
crypdude
Forum Newbie
Posts: 18
Joined: Sun May 23, 2004 10:26 pm

How to apply password and encrypt functions in MySQL on PHP?

Post by crypdude »

Can anyone do my favour? I'm very stuck here..!!! pls.. Miouw......!! Miaauw.....!(cat voice) :twisted:
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

So... whats the question?
User avatar
crypdude
Forum Newbie
Posts: 18
Joined: Sun May 23, 2004 10:26 pm

Post by crypdude »

The question in on the topic above.. hehe! Miauuuuwww...!!
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

that doesnt really help .... and Miauwwww at people isnt really going to motivate them to help .... what are you trying to do, post an example, are you just trying to store a password in a mysql table and try and match it afterwards etc. ???
User avatar
crypdude
Forum Newbie
Posts: 18
Joined: Sun May 23, 2004 10:26 pm

Post by crypdude »

Sorry, but what i'm trying to say is, how to make password can't be retrieve by other users in mySQL database?.. How could i do???
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Several ways

Post by Lord Sauron »

There are several ways to do so.

Encrypt the passwords in your database. Or you could even right your own encrypting system if you know something of math. Or even both.

And even if you did so, you must take precaution for e.g. sql injection.

So please, be a little more specific with your question.
User avatar
crypdude
Forum Newbie
Posts: 18
Joined: Sun May 23, 2004 10:26 pm

Post by crypdude »

Ok, recently..after looked at mySQL database, i found some function for it.. Before, I just key in the data without thinking about it security or something more secure. Then after press insert button or toolbar, then insert the data manually, (u can try it by phpmyadmin or etc) then there are about 4 columns. One of them is function column. Then after i clicked dropdown itself, i found so many stuffs include password and encrypt. I'm very interested to know it. But how could i apply it in my programming...?
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Use MD5.

$password = md5($string);

And to ask about people retrieving your password from the database. Well if your site is secured from sql injection, etc.. you wouldn't need to worry much.
Post Reply