Contents

1 Create a Master Key
2 Create a Certificate
3 Create a Database Encryption Key
4 Enable TDE
5 谿瑚襭


1 Create a Master Key #

USE master;
CREATE MASTER KEY 
ENCRYPTION BY PASSWORD = 'Pass@word1';
GO

2 Create a Certificate #

USE master;
CREATE CERTIFICATE TDECert 
WITH SUBJECT = 'TDE Certificate'
GO

3 Create a Database Encryption Key #

CREATE DATABASE mssqltips_tde
GO
USE mssqltips_tde;
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE TDECert
GO

4 Enable TDE #

ALTER DATABASE mssqltips_tde
SET ENCRYPTION ON
GO
SELECT [name], is_encrypted FROM sys.databases
GO

5 谿瑚襭 #