winforms – 如何在Windows窗体应用程序中隐藏连接字符串

你们知道exe文件中的硬编码编码很容易通过一些软件(例如代码反射器)看到,我想知道我是如何隐藏我的连接字符串,其中包含sql server用户名和密码的信息以连接到windows中的数据库通过任何代码反射器看到应用程序,以便除我之外的任何其他人可能永远无法在未经我许可的情况下使用我的应用程序.
如评论所述,您最好使用集成安全性,但如果您使用混合模式身份验证定位SQL Server,则可以使用Data Protection API加密app.config中的连接字符串.这是一篇关于这个主题的精彩文章:

Protecting application secrets,such as database connection strings
and passwords,requires careful consideration of a number of pertinent
factors such as how sensitive the data is,who could gain access to
it,how to balance security,performance,and maintainability,and so
forth. This article explains the fundamentals of data protection and
compares a variety of techniques that can be used to protect
application settings. The author discusses what to avoid,such as
hiding keys in source code and the use of Local Security Authority. In
addition,he presents some effective solutions such as the Data
Protection API.

Safeguard Database Connection Strings and Other Sensitive Settings in Your Code

How To: Use DPAPI to Encrypt and Decrypt Data (C#/VB.NET)

相关文章

文章浏览阅读2.2k次,点赞6次,收藏20次。在我们平时办公工作...
文章浏览阅读1k次。解决 Windows make command not found 和...
文章浏览阅读3.2k次,点赞2次,收藏6次。2、鼠标依次点击“计...
文章浏览阅读1.3w次。蓝光版属于高清版的一种。BD英文全名是...
文章浏览阅读974次,点赞7次,收藏8次。提供了更强大的功能,...
文章浏览阅读1.4w次,点赞5次,收藏22次。如果使用iterator的...