I am trying to understand if my database password encryption structure is good, or not much use.
So when i register, the php will generate a 50 character random key, and that key will be put into a db table called hash tagged against the user id, then the hash will be used to AES encrypt the password and the password will be stored in another table.
When a user login, the hash will be pulled out and use for decryption. And if the login is successful, the hash key will be replaced with a newly generated one for next use etc.....
I am not sure if this is good idea or not, any feedback is good thanks!
password_hash()
in a table. 2. In case you need to check the password : 2.1 get the hashed password 2.2 hash the actual password 2.3 compare the 2 hashed strings usingpassword_verify()
2.4. make some decisions if they are equal or not.