TP5 has an assistant class Hash::make('12345'); that can generate keys, and Hash::check(); that can verify passwords, which is very easy to use and very safe. The database only needs to set the password type to varchar(64).
replyI saw it based on the teacher's video explanation. The password attribute of the teacher's database was already encrypted before the form was submitted. I didn't understand what was going on.
replyI took a look at this course. The teacher just reserved the password field as 32-bit characters of varchar. This is to prepare for storing the password when submitting the form later. The md5-encrypted string is 32-bit, so the real encryption process is handled in the form section
TP5 has an assistant class Hash::make('12345'); that can generate keys, and Hash::check(); that can verify passwords, which is very easy to use and very safe. The database only needs to set the password type to varchar(64).
The database is just varchar, the real encryption is MD5, usually I will use MD5($password.$token)
When submitting the form, you must encrypt the password. The common encryption method is md5, and then save the encrypted string to the database.