Enabling Transparent Data Encryption on SQL Server databases
SQL Server has a built-in encryption TDE mechanism (Transparent Data Encryption) encrypts the data residing in the database or in backups on physical media.
Before you begin
About this task
To enable TDE on SQL Server, you must have the normal permissions associated with creating a database master key and certificates in the master database. You must also have CONTROL permissions on the user database.
Enabling encryption is a common task for database administrators; for convenience, we have provided a SQL script to use which is suitable for a typical SQL Server configuration: EnableTDE.zip. (If file doesn't download, right-click the link and save the file to your hard drive.)
Note: For
upgrade users:
- To improve database upgrade performance, enable TDE after the database upgrade has completed.
- While you can perform these steps at any time, the database will not be encrypted until you have completed the steps. Enabling TDE before the upgrade process will protect your database throughout the upgrade and afterwards.
Procedure
Results
Important: Once completed, be sure to write down
the passwords used in this script, and make a copy of the certificate
backup. The certificate backup consists of two files, AppScanEntCert.bak
and AppScanEntCert.pvk. They will be stored with the database .mdf
file, by default in the folder:
- (SQL 2014) C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA
- (SQL 2012) C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA
- (SQL 2008) C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
- (SQL 2008 R2) C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA