1

Is there any way by which we can encrypt data before INSERT or UPDATE query and decrypt the same when SELECT query fire dynamically in Mysql ? I have done this by using "Hooks" feature of php but am looking for some efficient way other then this, and i know it can be done using AES_ENCRYPT() but for that i have to change everywere in my query which i dont want to do that in such large system, also i cant use "Encryption at rest" because my saved data will keep on changing.

From Comments:

Actually I am working on a system which is already developed, but for some security reasons now I need to encrypt all column data of a specific table without manually modifying all queries, so you can say "how to encrypt within MySQL" ?

A_S
  • 127
  • 7
  • Are you referring the `Data at Rest Encryption` by MariaDB ? Perhaps this will help - https://www.chriscalender.com/an-introduction-to-mariadbs-data-at-rest-encryption-dare-part-1/ – IVO GELOV Jul 25 '18 at 10:05
  • actually am looking for InnoDB. – A_S Jul 25 '18 at 10:09
  • DARE is supported both for InnoDB and XtraDB - https://mariadb.com/kb/en/library/data-at-rest-encryption/ – IVO GELOV Jul 25 '18 at 10:13
  • This is a very broad question - do you mean "how do I encrypt before sending data to MySQL" or do you mean "how to encrypt *within* MySQL" ? – Martin Jul 25 '18 at 10:17
  • actually am working on a system which is already developed, but for some security reasons now i need to encrypt all columns data of a specific table without manually modifying all queries, so you can say that more likely to "how to encrypt within MySQL" – A_S Jul 25 '18 at 10:27
  • 1
    @A_S in MySQL it is best from a security point of view to encrypt the data *before* it touches the database. [Please read the linked question](https://stackoverflow.com/questions/46001354/encryption-at-rest-and-or-aes-encrypt) for the details as to why. – Martin Jul 25 '18 at 10:33

0 Answers0