0

I'm using Tank Auth for my website.

I've searched for a function that would check if user has entered a valid password, when he tries to update his profile.

I don't understand how to hash password from user input that would match one in database.

Here's my controllers code:

            $password = $this->input->post('password');
            $hasher = new PasswordHash(
                $this->config->item('phpass_hash_strength', 'tank_auth'),
                $this->config->item('phpass_hash_portable', 'tank_auth')
            );
            $hashed_password = $hasher->HashPassword($password);

$hashed_password gives me different hash each time

I dont think that i should enable phpass_hash_portable

Any advices?

2 Answers 2

2

You need to use the CheckPassword module of the Tank Auth instead of hashing it by using the PasswordHash of the phpass.

0

You can check your password by using this function:

$hasher->CheckPassword(password which has to be checked,password from database).

instead of encrypting yourself.

Note: password which has to be checked => is raw data password from database => password from database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.