加密的配置文件进行部署 [英] Encrypting config files for deployment
问题描述
我有一个窗口服务,它读取app.config中。
I have a windows service that reads from app.config.
我想一些设置进行加密,但是,我不希望使用.NET提供的ProtectedConfigurationProvider类,因为他们根据他们使用DPAPI运行的机器上的文件加密。
I want some settings to be encrypted, however, I don't want to use the ProtectedConfigurationProvider classes provided in .NET because they encrypt files based on the machine they are running on using DPAPI.
我想要的是一种方式,我们的管理员部署已经加密到多台机器的配置文件,有需要时每台机器解密。
What I wanted was a way for our administrator to deploy the config file already encrypted to many machines and have each machine decrypt them when needed.
我不想硬codeA密码进入组装要么,所以我不知道我怎么能去了解这一点。
I don't want to hardcode a password into the assembly either so I'm not sure how I can go about this.
推荐答案
问题缩小到最简单的形式:
reduce the problem to its simplest form:
- 您有一个程序
- 将给出一个加密的文件
- ,并要解密文件
- 在没有硬编码的关键
显而易见的解决方案是从一个可信的第三方必要时索要的关键
the obvious solution is to ask for the key when needed from a trusted third party
这篇关于加密的配置文件进行部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!