gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 05:39:21 25 4
gpt4 key购买 nike

你们知道exe文件中的硬编码可以通过一些软件(例如代码反射器)很容易地看到,我想知道我是否可以隐藏我的连接字符串,其中包含sql server用户名和密码的信息以连接到windows中的数据库通过任何代码反射器查看表单应用程序,以便除我之外的任何其他人在未经我许可的情况下永远无法使用我的应用程序。

最佳答案

正如所评论的,您最好使用集成安全性,但是如果您的目标是使用混合模式身份验证的 SQL Server,您可以使用数据保护 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)

关于winforms - 如何在 Windows 窗体应用程序中隐藏连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11460903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com