17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 – Transparent Data EncryptionAs for Listing 5-5, by omitting the ENCRYPTION BY PASSWORD argument, weare specifying that the certificate is to be protected by the database master key.At this point in the process you should perform a backup of the certificate withits private key, using the BACKUP CERTIFICATE command shown in Listing6-5. In the event that the HomeLending database needs to be restored, thiscertificate and its private key will be required.USE master;GOBACKUP CERTIFICATE MasterCertTO FILE = 'D:\HomeLending\Backup\MasterCert.bak'WITH PRIVATE KEY (FILE = 'D:\HomeLending\Backup\MasterCert.pvk',ENCRYPTION BY PASSWORD = 'MyB@ckUpP@ssw0rd');GOListing 6-5: Backing up the MasterCert certificate.Since our MasterCert certificate is protected by the Master database masterkey, the DECRYPTION BY PASSWORD argument is not included in the WITHPRIVATE KEY argument of this command.The User DatabaseHaving created the database master key and the MasterCert certificate in theMaster database, we are ready to create the database encryption key for theHomeLending database which we will use to perform the cryptographicfunctions for the physical files of our database.The database encryption key is created using the CREATE DATABASEENCRYPTION KEY command. The arguments to this method include:• WITH ALGORITHM: Specifies the algorithm used, which in turndictates the strength of the key.• ENCRYPTION BY: Defines the protection method of the key. The keyused in the ENCRYPTION BY argument can be a certificate or anasymmetric key that is located in the Master database.Listing 6-6 shows the exact command used for the HomeLending database'sdatabase encryption key.136

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!