I have to secure a B2B web application data in a MySQL database, currently the user register his data are like that :
Last name (Plain text) First name (Plain text) Email (Plain text and indexed) Password (Hashed with CRYPT_BLOWFISH method)
As user log in with their email and password, I only have to compare stored password with the hashed password given using.
Now to secure these data I would like to do the following :
Last name (encrypted with openssl_encrypt) First name (encrypted with openssl_encrypt) Email (Hashed with CRYPT_BLOWFISH method) Password (Hashed with CRYPT_BLOWFISH method)
With this impossible to index email to retrieve them faster and I must first compare ALL hashed emails to the hashed email given and them compare the password.
Do you think it's the best way to secure the email or there is another way to do that ?