Author: CurtisJL | Posted on: 1/26/2010 2:18:05 PM | Views : 289

I am trying to use both .NET Cryptography as well as SQL Symmetric Encryption with Triple DES, if it's possible.  I was able to set up a test database with encryption on a single field like so:
 
-- Create Database Master Key USE EncryptTest GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'MyN3wT3$t' GO -- Create Encryption Certificate USE EncryptTest GO CREATE CERTIFICATE EncryptTestCert WITH SUBJECT = 'MyN3wT3$t' GO --Create Symetric Key USE EncryptTest GO CREATE SYMMETRIC KEY TestTableKey WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE EncryptTestCert GO -- Update binary column with encrypted data created by certificate and key USE EncryptTest GO OPEN SYMMETRIC KEY TestTableKey DECRYPTION BY CERTIFICATE EncryptTestCert UPDATE TestTable SET EncryptSecondCol = ENCRYPTBYKEY(KEY_GUID('TestTableKey'),SecondCol) GO -- Decrypt the data of ...

Go to the complete details ...