Welcome Guest, Not a member yet? Register   Sign In
Encryption and Encryption_key
#1

I am just doing some tests and have got myself a bit confused on CI3 and encryption.

I encrypt a simple string like 'HelloWorld', call it $coded and store it in a database BLOB field.

I then, from a controller, read the blob field and call it $db_coded.

I compare $coded and $db_coded and the comparison fails.

BUT, if I decrypt $db_coded and compare it to 'HelloWorld', the comparison passes.

Why would that be? Is it something to do with the prepended length on the Blob field?

If later I need to do a lookup on the field I will need to encrypt the 'HelloWorld' to compare it to the Blob field, but that comparison is failing.

Thanks in advance for any help or advice and apologies if I have just missed something really daft :-)

Best wishes,

Paul.
Reply


Messages In This Thread
Encryption and Encryption_key - by PaulD - 03-24-2015, 04:52 AM
RE: Encryption and Encryption_key - by Mel9pr - 03-24-2015, 01:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB