I have encrypted a table column and I want to display data decrypt data.
I have used below query to encrypt data. I need your help to how I can display data as it is in real.
- OPEN SYMMETRIC KEY CreditCards_Key11
- DECRYPTION BY CERTIFICATE Sales09;
- UPDATE Sales.CreditCard
- SET CardNumber_Encrypted = EncryptByKey(Key_GUID('CreditCards_Key11')
- , CardNumber, 1, HashBytes('SHA1', CONVERT( varbinary
- , CreditCardID)));
- GO
- SELECT CustomerID
- AS 'Encrypted ID Number',
- CONVERT(nvarchar, DecryptByKey(CustomerID))
- AS 'Decrypted ID Number'
- FROM tblCustomer
- GO
- CLOSE SYMMETRIC KEY UniqueCUSTOMERID
and the output is :-
Jignesh KumarPosted Mar 5, 2019, 9:51 AM
Bineeshcp ViswanathPosted Mar 5, 2019, 12:41 AM
I have done the below query and I can able to decrypt the data.
Vivek KumarPosted Mar 4, 2019, 1:31 PM
Sanwar RanwaPosted Mar 4, 2019, 5:16 AM
Bineeshcp ViswanathPosted Mar 4, 2019, 4:36 AM
Sanwar RanwaPosted Mar 4, 2019, 4:02 AM