Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto_password_hash returns an atom #141

Open
rrooij opened this issue Dec 4, 2019 · 3 comments
Open

crypto_password_hash returns an atom #141

rrooij opened this issue Dec 4, 2019 · 3 comments

Comments

@rrooij
Copy link

rrooij commented Dec 4, 2019

Should probably be a string as atoms can be easily fetched with current_atom/1

@JanWielemaker
Copy link
Member

Thanks for reminding. @triska may prefer adding an option to crypto_password_hash/3 to specify the representation of the hash? Some other predicates use e.g. as(atom), as(string), as(codes), ...

@triska
Copy link
Member

triska commented Dec 4, 2019

The hash in crypto_password_hash/3 is not sensitive information.

Or, phrased differently, if you consider the hash sensitive, then you should choose parameters so that it is no longer sensitive, and apply good practices for choosing passwords!

In this sense, making the hash less accessible would arguably even deter from good practices that solve the root issue (weak passwords, weak parameters).

@JanWielemaker
Copy link
Member

In an ideal world I could agree. In practice though, users tend to use relatively weak passwords and re-use them over different domains. You can tell users they shouldn't, but that only helps a little. A password hash allows you to run brute-force attacks on the password without time or max-attempts restrictions and possibly with a lot more hardware than you expected. That does make them a security risk. Of course no user should be able to get access to current_atom/1 in a multi-user setup, but getting access to shared atoms is easier than getting access to volatile data on the stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants