Alex Rivera | Logout

Storing encrypted passwords

Asked 2009-10-22T13:10:09.560
20

My coworker and I are having a fist-fight civilized discussion over password security. Please help us resolve our differences.

One of us takes the viewpoint that:

  • Storing passwords encrypted using a public key in addition to a one-way hashed version is OK and might be useful for integration with other authentication systems in the future in case of a merger or acquisition.
  • Only the CEO/CTO would have access to the private key, and it would only be used when necessary. Regular login validation would still occur via the hashed password.
  • I have/he has done this before in previous companies and there are many sites out there that do this and have survived security audits from Fortune 500 companies before.
  • This is a common, and accepted practice, even for financial institutions, thus there is no need to explicitly state this in the privacy policy.
  • Sites like Mint.com do this.

The other one of us takes the following viewpoint:

  • Storing passwords, even in encrypted form, is an unnecessary security risk and it's better to avoid exposure to this risk in the first place.
  • If the private key falls into the wrong hands, users that use the same password across multiple sites would risk having all of their logins compromised.
  • This is a breach of trust of our users, and if this practice is implemented, they should be explicitly informed of this.
  • This is not an industry-wide practice and no big name sites (Google, Yahoo, Amazon, etc.) implement this. Mint.com is a special case because they need to authenticate with other sites on your behalf. Additionally, they only store the passwords to your financial institutions, not your password to Mint.com itself.
  • This is a red flag in audits.

Thoughts? Comments? Have you worked at an organization that implemented this practice?

Edit
Report

3 Answers

42

The first practice of storing recoverable version of passwords is plain wrong. Regardless of the fact that big sites do this. It is wrong. They are wrong.

I automatically distrust any site that stores my password unhashed. Who knows what would happen if the employees of that big company decide to have fun? There was a case some guy from Yahoo stole and sold user emails. What if someone steals/sells the whole database with my emails and passwords?

There is no need whatsoever for you to know my original password to perform authentication. Even if you decide later to split the system, add a new one or integrate with a third party, you still will be fine with just a hash of the password.

answered 2009-10-22T13:14:45.060
16

Hash Passwords

Storing passwords in a reversible form is unnecessary and risky.

In my opinion, a security breach seems much more likely than the need to merge password tables. Furthermore, the cost of a security breach seems far higher than the cost of implementing a migration strategy. I believe it would be much safer to hash passwords irreversibly.

Migration Strategy

In case of a company merger, the original algorithm used to hash passwords can be noted in a combined password table, and different routines called to verify the passwords of different users, determined by this identifier. If desired, the stored hash (and its identifier) can be updated at this time too, since the user's clear-text password will be available during the login operation. This would allow a gradual migration to a single hash algorithm. Note that passwords should expire after some time anyway, so this would be upper bound on the time migration would require.

Threats

There are a couple of avenues to attack encrypted passwords:

The decryption key custodian could be corrupt. They could decrypt the passwords and steal them. A custodian might do this on his own, or he could be bribed or blackmailed by someone else. An executive without special training is especially susceptible to social engineering too.

An attack can also be made on the public key used for encryption. By substituting the real public key with one of their own, any of the application administrators would be able to collect passwords. And if only the CEO has the real decryption key, this is unlikely to be discovered for a long time.

Mitigation

Supposing this battle is lost, and the passwords are encrypted, rather than hashed, I'd fight on for a couple of concessions:

  1. At the very least, the decryption key should require the cooperation of multiple people for recover. A key sharing technique like Shamir's secret sharing algori
answered 2009-10-22T15:16:19.977
5

I have had to move user accounts between sites (as might happen in a merger or acquisition) when the passwords were one-way hashed and it was not a problem. So I do not understand this argument.

Even if the two applications used different hashing algorithms, there will be a simple way to handle the situation.

answered 2009-10-22T13:16:46.927

Your Answer