search

Home  >  Q&A  >  body text

How do you encrypt the password when designing the table?

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

KiritoKirito2407 days ago1542

reply all(5)I'll reply

  • johnxu

    johnxu2018-10-28 17:20:00

    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).

    reply
    0
  • 格物

    格物2018-05-23 13:50:14

    The database is just varchar, the real encryption is MD5, usually I will use MD5($password.$token)

    reply
    0
  • 酷我时光

    酷我时光2018-05-22 22:00:51

    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
    0
  • Kirito

    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 · 2018-05-22 22:22:59
    酷我时光

    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

    酷我时光 · 2018-05-23 00:05:01
  • Cancelreply