加密多个服务器的web.config数据 [英] encrypting web.config data for multiple servers

查看:61
本文介绍了加密多个服务器的web.config数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为客户端加密我的web.config文件的各个部分.我见过的大多数参考文献都是使用aspnet_regiis进行加密的.但是,据我所知,这需要在托管站点的Web服务器上进行,这意味着每个服务器的加密值都不同.我无权访问此客户端的服务器.我找到了一种通行参考,其中提到了以可在服务器之间移植的方式加密web.config数据的可能性,但是没有找到任何更详细的信息.有人知道该怎么做吗?

I need to encrypt sections of my web.config file for a client. Most of the references I've seen are to using aspnet_regiis to do the encryption. However, as far as I can see, this needs to happen on the web server which will host the site, which means the encrypted values will be different for each server. I don't have access to this client's servers. I found a passing reference to the possibility of encryping the web.config data in a way that is portable across servers, but haven't found any more detailed information. Does anyone know how to do this?

推荐答案

您需要对其进行加密

you need to encrypt it using RSA because with the RSAProtectedConfigurationProvider you could copy your key across server.

网络农场方案
您可以在Web服务器场中使用RSA加密,因为可以导出RSA密钥.如果在将Web.config文件中的数据加密到Web场中的其他服务器之前对其进行加密,则需要执行此操作.在这种情况下,必须将解密数据所需的私钥导出并部署到其他服务器.

Web Farm Scenarios
You can use RSA encryption in Web farms, because you can export RSA keys. You need to do this if you encrypt data in a Web.config file prior to deploying it to other servers in a Web farm. In this case, the private key required to decrypt the data must be exported and deployed to the other servers.

使用RSA提供程序对Web场中Web.config中的连接字符串进行加密

为此,您必须创建一个自定义RSA加密密钥容器并将相同的密钥容器部署在您的Web场中的所有服务器上.默认情况下,此方法不起作用,因为默认的RSA加密密钥每台计算机的"NetFrameworkConfigurationKey"都不同.

To do this, you must create a custom RSA encryption key container and deploy the same key container on all servers in your Web farm. This won't work by default because the default RSA encryption key, "NetFrameworkConfigurationKey", is different for each computer.

因此,请点击上面链接的"Web场方案"部分,然后按照步骤进行操作.

So, scrool down to the "Web Farm Scenarios" section of the above link and follow the steps.

这篇关于加密多个服务器的web.config数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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