Closed 7hoenix closed 3 years ago
Thank you! We should go ahead with this change indeed. I have added a comment. Also, the build is failing. Can you plaese take a look at the tests?
As for the windows question. Citate from comeonin
Argon2 is currently considered to be the strongest password hashing function, and it is the one we recommend. Bcrypt and Pbkdf2 are viable alternatives, but they are less resistant than Argon2, to attacks using GPUs or dedicated hardware.
So this superseedes now pbkdf2. Maybe we should also change the default on windows.
Thanks for this PR @7hoenix!. Now that phx_gen_auth has been merged into phoenix 1.6, I'm archiving this project and all phx.gen.auth issues will need to be handled in the phoenix repo.
Why is this change necessary?
When this generator was first created Bcrypt was still the OWASP recommended default choice https://github.com/dashbitco/mix_phx_gen_auth_demo/pull/1#discussion_r403110955
That has since changed and argon2 is now the officially recommended choice, with bcrypt only being recommended if argon2 is not available.
This PR swaps the default from bcrypt to argon2.
Should we also default Windows to argon2? <- I don't know and so I left it.