TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bineeshcp Viswanath
NA
140
39.3k
How can decrypt column in SQL SP
Mar 4 2019 3:55 AM
Dear All,
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
And then the result is coming in my stored procedure is like this:-
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 :-
Reply
Answers (
6
)
Enable full text on cloud server
Regarding Stored Procedure