Encrypting passwords - 2 way or 1 way?

This is a discussion on "Encrypting passwords - 2 way or 1 way?" within the PHP Forum section. This forum, and the thread "Encrypting passwords - 2 way or 1 way? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 27th, 2008, 13:19
Junior Member
Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Encrypting passwords - 2 way or 1 way?

I think the answer to this will be both methods are as good as each other, but I'd like to check what others' opinions are anyway.

When dealing with user logins you can either store the password using PHP to encrypt the password e.g. using sha1(), or you can encrypt with mysql e.g. using AES_ENCRYPT (for mysqli) and a key which can be stored outside the site for security. Encrypting with mysql isn't as secure since the password can be decrypted, but this is also a benefit in that if someone forgets their password you can send them their password instead of having to reset it.

So, which method do you use, and do you have any preferences for one method over the other?
Reply With Quote

  #2 (permalink)  
Old Mar 27th, 2008, 14:25
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Encrypting passwords - 2 way or 1 way?

I just use md5(), it's great for encryption. If you're worried about security then just add a little SALT and the odds of the hash being brute forced is very low.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Mar 27th, 2008, 16:05
Weird1993's Avatar
Moderator
Join Date: Feb 2007
Location: United States
Age: 15
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Weird1993 Send a message via Skype™ to Weird1993
Re: Encrypting passwords - 2 way or 1 way?

Like Alex, I also use md5().
__________________
Daniel Thompson
danielwthompson.com
Reply With Quote
  #4 (permalink)  
Old Mar 30th, 2008, 16:09
Junior Member
Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Encrypting passwords - 2 way or 1 way?

Thanks for your replies, after reading them I had a look into sha1 and md5, it seems that md5 is more secure. I think maybe I will use md5 with a salt (probably unix time stamp generated when user registers and stored in the database) for storing passwords and 2 way encryption for the email address.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
passwords simon2233 PHP Forum 5 Apr 1st, 2007 23:19
md5 passwords scottw PHP Forum 2 Jan 14th, 2007 15:07
Passwords on pages phil19 Hosting & Domains 9 Mar 25th, 2006 08:32
Encrypting Code DronDron Web Page Design 1 Jul 15th, 2005 23:30
Encrypting urls in .net Sabarish_s ASP.NET Forum 5 Mar 31st, 2004 06:40


All times are GMT. The time now is 05:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43