我试图以加密格式保存数据库表中的数据,以隐藏数据库表中的数据存储以供用户读取
我是如何在应用程序级别上花费大量精力并在应用程序端减少开销的情况下做到这一点的?
答案 0 :(得分:1)
阅读此MS SQL Server Encryption Hierarchy
例如:
-- Open the symmetric key with which to encrypt the data.
OPEN SYMMETRIC KEY SSN_Key_01
DECRYPTION BY CERTIFICATE HumanResources037;
-- Encrypt the value in column NationalIDNumber with symmetric key
-- SSN_Key_01. Save the result in column EncryptedNationalIDNumber.
UPDATE HumanResources.Employee
SET EncryptedNationalIDNumber
= EncryptByKey(Key_GUID('SSN_Key_01'), NationalIDNumber);