Create a Stored Procedure for AES Encryption in MS SQL Server 2008
问题 I have an SQL Server 2008 table with a structure similar to the following: ID int PRIMARY KEY IDENTITY(1,1) Name nvarchar(100) LongText ntext What I am trying to achieve is simple. Before inserting data inside this table, I want to encrypt the LongText using AES_192 algorithm. I am using the following SP to encrypt data: create proc sp_Encrypt_LongText @rawText ntext = null, @encryptedText nvarchar(max) output as begin OPEN SYMMETRIC KEY Encryption_Symmetric_Key DECRYPTION BY CERTIFICATE