How do you encrypt the password when designing the table?
Kirito
Kirito 2018-05-22 19:39:10
0
5
1539

Teacher, please tell me how to encrypt the password when designing the table?

Kirito
Kirito

reply all(3)
johnxu

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.

  • reply I 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.
    Kirito author 2018-05-22 22:22:59
  • reply I 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
    酷我时光 author 2018-05-23 00:05:01
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template