Skip to content
Advertisement

Get encrypted column name with their encryption key and certificate in sql server

I am using SQL Server 2008/2012.In my database I have a table which has encrypted column. The column is encrypted by using following query –

Create the example table

Set up the Master Key

Create the Symmetric Key and CERTIFICATE

Encrypt Data

I am decrypting this data by using the query –

Here we give key/ certificate value hardcoded.

I am getting the encrypted column name with their table by this query –

And the key and certificate list by this query –

Now I want to get which key/certificate belongs to which encrypted column SO I can apply decryption on that column without giving hardcoded value. Please help me….

Advertisement

Answer

After search and try I found the solution that is –

This query gives result the encrypted key which is belong to that column.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement