- User gives password.
- A "password key" is derived from the password (e.g. by PBKDF2). A random salt is applied.
- The password key is hashed with a HMAC algorithm (e.g. HMAC-SHA256), with itself as the key.
- The salt and HMAC result are stored in database, for verification of the password (for further user logins).
- The password key is used to encrypt other data.
Question: Is it safe to apply step 3 in terms of: can the password key be (easily) determined because it is known that it is the message to be HMACed?