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.
有没有办法在从使用DES通过.NET加密的SQL Server(2005/2008)数据库中查询数据时解密列?如果是这样,怎么样?我有密钥,但不知道如何在sql server查询的上下文中使用它。
1 个解决方案
#1
3
I would probably consider creating a CLR function in SQL Server to handle this decryption.
我可能会考虑在SQL Server中创建一个CLR函数来处理这个解密。
You can use this function just like any other UDF within SQL Server to decrypt on demand.
您可以像使用SQL Server中的任何其他UDF一样使用此功能来按需解密。
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.
这样,它就像使用常规.NET C#代码一样简单,就像在应用程序本身中那样处理它。
#1
3
I would probably consider creating a CLR function in SQL Server to handle this decryption.
我可能会考虑在SQL Server中创建一个CLR函数来处理这个解密。
You can use this function just like any other UDF within SQL Server to decrypt on demand.
您可以像使用SQL Server中的任何其他UDF一样使用此功能来按需解密。
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.
这样,它就像使用常规.NET C#代码一样简单,就像在应用程序本身中那样处理它。