Hiding the password in a MySQL table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Wilio
Forum Newbie
Posts: 4
Joined: Sun Jan 18, 2009 10:12 am

Hiding the password in a MySQL table

Post by Wilio »

Now here is my problem.

I have builded a registering system that works as I want, only I don't want the password to show up as it is written in the password column. Why? It simply breaks the privacy of a user who wants to register.

I heard about base64_encode() and eval(), but I'm not sure if they come handy for what I want.

What's the best solution?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Hiding the password in a MySQL table

Post by jaoudestudios »

Are you saying you dont want the password to be stored as plain text in the database?
Wilio
Forum Newbie
Posts: 4
Joined: Sun Jan 18, 2009 10:12 am

Re: Hiding the password in a MySQL table

Post by Wilio »

In summary, yes.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Hiding the password in a MySQL table

Post by Mark Baker »

Well the normal method is to hash it using a function like md5 or sha1.
base64 is easily reversible, and therefore inadequate for passwords
Wilio
Forum Newbie
Posts: 4
Joined: Sun Jan 18, 2009 10:12 am

Re: Hiding the password in a MySQL table

Post by Wilio »

Mark Baker wrote:Well the normal method is to hash it using a function like md5 or sha1.
base64 is easily reversible, and therefore inadequate for passwords
Thanks, I didn't know about sha1. It's also quite easy to use.
Post Reply