C# 加密app.config的部分

C# 加密app.config的部分,c#,C#,我有这个app.config文件: <?xml version="1.0"?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService"> <secur

我有这个app.config文件:

<?xml version="1.0"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IService">
                    <security>
                        <message clientCredentialType="UserName" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="myServiceAddress"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
                contract="ServiceReference1.IService" name="WSHttpBinding_IService">
                <identity>
                    <certificate encodedValue="LARGE VALUE" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

我如何加密
system.servicemodel
部分,以便没有人能看到我的端点或我的服务接口的名称?我已经尝试过这个解决方案,但是当我将
sectionName
参数设置为
configuration
时,它似乎不起作用


还有其他方法吗?

如果您认为需要隐藏端点,那么您的web服务就错了。实现身份验证,因为任何有权访问其运行的服务器或网络的人都可以监控流量并找出端点和正在交换的消息。我必须同意@CodeCaster的观点。但是,如果你确实发现需要加密而不是通过模糊处理来实现安全性,这是我在上面找到的最好的博客文章。如果可能的话,我想从app.config文件的第一部分开始加密,
config
部分。但是
ConfigurationSection=config.GetSection(sectionName)sectionName=config