Is there a way to encrypt the whole data of a mysql DB using the AES 256 symmetric encryption method without encrypting the data manually using AES_ENCRYPT ?
This article explains about the same functionality in MsSql databases
-
4Encrypt the hard drive?Michael Hampton– Michael Hampton2014年04月28日 14:22:55 +00:00Commented Apr 28, 2014 at 14:22
-
Hmm... I prefer encrypting the data of the db and not the whole HD if it's possibleYaron U.– Yaron U.2014年04月28日 15:57:46 +00:00Commented Apr 28, 2014 at 15:57
-
1You could store the MySQL database on a separate partition and encrypt only that partition.Cristian Ciupitu– Cristian Ciupitu2014年04月29日 00:07:01 +00:00Commented Apr 29, 2014 at 0:07
-
Correct me if I'm wrong - but, encrypting the partition itself helps only if someone tries to read the data without being already logged to the OS.. right?Yaron U.– Yaron U.2014年04月29日 11:51:26 +00:00Commented Apr 29, 2014 at 11:51
-
What language are you using?Markus W Mahlberg– Markus W Mahlberg2015年05月13日 11:31:06 +00:00Commented May 13, 2015 at 11:31
2 Answers 2
MySQL doesn't support data file encryption natively, but there are ways to do it. There is a product called Vormetric Transparent Encryption. Read info about it here: http://www.vormetric.com/data-security-solutions/use-cases/database-encryption But if you want to actually use SQL for this purpose, newer versions support AES_ENCRYPT() and AES_DECRYPT() (the official AES standard). You can read about the two functions here, in the mysql 5.x manual: https://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_aes-encrypt
So basically you can encrypt the data prior to the insert query. MySql wont know the difference. also, you will have to decrypt it when extracting any data.
XtraBackup provides such a functionality
-
sounds interesting. is it possible for live db and not only for backups?Yaron U.– Yaron U.2014年04月29日 20:12:14 +00:00Commented Apr 29, 2014 at 20:12
-
I think you are looking for filesystem encryption.da_didi– da_didi2014年05月01日 06:50:49 +00:00Commented May 1, 2014 at 6:50
-
I just found this presentation, pls read slide 53 and following: yassl.com/files/yassl_securing_mysql.pdfda_didi– da_didi2014年05月01日 07:22:17 +00:00Commented May 1, 2014 at 7:22