S
S
Sergey2014-09-01 13:29:55
Yii
Sergey, 2014-09-01 13:29:55

How to encrypt login in Yii framework?

In the Yii framework, I encrypt the user login:
Yii::app()->securityManager->encrypt('[email protected]')
and get the password hash:
CPasswordHelper::hashPassword('123456');
Then I save it in the database.
The question is:
How to find the login in the database during authorization if the cipher from '[email protected]' always turns out to be different, is it that I have to get all the records from the database and decrypt everything? What should I do if I do not want to store e-mail addresses in the database in clear text?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vit, 2014-09-01
@fornit1917

> the cipher from '[email protected]' is always different
Do you specify the key even when encrypting?

S
Sergey, 2014-09-01
Protko @Fesor

search by email, check through verifyPassword. The password or hash should not participate in the sample, in theory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question