Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I stumbled across this question earlier and it got me thinking. Everyone's encountered systems that require you change your password every x days and not reuse any of your last y passwords. This kind of thing has always left me vaguely unsettled -- how are the old passwords stored? Shouldn't old passwords be deleted entirely? Isn't it insecure not to?

Is there something that I'm missing or forgetting to think about here?

share|improve this question
up vote 7 down vote accepted

Passwords can be stored using hashes that don't store the password, but a number that represents the password. The hash typically cannot be turned back into the password so there is very little chance that a security compromise will net anyone the original password. For example, a simple hash might assign A=1 B=2 C=3, etc... and then sum up all of the values for the corresponding letters in the password. If you've used that password before, the hash will always match, but there's no way to get the original password by knowing the hash.

Thus, it is certainly possible to know whether a password was used previously without actually knowing what the password was. Whether or not any particular web site uses this method, however... you can't be sure.

EDIT - note that the example above is exceedingly simple, only meant to convey the concept of a hash. This is NOT how you should compute a hash in the real world, not least of which because of the prevalence of passwords that would yield the same hash.

EDIT 2 - a better link might be, which describes hashes in the context of cryptography. The previous link to hashes talks about them more in the context of grouping data, which they can also be used for.

share|improve this answer
But couldn't the original password be discovered using rainbow tables? Or am I misunderstanding how rainbow tables work? – thepocketwade Feb 9 '10 at 18:22
Not if the hash is computed using a decent-sized salt value... See the section 'Defenses...' at…. I mean theoretically they still could, but it would require MASSIVE amounts of processing and memory capacity. – Michael Bray Feb 9 '10 at 18:30
Theoretically, rainbowtables can reverse password hashes. But theoretically, massively parallel computers could brute-force them too. (Rainbow tables are just pre-computed password-to-hash calculations.) There's a difference between "theoretically" and the real world. – David Mackintosh Feb 9 '10 at 18:31
Most hashes include a salt (see which makes it harder for rainbow tables to work. Also read here:… - RTs ain't infallible. A password can also be brute-forced for sure but that's where a good account lockout policy would help. – Le Comte du Merde-fou Feb 9 '10 at 18:33
@thepocketwade, the old password possibly could be discovered with rainbow tables depending on the salt/hash method, but that isn't the point. The old passwords are protected the same way the current passwords are protected. If you are going to attack a system, why would you spend time cracking expired/old passwords, since you would have access the to the current ones? – Zoredache Feb 9 '10 at 18:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.