Live data from Hacker News

How to Safely Store Your Users' Passwords in 2016

paragonie.com

311–320 of 321 posts

Re: How to Safely Store Your Users' Passwords in 2016

#311
post #233

I believe that the safest way is not to save them. Instead, outsource this to a few select OAuth providers which you and your customers are willing to trust.

What do you do about sites where the users don't particularly likely said providers? Not everyone uses Facebook or Google or Twitter after all, and a lot more would rather use an anonymous disposable account than one tied to an existing identity. There's also the fact said systems seem to be a nice target for spammers. They're popular, so they're often attacked. And because they're often attacked, their anti spam def…

> Not everyone uses Facebook or Google or Twitter after all

Yep, I do tailor the selection of oauth providers to my audience. E.g., an app for devs = google, github, and gitlab.

Re: How to Safely Store Your Users' Passwords in 2016

#312

I believe that the safest way is not to save them. Instead, outsource this to a few select OAuth providers which you and your customers are willing to trust.

What do you do if your name is Dread Pirate Rogers and the set of OAuth providers you and your customers trust is "None"?

Heh, good point.

Re: How to Safely Store Your Users' Passwords in 2016

#313
post #310
post #286

Earlier quoted context omitted.

> This does mean that you need to be able to check subsets of the characters in the password, which rules out hashing the whole password in this case. As you implicitly point out, however, it doesn't require any portion of the password ever to be visible to the call-centre employee; one can just supplement an individual hash by a collection of hashes of appropriate character subsets, and then (say) randomly pick amon…

note though, that this means you have a collection of hashes for the password that are each 3 characters or whatever long, which can be brute forced in essentially no time at all. Crack em all, lay them out according to what letters the hash is for, put it all together and you are done. Even just having 1 subset reduces your passwords security by that many letters, if not more (you can filter out dictionary guesses t…

Good point. Would salting them obviate the problem?

Re: How to Safely Store Your Users' Passwords in 2016

#314

Earlier quoted context omitted.

I agree that it's better to avoid storing user credentials, but what do you suggest instead to authenticate the user?

If you don't require privileged elevation, then I'm a fan of just using an email address and send "magic links" + persistent (but expiring) sessions. For mobile apps, I think using SMS and One-Time Passwords is sufficient as well. You can also use a delegated auth system put in place by OAuth v2, or something like Google Accounts, Twitter, etc. Those services do get pushback, as not every uses Gmail (or likes to give…

> If you don't require privileged elevation

What do you mean by privileged elevation (I'm talking in the context of a web app)?

> just using an email address and send "magic links" + persistent (but expiring) sessions

Do you mean something similar to what Medium does?

https://medium.com/the-story/signing-in-to-medium-by-email-a...

I like it too. But what about delays in receiving emails (when I suggested this approach to some customers, they were worried about that)?

> You can also use a delegated auth system

Yes, outsourcing the authentication is another solution, but some (most?) users are not comfortable with giving so much power to Google/Twitter/GitHub/etc. (as you wrote in your comment).

Re: How to Safely Store Your Users' Passwords in 2016

#316

Earlier quoted context omitted.

This requires your users to trust whichever OAuth providers you decide to integrate with. Sometimes, the set of "trusted OAuth providers" for your users is {}. What then? > 99% of the websites that "require" me to create an account and log in don't need to store primary credentials for me Why are you giving them valuable credentials? Give them a throw-away password (password managers are great for this).

You don't integrate with a provider. You implement the protocol and let your users supply a URL. Layering on popular alternatives (Facebook, Google, etc) help, but use the Stack Exchange model. Let users do what they want to do. That way users can be their own oAuth providers if they want.

I thought that Stack Exchange was using OpenID?

Re: How to Safely Store Your Users' Passwords in 2016

#317

Earlier quoted context omitted.

If you don't require privileged elevation, then I'm a fan of just using an email address and send "magic links" + persistent (but expiring) sessions. For mobile apps, I think using SMS and One-Time Passwords is sufficient as well. You can also use a delegated auth system put in place by OAuth v2, or something like Google Accounts, Twitter, etc. Those services do get pushback, as not every uses Gmail (or likes to give…

> If you don't require privileged elevation What do you mean by privileged elevation (I'm talking in the context of a web app)? > just using an email address and send "magic links" + persistent (but expiring) sessions Do you mean something similar to what Medium does? https://medium.com/the-story/signing-in-to-medium-by-email-a... I like it too. But what about delays in receiving emails (when I suggested this approac…

> What do you mean by privileged elevation (I'm talking in the context of a web app)?

For example, prior to changing account settings, reauthenticate the users, regardless if they have a valid session.

> I like it too. But what about delays in receiving emails (when I suggested this approach to some customers, they were worried about that)?

Combo of email & SMS.

As Bruce Schneier has written, security is usually a trade off of user experience.

Re: How to Safely Store Your Users' Passwords in 2016

#318

Earlier quoted context omitted.

> If you don't require privileged elevation What do you mean by privileged elevation (I'm talking in the context of a web app)? > just using an email address and send "magic links" + persistent (but expiring) sessions Do you mean something similar to what Medium does? https://medium.com/the-story/signing-in-to-medium-by-email-a... I like it too. But what about delays in receiving emails (when I suggested this approac…

> What do you mean by privileged elevation (I'm talking in the context of a web app)? For example, prior to changing account settings, reauthenticate the users, regardless if they have a valid session. > I like it too. But what about delays in receiving emails (when I suggested this approach to some customers, they were worried about that)? Combo of email & SMS. As Bruce Schneier has written, security is usually a tr…

> For example, prior to changing account settings, reauthenticate the users, regardless if they have a valid session.

Why not reauthenticate by sending a one time password by email/SMS (instead of asking for a password)?

> Combo of email & SMS.

Good idea. I was also thinking of sending one time passwords through some chat applications like WhatsApp, but most of them have no API for such a thing (except Telegram).

Re: How to Safely Store Your Users' Passwords in 2016

#319

Earlier quoted context omitted.

> If you don't require privileged elevation What do you mean by privileged elevation (I'm talking in the context of a web app)? > just using an email address and send "magic links" + persistent (but expiring) sessions Do you mean something similar to what Medium does? https://medium.com/the-story/signing-in-to-medium-by-email-a... I like it too. But what about delays in receiving emails (when I suggested this approac…

> What do you mean by privileged elevation (I'm talking in the context of a web app)? For example, prior to changing account settings, reauthenticate the users, regardless if they have a valid session. > I like it too. But what about delays in receiving emails (when I suggested this approach to some customers, they were worried about that)? Combo of email & SMS. As Bruce Schneier has written, security is usually a tr…

> Combo of email & SMS

In France, where I have most of my customers, the SMS is paid by the sender, which makes it expensive.

Re: How to Safely Store Your Users' Passwords in 2016

#320
post #313
post #310

Earlier quoted context omitted.

note though, that this means you have a collection of hashes for the password that are each 3 characters or whatever long, which can be brute forced in essentially no time at all. Crack em all, lay them out according to what letters the hash is for, put it all together and you are done. Even just having 1 subset reduces your passwords security by that many letters, if not more (you can filter out dictionary guesses t…

Good point. Would salting them obviate the problem?

nope. Salt is good for eliminating rainbow tables and similar vectors. At this level, let's just say you go after uppercase, lowercase, digits and 20 different symbols, (a total of 82 letters) you'll wind up with 551,368 possible combinations. The only way to make it "safe" would be to get a hash method that would take multiple seconds to run on good hardware. (as a comparison, I crack raw NTLM at something on the order of billions of hashes per second)
Post reply on HN