加密在.NET /解密在SQL ServerNET、SQL、Server

2023-09-04 04:51:56 作者:第一眼带感-

有没有办法从SQL Server查询数据时,一列来解密已经通过.NET使用DES加密(2005/2008)数据库?如果是这样,怎么样?我有钥匙,但不知道如何在SQL Server查询的上下文中使用它。

Is there a way to decrypt a column when querying data from a SQL Server (2005/2008) database that has been encrypted using DES via .NET? If so, how? I have the key, but don't know how to use it within the context of a sql server query.

推荐答案

我可能会考虑的在SQL Server中创建CLR函数来处理这个解密。

I would probably consider creating a CLR function in SQL Server to handle this decryption.

您可以使用此功能,就像任何其他的UDF SQL Server中解密需求。

You can use this function just like any other UDF within SQL Server to decrypt on demand.

这样的话,它的简单,只要使用普通的.NET C#code来处理它正是你会做你的应用程序本身的方式。

That way, its as simple as using regular .NET C# code to handle it exactly the way you would do it in your application itself.