Jump to content

Salted passwords


Darkranger85

Recommended Posts

Hey all,

 

I posted a few months ago trying out my first salted password and I utterly failed lol.

 

This is a small snippet from my current attempt.

 

    $salt = md5(uniqid(rand()));
    $Pass_S = md5($pass.$salt);

 

This is only the password and salt generation part. I'm sure the salt generation is probably too simple so please feel free to give your thoughts on that part.

 

Also the salt is stored on the database to be pulled up later for login uses.

 

Thanks all!

Link to comment
Share on other sites

Read the article in my signature. The language used is designed for intermediate programmers ready to get into safe one-way storage of sensitive information.

 

If you don't understand if after reading through, then you should use the class they provide and work on the basics a little bit more before trying something this complex.

 

Hope that helps.

Link to comment
Share on other sites

Ok, I've read it over and I must say that my eyes have completely glazed over.

 

I understood some of the basic concepts but thats about it. I looked at the download of the program discussed in it and I don't really understand that either. I'm still pretty new and so many many of the commands and such in there I simply don't understand yet.

 

I'll keep trying though but any additional help is always appriciated! :)

 

Now, I had another question that I thought up as I was reading that article.

 

What if I made my log in system in a way that when a user logged in it generated a new SALT and replaced the old one? Would that improve security or make it worse?

 

Thanks!

Link to comment
Share on other sites

Won't make a difference. The salt is only there to make brute-forcing harder if an attacker manages to get the password's hash. The reason salts are unique in the first place is to prevent an attacker from figuring out a single salt and quickly brute-forcing other hashes.

 

Changing a salt once a hash is compromised won't add any extra security.

 

It's a very complex topic, but the users are trusting you with a secret password. You have an 'obligation' to protect that as best you can.

Link to comment
Share on other sites

Again, I apologize for being a newb lol.

 

I don't understand why storing your passwords separately doesn't improve security.

 

If a hacker gets into your database but the passwords are stored in another database doesn't that give you a small victory? (Not saying I'm right, I'm just trying to understand lol)

Link to comment
Share on other sites

How will 'hiding' the information help you at all? Dumping the contents of two databases isn't more difficult than one.

 

To try and simplify this, you're trying to hide data within a system specifically designed to find data quickly and easily.

Link to comment
Share on other sites

I see.

 

I guess what it comes down too is I don't really know much about hacking in general so I wouldn't know what is more or less secure lol.

 

On the original topic, I also did some searching on Google about PhPass and I found articles on "bcrypt" linked to it. Is that related or is it something else entirely?

Link to comment
Share on other sites

bcrypt is used by phpass.

 

This has been overly simplified, to help you understand. It's based on Blowfish, a well known block cipher. Blowfish was chosen because it's slow. bcrypt was designed to 'stretch' Blowfish over several iterations to be as slow as needed. This is done to slow down brute-forcing. If it takes 50ms instead of 0.5ms to calculate a hash, a brute-force will take up to 100x longer to perform. Since there have been no mathematical 'weaknesses' found in bcrypt thus far, there's no shortcut to speed brute-forcing up.

 

If bcrypt is available on the system, phpass uses it. If not, there are several similarly strong and slow algorithms that it will implement.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.