June 17, 2008 at 4:38 am
Hello, I just want to know :
can I encrypt ntext and nvarchar(max) columns in SQL 2005, using AES 128 ?
June 17, 2008 at 11:00 pm
The symmetric key encryption functions max out at 8,000 bytes returned. With SQL Server metadata and AES block size this means you can encrypt slightly less bytes than that in one shot. About 7,950+ bytes or so. You can encrypt in groups of 7,950 bytes and append all of the groups together. Then you'll also need a routine to decrypt the blocks and append the results of decryption together to reassemble your source document.
June 18, 2008 at 12:08 am
Thanks,
but are there any Web sites or documents which tell me how to append the encrypted data chunk together ?
June 18, 2008 at 8:31 am
The encryption and decryption functions return a varbinary(8000). Just use the + append operator and a WHILE loop. There are a few blogs worth checking out, especially the first one - it has an LOB encryption/decryption example:
http://blogs.msdn.com/yukondoit/archive/2005/11/24/496521.aspx
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply