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

  • 4
    Encrypt the hard drive? – Michael Hampton Apr 28 '14 at 14:22
  • Hmm... I prefer encrypting the data of the db and not the whole HD if it's possible – Yaron U. Apr 28 '14 at 15:57
  • 1
    You could store the MySQL database on a separate partition and encrypt only that partition. – Cristian Ciupitu Apr 29 '14 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. Apr 29 '14 at 11:51
  • What language are you using? – Markus W Mahlberg May 13 '15 at 11:31

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.

| improve this answer | |

XtraBackup provides such a functionality

| improve this answer | |
  • sounds interesting. is it possible for live db and not only for backups? – Yaron U. Apr 29 '14 at 20:12
  • I think you are looking for filesystem encryption. – da_didi May 1 '14 at 6:50
  • I just found this presentation, pls read slide 53 and following: yassl.com/files/yassl_securing_mysql.pdf – da_didi May 1 '14 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.