.net – 从TripleDES更改Microsoft配置文件加密方法

加密(“保护”)Microsoft配置部分时,您会看到类似于下面的XML的内容.它遵循(至少部分)XML加密的W3规范.

但是,在下面的XML中,您将看到EncryptedData部分下的EncryptionMethod是“tripledes-cbc”.我们希望能够将其更改为更安全的替代方案,特别是AES,这也是前面提到的W3规范中规定的.

在与微软支持工程师的许多电话会议中,他们无法理解这个问题,更不用说回答它了.有没有办法改变这种加密方法?

我之前忘了提到我们当前设置为RsaProtectedConfigurationProvider,但只有密钥似乎是用RSA加密的,而数据是用3DES加密的.

<MiscCryptoData configProtectionProvider="someConfigProtectionProvider">
  <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
      <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
        <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
          <KeyName>Rsa Key</KeyName>
        </KeyInfo>
        <CipherData>
          <CipherValue>asf78ag78asg\...cryptoyadayada...asdf8r=</CipherValue>
        </CipherData>
      </EncryptedKey>
    </KeyInfo>
    <CipherData>
      <CipherValue>zxcv6asdf35...largercryptoyadayada...u7i8o9p=</CipherValue>
    </CipherData>
  </EncryptedData>
</MiscCryptoData>
我刚刚用反射器检查了 RsaProtectedConfigurationProvider,我发现没有什么可以做的,可以将tripledes-cbc更改为其他任何东西.

因此,如果要使用AES加密,则必须编写自己的ProtectedConfigurationProvider.您可能希望使用Reflector为您提供良好的开端.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...