Welcome Guest, Not a member yet? Register   Sign In
Encryption Observation
#1
Question 
(This post was last modified: 05-10-2018, 02:38 PM by CobolGuy.)

After 
1) Auto-loading the encryption library
2) Generating an encryption key
3) Storing the encryption key in the config file

I used the encrypt function prior to storing passwords in the user table. 

Funny thing is, during Login, I tried encrypting the posted password from $this->input->post( ), and including it in the WHERE clause together with the email address, and for some reason it never returned TRUE.

An experiment lead me to DEcrypt the table value of the password, proved that the value is indeed the one I entered. 
However, when I removed the password from the WHERE clause of the query, and retrieved the user row only with the email address; I subsequently DEcrypted the database value of the password, and compared it with the posted password as-is, it worked just fine and the user was logged in. 

So, Do I understand it correctly; that there is something instance related in the encrypted value, such that if you encrypt the same value again, it won't match. To determine equality, one has to DEcrypt the encrypted version, and compare the native values??? 

What say yee?
Reply


Messages In This Thread
Encryption Observation - by CobolGuy - 05-09-2018, 04:59 PM
RE: Encryption Observation - by ciadmin - 05-09-2018, 06:37 PM
RE: Encryption Observation - by CobolGuy - 05-10-2018, 02:41 PM
RE: Encryption Observation - by ciadmin - 05-10-2018, 03:25 PM
RE: Encryption Observation - by CobolGuy - 06-23-2018, 10:54 AM
RE: Encryption Observation - by Pertti - 06-24-2018, 03:45 AM
RE: Encryption Observation - by InsiteFX - 06-24-2018, 04:05 AM
RE: Encryption Observation - by CobolGuy - 06-24-2018, 06:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB