Sunday, August 11, 2019

Implementing Transparent Data Encryption(TDE)

For encrypting database we need to do this few steps:
  1. Create master key on master database :
    1
    create master key encryption by password = 'testPassword'
    
  2. Create a server certificate derived from database master key :
    1
    create certificate test_cert with subject = 'test_cert'
    
  3. Use our database and create database encryption key by our server certificate:
    1
    2
    create database encryption key  with algorithm = AES_256
    encryption by server certificate test_cert
    
  4. Set encryption on on database level:
    1
    alter database test set encryption on
    
There are few restrictions and possible problems with encrypted databases :

  • If you don't backup our master key, certificate and encryption  key it will not possible to restore or move our database to another server 
  • Encrypted database have performance overhead

No comments: