we are canceling the web application using Spring 3.1.2 and Hibernate 4.1.7 with a SQL Server 2005 database.
We have an encrypted column on the table, and we need to execute some queries, for example, the following:
OPEN SYMMETRIC KEY PasswordFieldSymmetricKey DECRYPTION BY PASSWORD = 'myPassword' SELECT id, plain, cipher, CONVERT(varchar(50), DecryptByKey(cipher)) AS 'Decrypted' FROM TS_OWN.cryptest; GO CLOSE SYMMETRIC KEY PasswordFieldSymmetricKey
As a solution, someone suggested creating a view that controls the decryption, but we need no one to see the decrypted data, and of course, the DBA can request this view.
At the same time, we do not want to perform decryption on the java side due to some large aggregate logic, which is expected to be executed using the database engine due to performance reasons.
A possible solution is to create a view that decrypts, aggregates and then encrypts the result again, decrypting the aggregated values ββon the Java side.
Does anyone know of alternatives?
Thanks everyone, Luke
source share