I have a client requirement that all fields in the DB be encrypted (excluding PKs). Has anyone done this before using Yii?
I’m thinking about using MySql’s AES_ENCRYPT function as the encryption mechanism. Since all fields need to be encrypted, I’m thinking of modifying the CActiveRecord’s beforeSave() and afterFind() methods to do the encryption/decryption. Does this seem like a viable solution and am I going to run into any troubles?
Not sure if i understand correctly: You want to encrypt every field (so like "name", "street" etc.)? You are aware that by doing so, you can not use any of them in a WHERE condition that makes sense anymore?
Yeah, I expected a few hiccups. I found this article that points out that all the query params (in WHERE clause) need to be encrypted when doing a SELECT - makes sense.
I will post back my findings. It’s going to be a long night!!