简体   繁体   English

如何在Sql Server 2005中进行加密和解密

[英]How to do Encryption and Decryption in Sql Server 2005

I want to encrypt and decrypt data with sql server using RSA or SHA algorithm rahter than doing it at UI. 我想使用RSA或SHA算法使用SQL Server加密和解密数据,而不是在UI上进行加密和解密。

Is it possible to do this. 是否有可能做到这一点。

Some Code Snippet will be a great help 一些代码片段将有很大的帮助

if u need to encrpt only a string (Can't Decrypt these are One way) 如果您只需要加密一个字符串(无法解密,这是一种方法)

u may try 你可以尝试

HashBytes ('<algorithm>', { @input | 'input' } )<algorithm>::= MD2 | MD4 | MD5 | SHA | SHA1

ref : http://technet.microsoft.com/en-us/library/ms174415.aspx 参考: http : //technet.microsoft.com/zh-cn/library/ms174415.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM