Results 1 to 9 of 9

Thread: how do you store passwords?

  1. #1
    Registered LuckyShima's Avatar
    Join Date
    Jan 2004
    Posts
    207

    how do you store passwords?

    If anyone has written a password protected application, how do you store the passwords?

    I use sha1() in php, which hashes the password. However, I am using this on an information site where the user can come back and login and ask for more information, and I am thinking that storing the password in a hash like this is a bit of overkill. The main reason for me thinking this is that the password cannot be sent to the user, the user can only be sent a new password and then must change the password back to their old password if they want.

    I am just thinking that maybe I don't really need to do this on just a free information service site, it seems a bit of overkill.

    Do any of you just store the password as a text string? What else do you use?

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    One reason why you should always hash the password is because people often use the same password at different places.

    So if someone uses the same password at your site and at paypal, and your site is hacked, then the hacker knows the person's paypal password.

    Sure... the user shouldn't have used the same password at two places, but you also could have prevented it by using a hash.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Senior Member chromate's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    2,348
    Same as Chris, I always store a hash of the password. It's not really a big deal to get sent a new password instead of the existing one. The small inconvenience to your users may save their arse one day (and yours)

  4. #4
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    Yep, I use a hash too - I used md5 though - having looked, sha1 seems to be stronger?

  5. #5
    Registered The New Guy's Avatar
    Join Date
    May 2004
    Posts
    283
    sha1 is stronger but slightly more cpu intensive. Alot of people switched over once collisions were found in md5. Still, md5 is still secure enough.

  6. #6
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    Hmm, how difficult would it be to change? Presumably you could either flag the existing ones that are using md5, or make everyone have a new password?

    I presumed collisions would be possible, but fairly unlikely I would think?

  7. #7
    Working. Masetek's Avatar
    Join Date
    Aug 2005
    Location
    Aust
    Posts
    543
    Quote Originally Posted by Chris
    One reason why you should always hash the password is because people often use the same password at different places.
    Exactly.

    I never store real passwords, md5 them all. If someone wants a new password I always just send them a random one.

  8. #8
    Registered
    Join Date
    Jul 2005
    Posts
    33
    My point: u must hash password AND email
    If you respect your visitors u must protect emails too.

    In "Forget password" case you can send time (and ip) -limited activation code to user's email so user can login with it during 30 mins from his ip and choose new password. User must enter registration email and u can hash it and compare it to hash from DB, hope its clear.

  9. #9
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You can't hash email. IF you did you'd have no way of knowing what a user's email is... so it'd be pointless to even store it.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

Similar Threads

  1. GMP Instant Amazon store (.net) Pre Release Available
    By AWS-Allen in forum The Marketplace
    Replies: 1
    Last Post: 10-20-2014, 04:43 PM
  2. Replies: 3
    Last Post: 11-15-2004, 05:47 PM
  3. Nice Recipes.com Store (AWS)
    By intelliot in forum User Owned Websites
    Replies: 4
    Last Post: 08-15-2004, 02:00 AM
  4. Amazon Store Builder Script
    By simonmc in forum Advertising & Affiliate Programs
    Replies: 4
    Last Post: 03-31-2004, 11:55 PM
  5. AWS: Store pricing info up to 7 days
    By GCT13 in forum Advertising & Affiliate Programs
    Replies: 2
    Last Post: 02-06-2004, 06:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •