I am trying to encrypt some sensitive information on a database (SQL Server 2008 R2 Enterprise Edition) using the TDE encryption.
This is the test code I am doing :
use test1
create table users1(pid int not null, username varchar(20), pass varchar(20), encryptedpass varchar(5000))
GO
insert into users1 values(123456, 'mark', 'qwerty', '')
insert into users1 values(123448, 'katy', 'poiuytr', '')
insert into users1 values(147384, 'dick', '567tgbyhn', '')
insert into users1 values(844749, 'sam', 'ujnuhbygv', '')
insert into users1 values(585948, 'max', 'wsxedcrfv', '')
insert into users1 values(383929, 'jake', '1qaz2wsx', '')
CREATE MASTER KEY ENCRYPTION BY
PASSWORD = 'MaxSecurity'
GO
CREATE CERTIFICATE TestCert1
WITH SUBJECT = 'Password_Encryption';
GO
CREATE SYMMETRIC KEY Keyx
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE TestCert1;
GO
OPEN SYMMETRIC KEY Keyx
DECRYPTION BY CERTIFICATE TestCert1;
UPDATE test1.dbo.users1
SET encryptedpass = EncryptByKey(key_guid('Keyx'), pass);
CLOSE SYMMETRIC KEY keyx;
GO
However, when doing 'select * from users1' I am not able to view the encrypted column. The permissions are set to view as well.
Requesting help!