I am using the InnoDB MySQL engine.
I am doing the encryption in a stored procedure and then writing to the tables.
It seems like it would be logging the low-level changes to the DB. That data is already encrypted (if it needed to be).
As I understand it, there are two different types of logs that can record changes to the DB:
-
The redo log (ib_logfile group), which fixes half-done transaction in the event of a crash.
-
The binary log, which is used for replication and restoring from backup.
(source: http://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_ib_logfile)
Thanks.
Edit:
Found a good link regarding the binary log: http://dev.mysql.com/doc/refman/5.6/en/binary-log.html
But I would still like to know about the redo log.
It may be. If your MySQL server is set to log all statements to the general query log, or if you have binary logging enabled and not set to use the row-based format, the clear text and key will be logged there.
Additionally, doing encryption/decryption in the database may expose your data to an attacker who can modify stored procedures. It’s generally not a good idea; I’d avoid it.