How about databases explicitly disallow direct comparison or materialization of any field named 'Password', 'Passwd' etc. I'm aware that this would be a breaking change, and would require overrides to support legacy software. That said, the defaults would lead developers to a secure by default mindset. If n00b dev1 realizes that s/he can't store a password and get it back again, they go looking for why and find that the only way is to call something like:
SELECT IsPasswordValid(Password, @Password) FROM Users
UPDATE Users
SET Password = StorePassword(@Password)
Edit: I realize that there are security issues with the suggested sql. A PAKE is probably necessary.I'd search myself but I'm afraid to find a "bad" tutorial.
The key is speed: it's too fast. Far faster than you need it to be. Fast enough that attackers could attempt very large numbers of passwords per second.
What you want is something slow, to slow down the attackers.
Probably the most popular choice is bcrypt, and you can't go wrong making that decision. In some environments you may need something more standardised / accepted, in which case you want to look at PBDKF2. There's also scrypt, which is a bit stronger than bcrypt, but a bit newer.
_Any of these three are uncontroversial choices._ Using any of them is better than using just about anything else, and the gap between each of them is much smaller than the gulf between those three and schemes such as yours.
Once you've picked one you also need to tune it: make it as slow as you can bear. If your users won't be driven away by login taking a whole second, then make it take a whole second! The key is making it slow.
---
One broader piece of advice: Don't reinvent the wheel when it comes to security things. Passwords, sessions, and so on, you should be looking for well-supported, maintained, high-quality libraries that have been vetted for design and implementation mistakes. There's libraries out there to solve these problems, if you aren't a security expert you should be using them :)
The catch is one of "what platform are you using", as bindings are somewhat limited.
However, another approach would be extension of the database's client-server protocol and driver(s) such that the hash verification occurs within the application tier (as part of the driver). Or, moving further along that path, the field could be annotated in your ORM, exposing special set and verify methods. But at that point, you're very close to the current condition, where the hashing occurs within your web application framework.
Or hashing could be done on the client side.
Only if you use a proper PAKE. A vanilla password hash is still a bearer token on the wire.
My POV is you should be able to verify user sign-in with something like "SELECT COUNT(*) FROM users WHERE email = '[email protected]' AND password='hunter2';", which has the added bonus of not informing the client whether the query failed because the user didn't exist, or because the password was wrong. Imho, all queries for the column content should simply fail.
I would add that the 'bonus' of not informing of the correct error provides minimal security gain and hurts usability.
This would be a bug. There should be no way for someone with my e-mail address to determine if I use any particular service.
Almost as you said below: Passwords are long overdue. They are lost, written down, or 1password becomes the single point of failure, keylogged, recoverable by email, prone to brute-force or more clever attacks, the user types them in the username field (my security teacher did exactly that in front of the whole class while saying it), or worse, in the group chat window that just popped up...
We needed Persona. We needed an open marketplace for password replacement. Bash & SSH have pretty much gotten rid of passwords. I'd bet a year in prison that Mozilla has been served an NSL and ordered to shut down the project.
There are too many vested interests from the big players, where the hope is that deliberately making authentication ever more burdensome for users will just lead them to give up and select 'login with Facebook/Google/Live' and hand them the keys to the kingdom.
Can we please get password storage built in to databases as a dedicated column type already? There are N-to-infinity crappy languages and CMS's out there, but only a handful of databases. It's becoming clear that widespread standard library support for decent password hashing just isn't enough to get people moved over.