HSQL DB function to decrypt AES value

333 Views Asked by At

I have an HSQL database. It has a table with a particular column which has AES encrypted values. What I need is decrypt those values using an HSQL function. In MySQL it has function aes_decrypt('encrypted_value', key). So, using MySQL I can run following query select AES_DECRYPT('7FCDjrd8nHPKOQgb7bzskQ', 'TheBestSecretKey') to get my work done.

Anyone knows an alternative for this in HSQL DB.

1

There are 1 best solutions below

1
fredt On BEST ANSWER

There is no equivalent function in HSQLDB. But you can define your version of aes_decrypt in Java and and use CREATE FUNCTION in HSQLDB to link to your java code. You need to find out exactly what MySQL does during encryption and decryption and apply it to your own function.