SQL Server Development Bookmark and Share   
 index > SQL Server Security > Backing up DPAPI keys in relation to SQL Server
 

Backing up DPAPI keys in relation to SQL Server

Hi,

There alot of talk about Service Master and DB Master keys and the importance of backing them up seperately.

What about the DPAPI keys used to protect the Service Master keys. What procedures to I take to back those up during my database backup.

If I understand correctly, if I do a backup on one machine, and then try to restore in a different machine, I won't be able to decrypt databecuase the DPAPI keys don't "match".

This is assumming I don't use a password to protect my DB Master keys, I just rely on the service master to protect them.

Thanks for any help,

Andrew Law  Thursday, September 13, 2007 9:24 PM

Database master keys(DbMK) are always protected by a password - you have no choice about that.

If you backup the service master key(SMK), there is no need to be concerned about DPAPI - those keys are managed by the OS and the database automatically uses them to encrypt a loaded SMK.

When you do a database backup, you actually don't need to backup anything else than the database - you just have to remember the database master key password. You don't need the SMK or the DPAPI keys to be able to restore the database.

Thanks

Laurentiu

Laurentiu Cristofor  Friday, September 14, 2007 1:42 AM

Database master keys(DbMK) are always protected by a password - you have no choice about that.

If you backup the service master key(SMK), there is no need to be concerned about DPAPI - those keys are managed by the OS and the database automatically uses them to encrypt a loaded SMK.

When you do a database backup, you actually don't need to backup anything else than the database - you just have to remember the database master key password. You don't need the SMK or the DPAPI keys to be able to restore the database.

Thanks

Laurentiu

Laurentiu Cristofor  Friday, September 14, 2007 1:42 AM

Thanks,

I understand that I can restore the database without the SMK or DPAPI keys, but I'm surprised that I will be able decrypt data without them. I thought this was the whole purpose of the encryption heirarchy.

If I can indeed restore a database, and see the decrypted data with just the DbMK, then why do I need the DPAPI and SMK?

I thought they were in place to add additional "seperation of duties" for keys - so if someone stole a database backup tape, they wouldn't be able to restore the tape on a 'bad guy' server, and seeby encrypted data- because they didn't have the SMK and DPAPI key.

Thanks for your help!

Andrew Law  Wednesday, September 19, 2007 1:14 AM

You can use google to search for other answers

Custom Search

More Threads

• Addition of Windows login takes pre windows name instead of RDN name in SQL Server 2005
• Applicationrole questions.
• Login Failures to SQL Server 2005
• Hiding paswword that are use dfor encryption
• permission problem running sproc using asp.net 2.0 on sql server 2005
• symmetric encryption by asymmetric keys
• Deny an Application?
• SQL Server 2000 Server: Msg 18456, Level 14, State 1, Line 1 Login failed for user 'sa'.
• Setting up DotNetNuke am getting 18456 login failure
• sys.dm_os_performance_counters returns zero rows