Click here to Skip to main content
15,888,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I want to encrypt a column of a table in production. For that I have the script as below.But I am confused if I should use certificate to encrypt the symmetric key or a Password.As certificate will involve some cost in maintaining it.


CREATE SYMMETRIC KEY XYZConfigTableKey
WITH ALGORITHM = TRIPLE_DES ,
KEY_SOURCE = 'ConfigValtricKey',
IDENTITY_VALUE = 'ConfiSymmetricKey'
ENCRYPTION BY CERTIFICATE MWSEncryptCertificate


OR


CREATE SYMMETRIC KEY XYZConfigTableKey
WITH ALGORITHM = TRIPLE_DES ,
KEY_SOURCE = 'ConfigValtricKey',
IDENTITY_VALUE = 'ConfiSymmetricKey'
ENCRYPTION BY PASSWORD ='xysjj'
Posted
Updated 17-Dec-14 0:17am
v3

1 solution

they're both, fundamentally, the same - to access the data, you either need the password, or the private key attached to the cert (depending which option you choose)

it could be argued that the cert private key is more 'troublesome' to share around - you could mark the private key non-exportable

certificates, per-se, aren't more expensive than passwords to maintain, IFF you don't care about the certification chain (i'm guessing your mention of cost is to do with getting something counter-signed by thawte/verisign etc.?)

you can spin up a Certification Authority under windows server, create your own root cert and issues client certs on demand - the end user would need a copy of your root cert installed in their Trusted Root container - or you can use self-signed certs

Certs are about identification & signing/encrypting stuff - cert-chains are about believing a cert holders identity you've never seen before because it's been proven by someone you trust
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900