Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Encryption of long text

Author  Topic 

WindChaser
Posting Yak Master

225 Posts

Posted - 2013-03-18 : 11:22:55
Hi folks,

I'm looking for a bit of advice. I've got a field that contains some pretty long text entries that I would like to encrypt. The problem is that SQL Server functions such as EncryptByPassPhrase can only provide encrypted output of no longer than 8000 bytes, which would yield truncated outputs and corrupted data. Are there any world-class methods of encrypting text document data out there that anyone knows of? Thanks!!!

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-03-18 : 13:42:25
If you want to go over 8000 characters I think you need to go to a CLR sproc/function.

Here is a sample of how to do it:
http://blog.waldenl.com/2009/12/computing-md5-hash-of-varbinarymax-in.html
http://sqlblog.com/blogs/michael_coles/archive/2009/04/08/let-s-encrypt-a-blob.aspx
Go to Top of Page
   

- Advertisement -