开发者

Implementing some cryptography algorithms on sql server

Can we write 开发者_运维问答a user defined function to encrypt a string of text based on a key in sql server 2000? For e.g. I want to try writing a triple DES algorithm to encrypt text. How to write statements for this? I checked around the internet; I can't understand the language of cryptography to begin with...


Consider upgrading to SQL Server 2005 or higher, which includes numerous encryption functions. They make it easy:

  1. Create a certificate to manage your key (CREATE CERTIFICATE)
  2. Create an encryption key from a password (CREATE SYMMETRIC KEY)
  3. Write encrypted data to table (ENCRYPTBYKEY())
  4. Read decrypted data from table (DECRYPTBYKEY())

dotnetslackers.com has an easy-to-read howto on the basics.

If you absolutely must stick with SQL Server 2000, you should strongly consider a third-party package for encryption, as writing 3DES from scratch is no small task. Application Security used to put out a product called 'DbEncrypt', but I don't know if it's still available.


I just found this article --> http://www.sqlservercentral.com/articles/Security/freeencryption/1980/. Seems you can do this via extended stored procedures. There are some 3rd party dlls which allow you to do this. There is a link to download the dlls (zipped) from the site. You have to add this to your sql server's binn folder, and call some scripts to add it to the extended stored procedures list. I not sure if this will work for sql server which runs of 64-bit machines.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜