I didn't know if I should put this question in the php section or in the database section, but since I beleive the answer will be in php, I guess I will post it here.
So as the title say, I want to encrypt the data in my database.
I use mysql, and to communicate with it, I use PHP + PDO.
And I always prepare my function, and use execute(array()) to call PDO like this
$sth = $dbh->prepare('select ... where id=:id'); $sth->execute(array(':id' => $id))
My first though was to override the execute and fetch function of PDO, to pass them throw a encryption function, but at the moment of execution, I do not know what columns has to be encrypted (such as varchar, text), and witch can't be encrypted (such as id, or date)
So my next tough was to rewrite some of my code, and insted of using execute(array), use bindParam or bindValue
It would be a pain to rewrite my code, but would work... except when I fetch, I would not know when the data is encrypted, and when it isn't
Anyone have an idea for this?