S VK

S VK

  • NA
  • 13
  • 0

decrypting a db column

Nov 30 2012 6:05 AM
http://www.c-sharpcorner.com/uploadfile/chinnasrihari/data-encryption-and-decryption-in-sql-server-2008/

reffered above link
AS
BEGIN

SET NOCOUNT ON;
OPEN SYMMETRIC KEY SymmetricKey1
DECRYPTION BY CERTIFICATE Certificate1 WITH PASSWORD = 'Password';
SELECT CAST(DECRYPTBYKEY(kcode) as varchar(250))
FROM keycode
CLOSE SYMMETRIC KEY SymmetricKey1;
END


error

The private key password is invalid.


The key 'SymmetricKey1' is not open. Please open the key before using it