Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Securely storing user passwords

Posted on 2009-05-19
3
Medium Priority
?
226 Views
Last Modified: 2012-05-07
I'm considering how to secure passwords.
Please correct me if anything appears wrong, or add things if I've missed something.

1) Store the salt in a different place(database) than the password hashes. If password hashes are stolen, salt isn't necessarily.
2) Use sha1() instead of md5() for hashes. (Storing in mysql) because sha is more resource-consuming to break than md5s.
3) What considerations should be made when choosing a salt?
4) Would it in any way make sense to trunc the sha's to 32 chars, making them look like a md5 hash?
0
Comment
Question by:letharion
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Author Comment

by:letharion
ID: 24419703
Also, if one stores sha(username + password + salt), two users can have the same password, and still not the same hash. A good idea?
0
 
LVL 7

Accepted Solution

by:
askb earned 2000 total points
ID: 24447695
1. Storing salts separatly in a different database does not increase the strength of the password / hash. Only the output hash/digest needs to be stored in the db for verifying the user. Note: that another added security - if you are using something like md5sum - would be that the added advantage of have the digest/hash in the database would also imply that the attacker would have to reverse the hash string to a string which equates to "pwd + salt". This would be same as finding an invariable length input string given and variable length output 128 bit hash.

2. yes - sha1 is better, and if you are considering some PKI stuff you could also try HMAC

3. Salt - can be master password/pin or any random bytes. This is what my scripts do:
md5sum(User ID + Pass + Master Pass (SALT)) = hash
NOTE: Salt can be a secondary pass or a pin number
Salts have many uses - http://en.wikipedia.org/wiki/Salt_(cryptography)

4. Not advisable - as you would be increasing the possibilies for a collision.   Assume that
1. sha1(a+B+C) = 4e1243bd22c66e76c2ba9eddc1f91394e57f9f83
2. sha1(ZZZ+B+C) = 4e1243bd22c66e76c2ba9eddc1f91394e57f9f82

Now if 1 and 2 gets truncated would be = 4e1243bd22c66e76c2ba9eddc1f91, see that last bit/char out the output digest could be diffirent.
0
 
LVL 6

Author Comment

by:letharion
ID: 24466306
That pretty much answers my question :)

Thank you very much.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question