in reply to RFC / Audit: Mojo Login Example

Disclaimer: I'm not at all familiar with Mojo, so there's a bit of guesswork while I'm interpreting the code.

So what should be included is:

Replies are listed 'Best First'.
Re^2: RFC / Audit: Mojo Login Example
by haukex (Archbishop) on Mar 23, 2020 at 07:35 UTC

    Thank you for the thoughtful reply!

    You don't want to expose the salt to the client - but without salt hashing doesn't give better security.

    Yes, I should have been more clear on this - I would take a hash of only the password on the client side, say SHA-512 multiple times, and additionally do the same hashing+salt on the server. That way, the cleartext password is never seen by the server, and provided the hash isn't in a rainbow table somewhere, it adds a tiny bit more security.

    All of your points are excellent, and yes, I see that perhaps a per-IP delay or lockout on too many attempts might even be better than the current implementation (in Mojo: $c->tx->remote_address). Even though I agree logging is very important, did leave it out of this example... but luckily Mojo makes it fairly easy to add: app->log->warn("..."), app->log->error("...") and so on, and it can be redirected into a database as well via the event mechanism built into Mojo::Log.