How to integrate AES_ENCRYPT & AES_DECRYPT?

How to integrate AES_ENCRYPT & AES_DECRYPT?

jwisejwise Posts: 6Questions: 0Answers: 0
edited May 2013 in General
I have some fields which need to contain encrypted data. Is there any way to wrap specific fields in an AES_ENCRYPT function on submission? In addition, a CAST(AES_DECRYPT() AS CHAR) is required in order to return the string value from those VARBINARY fields on SELECT.

Regards,
-John

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Hi John,

    If you are using the Editor PHP classes, you could use get and set formatters to do this. There aren't any built in functions for this kind of encryption handling, but its simple to use a closure to do it. The documentation for the Field class functions, including the get and set formatters is available here: http://editor.datatables.net/docs/current/php/class-DataTables.Editor.Field.html#_getFormatter .

    Note that these are executed in PHP-world. There is currently no method in the Editor PHP libraries to use SQL functions.

    Regards,
    Allan
This discussion has been closed.