Recently I got a requirement to perform the backup of SQL Server database and provide confirmation that backup is encrypted.
There are two ways through which database backup be encrypted.
- If TDE is enabled on the database, database backup gets automatically encrypted through TDE encryption key and database cannot be restored through backup file without database encryption key. https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption?view=sql-server-ver16
- Through database backup encryption. https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/backup-encryption?view=sql-server-ver16
If you do not know if a backup file is encrypted or not, you can follow steps to confirm the same.
- By executing “RESTORE FILELISTONLY” , you will get a second last column named as ‘TDEThumbprint’ . If this column is not null for the data files, backup is encrypted by TDE.
- If backup file is not encrypted by TDE, it may be encrypted by backup encryption. This can be confirmed using “RESTORE HEADERONLY” command against backup file. It will have a non-null value against third last column ‘EncryptorThumbprint’.
Hope this helps !!
Happy learning!!