加密winforms没有机器特定加密的app.config连接字符串 [英] encrypt winforms app.config connection string without machine specific encryption

查看:179
本文介绍了加密winforms没有机器特定加密的app.config连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个winform应用程序.net框架4.0。



我在app.config中有连接字符串。我需要加密如果我使用DataProtectionConfigurationProvider,那么这将是机器特定的。
在一台机器上完成的加密不能在其他机器上使用。所以如果我有100台机器,那么加密将在每个机器上完成100次。



我必须在100台机器上部署这个应用程序。



如果我加密它,然后在所有其他机器上使用它是有办法。



任何帮助将不胜感激。

解决方案

创建您自己的加密/解密函数。存储加密并在创建SQLConnection时从应用程序调用解密



有很多示例可以这样做。



加密示例


I am working on a win form application .net framework 4.0.

I have got connection string in app.config. I need to encrypt it. If I use "DataProtectionConfigurationProvider" then this will be machine specific. Encryption done on one machine cannot be used on other machine. So if I have 100 machine then encryption will be done 100 times on every machine.

I have to deploy this application on 100 machines.

Is there is way if I encrypt it and then use it on all other machines.

Any help will be appreciated.

解决方案

Create your own Encrypt/Decrypt functions. Store it encrypted and call decrypt from your application when creating the SQLConnection

There are plenty of examples to do so.

Crypto Examples

这篇关于加密winforms没有机器特定加密的app.config连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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