Topic
[KB839]Using Transparent Database Encryption (TDE) on an SQL Server database
Applies to:
All versions of PcVue that support the HDS |
||
|
||
Summary:
This article explains how to enable and disable Transparent Database Encryption (TDE) on an SQL Server database. TDE is a solution provided by SQL Server to encrypt data in a database, and to protect the keys that are used to encrypt the data, using a certificate. Anyone without the keys cannot access the data. For more information refer to MSDN article : https://msdn.microsoft.com/en-us/library/bb934049.aspx |
||
|
||
Details:
When to use TDE In a scenario where the physical media (such as drives or backup tapes) is at risk of being stolen by a malicious third party who can then restore or attach the database and browse the data. Note: If you want to limit user access to your Database, use SQL Server rights, not TDE. SQL Server versions and editions that support TDE SQL Server 2014 – Enterprise, Developer, and Evaluation editions Script to enable TDE — /////////////////////////////////////////// — — Create Master Key USE master — Create server certificate CREATE CERTIFICATE SV32_ServerCertificate — Backup the certificate with the private key BACKUP CERTIFICATE SV32_ServerCertificate — Create Database Encryption Key (DEK) USE TDE_DATABASE1 CREATE DATABASE ENCRYPTION KEY ENCRYPTION BY SERVER CERTIFICATE SV32_ServerCertificate — Encrypt database ALTER DATABASE TDE_DATABASE1 How to check that TDE is enabled (1) Try to restore a backup of your database on another SQL Server instance. — Backup the encrypted database BACKUP DATABASE TDE_DATABASE1 — Attempt to restore the encrypted backup on another SQL Server instance USE master RESTORE DATABASE TDE_DATABASE1 This should produce an error like this: Msg 33111, Level 16, State 3, Line 2 To restore the database you have to restore the certificate with the private key (or create it) — Create Master Key USE master — Restore the certificate with the private key BACKUP CERTIFICATE SV32_ServerCertificate How to check that TDE is enabled (2) Check that the Encryption Enable property is set to True in the Database Properties -> Options -> Other options. Script to disable TDE, remove DEK, certificate BKP, certificate and master key — //////////////////////////////////////////// — — Decrypt database USE TDE_DATABASE1 — Delete Database Encryption Key (DEK) DROP DATABASE ENCRYPTION KEY — Delete backup of certificate and the private key EXEC sp_configure‘show advanced options’, 1 — Delete server certificate USE master — Delete master key DROP MASTER KEY |
||
|
||
|
Created on: 06 Oct 2016 Last update: 04 Sep 2024