vb.net连接实体框架连接字符串安全
我了解在 .net v4 中加密连接字符串的可能性。我有一个 win 表单应用程序,可供多个人在不同的机器上使用。我知道我需要在应用程序首次在目标计算机上运行时保护连接字符串。但是我担心在一段时间内我的连接字符串将未加密。我正在寻求有关如何使用已加密或在安装过程中加密的连接字符串来部署我的应用程序的建议。
其他人会如何以安全的方式加密连接字符串?
非常感谢任何帮助。
I understand the possibilities for encrypting a connection string in .net v4. I have a win forms application that will be used by multiple people on different machines. I understand that I need to protect the connection string at time of the app being first run on the target machine. However I am concerned that for a period of time my connection string will be unencrypted. I am looking for advice in how to deploy my app with the connection string already encrypted or encrypted during installation.
How would anyone else go about encrypting the connection string in a secure way?
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以获取 connectionString 配置部分并修改它,如下所示:
VB.NET 中的示例:
您可以在应用程序安装过程中使用此代码(以检查,配置是否受到保护),您可以在每次运行应用程序期间进行检查。
更新:
关于评论中的问题 - 您可以使用空连接字符串分发应用程序,并在安装过程中设置此属性(在这种情况下不要忘记代码混淆)并保存配置文件。
You can get your connectionString config section and modify it, like that:
Example in VB.NET:
You can use this code during the installation for your application (to check, is the config protected) and you can check every time during runnig your application.
UPDATE:
About your question from comments - you can distribute your application with empty connection string, and during your install, set this property (do not forget about code obfuscation in this case) and save your config file.