【发布时间】:2016-05-11 03:21:44
【问题描述】:
在我的 Windows 服务中,我需要能够检索存储在同一网络上的 SQL Server 2012 数据库中的第三方 REST API 的凭据。我的每个客户都可能分配有不同的 API 凭证。例如:
Customer Name | API ID | API Password In Plain Text
-----------------------------------------------------
Customer 1 1234 somepassword
Customer 2 1234 somepassword
Customer 3 5678 anotherpassword
在此服务的第一次迭代中,所有客户都使用相同的 API 凭据,并在 Windows 服务的 app.config 中使用 SectionInformation.ProtectSection 对其进行加密。
我是否只使用 .NET 框架提供的一种加密/解密方法并将该值存储在数据库中?例如,此处提供的解决方案之一:Encrypting & Decrypting a String in C#?我可以考虑任何建议或其他解决方案吗?
【问题讨论】:
-
也许看看使用 MS ProtectedData 类 - msdn.microsoft.com/en-us/library/…
-
要存储密码,请使用 PBKDF2 之类的东西。
标签: c# sql-server cryptography