News for hackers. Stuff that matters.
Re:Auditor's response to "Our security auditor is an idiot" ... by reitzensteinm on Friday July 29, 2011 @04:37AM (#2820786)
While that is an absolutely ridiculous requirement, couldn't it be satisfied securely by creating on the order of 1-10k modifications of each password when created, and hashing those? That would be enough to add numbers to the end, switch case, reverse, randomly change letters etc.

It's a lot of trouble to go through just because of the ignorance of a client, but it would be enough to check that magic box on the requirements list and be done with it, rather than having to go to all of the trouble of trying to educate the client and risk them going elsewhere.

Re:Auditor's response to "Our security auditor is an idiot" ... by jmah on Friday July 29, 2011 @05:46AM (#2820976)
It's 3am and I've been drinking, but this seems feasible: When the user changes their password, encrypt the old password with a key derived from the new one (you have both in plaintext at this point, when entering old/new passwords). Then hash the new one as usual.

Then when the user goes to change their password again, you have the plaintext of the current one, which unlocks the previous password, and so on back in the chain. You can then compare the new password with previous passwords for similarity.

Re:Auditor's response to "Our security auditor is an idiot" ... by swixmix on Friday July 29, 2011 @05:59AM (#2821009)
I like this idea, but I don't think it can be enforced. If I "forget" my password, then all the history is lost with it.
Re:Auditor's response to "Our security auditor is an idiot" ... by stcredzero on Friday July 29, 2011 @08:23AM (#2821378)
If the old password is "forgotten" and can't be retrieved by the user who made it up, then it doesn't seem like that big a risk.
Re:Auditor's response to "Our security auditor is an idiot" ... by jbri on Friday July 29, 2011 @09:47AM (#2821686)
The issue is that once your users figure out the system, they'll always "forget" what their password was once it's getting around to expiring.
Re:Auditor's response to "Our security auditor is an idiot" ... by erikano on Friday July 29, 2011 @11:44AM (#2822390)
The method I am about to mention here is based on that which was outlined earlier by somebody else [1]. As I will mention further down, the method I suggest here will give the administrator and the CEO the opportunity to conspire and retrieve users passwords without the affected users knowledge, but I will here assume that such could not happend and that if they really wanted to do so, they could find other means anyway (keylogging, etc.)

First time: On his client, the user is asked to enter a password which is checked to comply with password rules. This password is salted and hashed before it is stored on a central machine.

n-th time: On his client, the user first enters password "n - 1" which is then salted and hashed and sent to the central machine for comparison. If hashes match, you may enter the new password "n" which is checked to comply with password rules.

Password "n - 1" is then encryted with password "n" and stored on the central machine. Password "n" is stored on the central machine in two forms:

1) Salted and hashed.

2) Encrypted with a public key.

Password "n" is encrypted with a public key and stored on a he central machine. Also, when this machine stores the new public key encrypted password, it deletes its own records of any previous public key encrypted password for the user in question.

Through recursion, all old passwords ("n - 2" ... "1") are decrypted and the new password is checked so that it does not match any previous password and that it is not a simple permutation of any of those.

If the user forgets his password, the administrator physically logs into a machine which is very tightly secured. This machine does not allow inbound connections of any kind over the network and can only make outbound connections to the central storage machine. Furthermore, the machine does not allow the usage of any removable media (CD, DVD, USB stick, etc.). The drives of the machine in strongly encrypted, as is the private key which is stored on this machine. In order to decrypt the disc of the machine, two passwords are needed. One of the passwords is held by the administrator, the other by the CEO of the company. The same goes for the private key which also has two passwords, both of which are needed to decrypt it. Thus, two people must be involved in order to decrypt the password for a user. Once the administrator and the CEO has logged into the machine, they connect to the central storage and retrieve the encrypted key for the user and then they open their shared private key and decrypt the password. After the user has been given his old password, he must create a new password following the procedure described above. That way, the administator and the CEO does not know the users new password (unless they conspire to do so, but that would be breach of trust).

http://news.ycombinator.com/item?id=2820976

Re:Auditor's response to "Our security auditor is an idiot" ... by semanticist on Friday July 29, 2011 @01:25PM (#2822847)
Proposing that any 'forgotten password' reset requires the physical presence of the CEO and a sysadmin at a dedicated machine is a really good way to ensure that within six months all passwords are either stored in plain text or written down on a post-it note.
Re:Auditor's response to "Our security auditor is an idiot" ... by diolpah on Friday July 29, 2011 @09:42AM (#2821660)
"It's 3am and I've been drinking, but this seems feasible"

I have come up with some astoundingly dumb ideas that were preceded by exactly the above thought.

However, there was some sheer brilliance, as well.

Re:Auditor's response to "Our security auditor is an idiot" ... by nikcub on Friday July 29, 2011 @07:32AM (#2821241)
If you are storing passwords properly with bcrypt, then the 1-10k permutations will take far too long to calculate, especially considering that you need to give the user feedback on their new password choice being ok or not within ~100ms

(Edit: so the match might be quick, but pre-comp of the hashes and storing them is not. how the hell would you store 1-10k hashes associated with a user anyway? :) )

Re:Auditor's response to "Our security auditor is an idiot" ... by reitzensteinm on Friday July 29, 2011 @07:52AM (#2821286)
What kind of bcrypt run times should be targeted? In my back of the envelope calculations I used 100ms per core, which would make 80/s on an 8 core machine, or 12.5s for 1k hashes and 2 minutes for 10k. Which doesn't seem unreasonable.

You can give the user feedback on their new password choice after just one hash. The permutations would be stored from their last password set, so it would just be a simple lookup to determine whether a given new password is similar to an old one.

I'm in no way recommending this - it was just an amateur guess at a method to fulfill the requirements without exposing a massive security vulnerability.

Re:Auditor's response to "Our security auditor is an idiot" ... by nikcub on Friday July 29, 2011 @08:18AM (#2821361)
I aimed for 10-20/sec in dev on my macbook, but I have been doing everything on appengine recently, and haven't been getting consistant results on the live environment. It varies a lot in profiling - and I am thinking of slowing it down further since I have long-lived sessions on by default (set to a year) so password checks are rare

I made the session tokens crazy long though, and have one for the user session and another for auth, and a sanity check within the auth token that will add any IP that attempts to forge the session token added to the ddos blacklist after 3 attempts. The auth token generation is slow as well - which is something that is often overlooked in webapps. I got a bit carried away in implementing all of it - but it was fun

Re:Auditor's response to "Our security auditor is an idiot" ... by robtoo on Friday July 29, 2011 @07:48AM (#2821279)
When setting a password, you compare the new password to the old hashes, which were calculated the last time the password was changed.

So user feedback should be speedy enough.

Only once the password is deemed acceptable does the system need to pre-calculate the hashes for the next time the password is changed.

Of course, pre-calculating 10,000 bcrypt hashes might be too computationally expensive anyway, but the user wouldn't see a delay.

Re:Auditor's response to "Our security auditor is an idiot" ... by gus_massa on Friday July 29, 2011 @09:56AM (#2821734)
If you use a different salt for each modification of the old password, you must compute the all the hashes of the new password.

Another problem is that to prevent the use of the very old passwords, you should keep the hashes of the modifications. To make the comparations fast, you have to use the same hash.

Now you have a list of #password-changes * #passwords-modifications, and if an intruder get them, it is possible to make a mini-rainbow attack.

Re:Auditor's response to "Our security auditor is an idiot" ... by nikcub on Friday July 29, 2011 @08:10AM (#2821337)
you are right - I have it the wrong way around. still you need to do the calculations and find somewhere to store all of those hashes

but I can't think of any other way of making 'similar to' work

Re:Auditor's response to "Our security auditor is an idiot" ... by swixmix on Friday July 29, 2011 @04:50AM (#2820821)
A better method would be to save previous password hashes when a password is changed, then check hashes of permutations of the new password against the previous ones.
Re:Auditor's response to "Our security auditor is an idiot" ... by reitzensteinm on Friday July 29, 2011 @07:58AM (#2821302)
It's a storage versus computation time trade off, and with something like bcrypt doing the hashing, hashing 1-10k passwords will be too slow to provide real time feedback as a user is changing their password. On the other hand, storing even 10k hashes per employee per month of employment just isn't that much storage.
Re:Auditor's response to "Our security auditor is an idiot" ... by palish on Friday July 29, 2011 @05:05AM (#2820859)
That would verify they aren't bouncing from password A to password B and back to A again... but that's all.
Re:Auditor's response to "Our security auditor is an idiot" ... by swixmix on Friday July 29, 2011 @05:14AM (#2820886)
That would only be true if it didn't keep history. Let's assume my previous two passwords are "love123" and "hate098". If I try to use a new password "love124", then the permutation checker (which, for the moment, knows the new password in plaintext) should check the hash of "love123" and reject it.
Re:Auditor's response to "Our security auditor is an idiot" ... by palish on Friday July 29, 2011 @05:22AM (#2820903)
Oh. If you write a permutation checker that happens to output one of your old passwords, then yeah, that'd work. I wonder if that's feasible. It's an interesting idea. Computing hashes is relatively cheap, so I wonder if, say, 1,000 "permutation checks" would be enough.

(Although if you're using bcrypt to store passwords, which you should be, then apparently it's not so cheap.)

But.. 26 letters in the alphabet + ten digits = 36... and 36^n grows really, really fast. So maybe you'd need way more than 1k permutation checks.

Re:Auditor's response to "Our security auditor is an idiot" ... by zizee on Friday July 29, 2011 @05:23AM (#2820907)
That was my first thought too, but it does not satisfy the "similar" part of the requirement.
Re:Auditor's response to "Our security auditor is an idiot" ... by saurik on Friday July 29, 2011 @05:31AM (#2820932)
It does, because if the new password is similar to the old one, you can either modify the old one to get the new one or modify the new one to get the old one.
Re:Auditor's response to "Our security auditor is an idiot" ... by zizee on Monday August 08, 2011 @02:11AM (#2859012)
But if you have hashed the password correctly (i.e. a one way hash) you shouldn't know what the previous passwords are. This means that you would only be able to test if the password was the same, not similar.