如何在Windows应用程序中安全地存储连接字符串? [英] How do I securely store my connection string in a windows application?

查看:86
本文介绍了如何在Windows应用程序中安全地存储连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



首先,我想为我糟糕的英语和问题本身说抱歉。(因为它被问了一百万次)

我已经阅读了很多关于连接字符串加密/存储的网页。

有人说你应该将你的连接字符串存储在你的app.config文件中。(加密的话)

可悲的是,这对我来说是不可能的,因为我希望能够在不同的Windows机器上使用该程序。(所以其他人也可以使用我的程序)



所以我的问题可能是一个非常难以回答的问题。

但是有没有办法加密你的连接字符串或将它存储在某个地方或者方法可能是什么。

所以我可以放心地假设我的连接字符串足够安全。所以我可以通过互联网传播该计划。无需担心有人试图从我的程序中获取连接字符串。



我正在使用带有mysql.data.mysqlclient dll文件的Visual Studio 2013 for Desktop。

连接字符串包含一个ip地址,用户名,密码,证书文件等。

它是Linux服务器上的外部MySQL数据库。不是.mdf文件



我真的希望有人可以帮我这个。

解决方案

在某处创建中央Web服务,并将其发送到加密的应用程序(使用非对称加密)。



但我担心这对你没有多大帮助,因为如果有人使用调试器,他可以很容易地从内存中获取解密密钥。





看看这个命名空间System.Configuration.SectionInformation.ProtectSection和Hameer Salem关于 CodeProject上

Hello,

First I want to say sorry for my bad English and the question itself.(because it has been asked a million times)
I've read a lot of webpages about connection string encryption/storing.
Some say you should store your connection string in your app.config file.(encrypted ofcourse)
Sadly, this is not possible for me because I want to be able to use the program on different windows machines.(so other people can use my program too)

So my question is probably a very hard question to answer.
But is there a way to encrypt your connection string or store it somewhere or what for method it may be.
So I can safely assume that my connection string is "safe enough". So I can spread the program across the internet. Without having to worry about someone trying to get my connection string out of my program.

I'm using Visual Studio 2013 for Desktop with the mysql.data.mysqlclient dll file.
The connection string contains a ip address, username, password, certfile, etc.
Its a external MySQL database on a linux server. not a .mdf file

I really hope someone could help me with this.

解决方案

Create somewhere a central web service and and send it to the application encrypted (use asymmetric encryption).

But I'm afraid it will not help you much because if someone uses a debugger he could easy grab the decrypted key from memory.


Take a look at this namespace "System.Configuration.SectionInformation.ProtectSection" and Hameer Salem's article on codeproject.


这篇关于如何在Windows应用程序中安全地存储连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆