I'm learning about security at the moment and one thing I'd like to try out is having a key server distribute keys to clients that will allow them to securely save and read data locally.
My basic idea is that the client will communicate with the server over TLS where they'll provide a username and password. This password will be used to both authenticate the user and decrypt the key in the database.
Essentially the key server database would be laid out like so:
| User Name | Hashed Password+Salt | Salt | Encrypted Key |
In this case, would the keys be secure in the event of a database leak? I'm wondering if there is a best practice for this kind of implementation or should I handle this differently?