SQL based encryption performance

倖福魔咒の 提交于 2019-12-06 09:14:49

You have only two options: AES and 3DES. Simple DES and XDES are too weak (56 and 112 bit strength respectively). RC4 is not an option because the SQL Server implementaion is busted (does no properly salt encrypted values).

3DES is clinging to the past. Use AES, is the current NIST recommended algorithm and offers you a decent speed.

For your choice of encryption algorithm, there isn't really a one size fits all choice (see the link below for advice from Microsoft about the algorithms available in SQL Server).

http://msdn.microsoft.com/en-us/library/ms345262.aspx

As for backing up and restoring your encryption keys:

--Backup the master key   
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'Som3Rand0m!3y?na';
BACKUP MASTER KEY TO FILE = 'c:\temp\exportedmasterkey' 
ENCRYPTION BY PASSWORD = 's0me0th3rp4$$w0rd';
GO 
--Back up the certificate
BACKUP CERTIFICATE someCert TO FILE = 'c:\temp\someCert.cer'
GO

Then, on your other server

RESTORE MASTER KEY FROM FILE = 'c:\temp\exportedmasterkey' 
    DECRYPTION BY PASSWORD = 's0me0th3rp4$$w0rd'
    ENCRYPTION BY PASSWORD = 'Som3Rand0m!3y?na'
GO

CREATE CERTIFICATE someCert
    FROM FILE = 'c:\temp\someCert.cer'
GO
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!