phpsqlencryptionatk4

Encrypt password on database


It's clear for me how to read a user/pass from database using encrypted passwords with SQLAuth, but when I create (for ex.) a register form, how can I do to encrypt the user password ?

Thanks, Alejandro


Solution

  • Use $this->api->auth->encryptPassword($password,$salt) The first argument is the password string, the second is the salt that is mandatory for sha256/salt encryption mode.

    You can store the result in the password field of your model (or in the table directly with dsql).

    The first application tutorial can be useful too: http://agiletoolkit.org/learn/app/auth