News for hackers. Stuff that matters.
Re:Project Euler Returns by e12e on Friday August 15, 2014 @03:51PM (#8183819)
Hello? Lets say you have 5 billion accounts, in salted sha1. According to openssl speed sha1, you'd take less than 38 minutes on my ancient desktop to look up an email, on average half that. If the shoe fits, send the email, if not don't?

Sure having another field to match on (eg: username) for locating the correct salt would be good -- but it's certainly not infeasible to do a brute force search (probably want to queue up password request requests, though). Now, if you went with bcrypt or scrypt -- things would, by design, break down a bit. I still think you'd be able to send a reset mail within 24 hours for most reasonable configurations and number of users...

Re:Project Euler Returns by ntpl on Friday August 15, 2014 @04:08PM (#8183903)
Taking unnecessarily long to handle a lookup request might leave server very vulnerable to DDoS attacks leveraging this "account recovery" option, I think.

Even worse, an invalid email would take the longest possible time, every time.

And since this is only an email address we are talking about, a global salt + more stretching (like runamok mentioned above) could be secure enough while still providing faster lookups.

Re:Project Euler Returns by Arnor on Friday August 15, 2014 @04:47PM (#8184102)
Of course, you could protect from the DDoS by maintaining a secondary application server which connects to a slave database. Then the requests for account recovery wouldn't impact the rest of the system. :)
Re:Project Euler Returns by e12e on Friday August 15, 2014 @05:19PM (#8184281)
That's why I suggested a queue, so you'd only ever need to have a maximum of <total number of accounts> pending. I missed the part about using this for login as well as recovery though (but also, note that numbers are for 5 billion accounts, an scales linearly with accounts -- so divide by 2000 for half a million accounts).
Re:Project Euler Returns by stouset on Friday August 15, 2014 @04:38PM (#8184049)
38 minutes to log into your account seems excessive. Remember, this isn't just for password resets — it's to look up an account in the database by email address.
Re:Project Euler Returns by e12e on Friday August 15, 2014 @05:13PM (#8184253)
Ah, fair point. So we agree they need a (possibly not unique) user name too. [edit: note this is for 5 billion accounts, on a 10 year old cpu. So for 500.000 accounts, it would be ~1 seconds (average 0.5). Still probably too long for log-in (or particularly log-in failure feedback)).]
Re:Project Euler Returns by stouset on Saturday August 16, 2014 @03:25AM (#8185631)
If you have a username and emails aren't used for contacting users, why bother storing the email address to begin with?
Re:Project Euler Returns by e12e on Saturday August 16, 2014 @06:22AM (#8185831)
To verify that a username matches a given email address, so that you can provide password resets?