Server Master Key

MSSQL-Feature-Image

Server Master Key
It is used to encrypt DMK.
It is created when we install MS SQL.
It is protected by AES algorithm with 256 length.
Single SMK defined for each instance of SQL Server.

Show current SMK

Backup SMK
Backup SMK named as SMK.dat at SQL Server’s C:\SMK\ with password ‘P@ssw0rd’

Restore SMK
When we restore SMK, SQL Server will decrypt all key and then use the restored SMK to encrypt all key again.
If the decryption fail, the restored will fail.
We use force restore but it will cause loss of data.

Regenerate of SMK.
When we regenerate SMK, SQL Server will decrypt all key and then use the restored SMK to encrypt all key again.
If the decryption fail, the regenerate will fail.
We use force regenerate but it will cause loss of data.

Author: Joe Chan

1 thought on “Server Master Key

Comments are closed.