Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

STEP 1: Create Encryption Key with Some Password

USE master;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'pimpom@123';
go


STEP 2: Next Create CERTIFICATE with some Description

CREATE CERTIFICATE MySanPract WITH SUBJECT = 'Pract_Certificate';
go


STEP 3: Now we are going to use this Certificate and Encryption key for desired Database to enable TDE
with some Encryption algorithm.
USE SanPract;
GO
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_128
ENCRYPTION BY SERVER CERTIFICATE MySanPract;
GO

STEP 4: Before enabling the encryption key we need to take the back up of Certificate and Private key,
This key will be help full while taking the backup and restore etc.
USE MASTER

GO

BACKUP CERTIFICATE MySanPract TO FILE = 'c:\backups\storedcerts\ServerCertificate'

WITH PRIVATE KEY ( FILE = 'c:\backups\storedkeys\ServerCertificate' ,

ENCRYPTION BY PASSWORD = 'pimpom@123' );

GO

STEP 5: After taking the backup of it. We can enable this encryption key on particular database.
USE SanPract;
GO
ALTER DATABASE SanPract
SET ENCRYPTION on;
GO

You might also like