3 ms·
You could do this without allowing the hashes to act as passwords directly by establishing a "skeleton key" approach: WHERE user.password = hash(input) OR
by kwantam 16y ago
You could do this without allowing the hashes to act as passwords directly by establishing a "skeleton key" approach:
WHERE user.password = hash(input) OR hash(user.password + skeleton_key) = input
If the police want to log into a user's account without their password, they combine the hash of their password with the skeleton key, hash that, and submit it as the password.
Of course, now you have to keep skeleton_key a secret. Presumably you wouldn't store it in the same database as the password hashes, so losing the database wouldn't immediately grant access to everyone's account.
I'm not claiming this is particularly secure. In fact, it's kind of the opposite: it's intentionally adding a back door to your authentication system. But at least it's a door rather than a gaping hole :)