Our users log in with username/password, and have a cookie that allows them to remain logged in. Our users are expected to run updated versions of JS.
Assuming someone snags our database at some point,
Is it a good idea to reduce the entropy of our stored passwords by having the users perform a reasonable proof of work task on login and submit that as the password, and increase the difficulty over the years?
What this does:
- protect the users from having their weak passwords cracked and associated with their online identities
What this does not:
- provide a session key
- provide DDoS protection
- provide any other server security
clientside registration/login:
h = password
d = "0000f"
do:
h = hash (h + username + salt)
while (h > d)
send("login", username, h)
serverside login:
d = "0000f"
listen("login", username, h)
if h > d:
user = database.get(username)
if user.pass == h:
send("accepted", true)
session.user = user
clientside login part 2:
listen("accepted", accepted)
if accepted:
set cookie("user", user)
set cookie("h", h)
The advantage of this is that the user does not have to resubmit their password to update the difficulty.
I have implemented this protocol, but I haven't seen this anywhere else. And the first law of cryptodynamics is "Thou shalt never roll your own".
If this works, I would love to see this incorporated into a certificate to show the user that the server stores the user's secrets responsibly.