Transparent Data Encryption -SQL Server
Overview of steps –
1.Create Master Key on Master Database
2.Create Certificate protected by Master Key on
Master Database
3.Create Database Encryption Key using Certificate on
User Database that must be encrypted
4.Change the Database Option setting to Encryption
5.Backup Certificate and Private Key at safe place
Note
-
1.By
default certificate will expire in one year if we did not mention any date
during certificate creation
2.In case
of certificate expiry sql server will not stop or wait to renewal of
certificate it will encrypt even certificate is expired
1.Create Master Key on Master Database
Use Master
Go
Create Master Key
Encryption By Password ='Strong@password'
Go
2.Create Certificate protected by Master Key on Master Database
use master
Go
create Certificate TDE_CERT
WITH SUBJECT ='TDE Certificate'
Go
Select * from sys.certificates (check if certificate is created)
3.Create Database Encryption Key using Certificate on User Database that must be encrypted
Use TDEDB
Go
Create Database Encryption Key
with algorithm = AES_256
Encryption By Server Certificate TDE_CERT;
GO
4.Change the Database Option setting to Encryption
use master
Go
Alter database TDEDB
Set encryption on
Go
5.Backup Certificate and Private Key at safe place
Use Master
Go
backup certificate TDE_CERT
To FIle='C:\Encryption\TDE_CERT.cer'
with private key (file='C:\Encryption\pkey.key' ,encryption by password ='Passwo@rd')
Go
Comments
Post a Comment