Configure CipherMode for TripleDES

Topics: Cryptography Application Block
Mar 24, 2009 at 10:05 PM
Is it possible to specify the CipherMode in the config file for a TripleDES provider?

Here is what I have in config:
  <securityCryptographyConfiguration>
    <symmetricCryptoProviders>
      <add algorithmType="System.Security.Cryptography.TripleDESCryptoServiceProvider, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        protectedKeyFilename="C:\test.key"
        protectedKeyProtectionScope="LocalMachine" type="Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.SymmetricAlgorithmProvider, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="TestProvider" />
    </symmetricCryptoProviders>
  </securityCryptographyConfiguration>

Here is how I would like to use it:
Cryptographer.DecryptSymmetric("TestProvider", token);

But, I can't seem to configure the CipherMode.

Thanks,
Joe
Mar 25, 2009 at 6:59 AM

Hi,

Looking at the source code you cannot specify CipherMode on the Config file because it’s not supported on the current Ent Lib version. But maybe you could modify the source code to fit your need. J
Mar 25, 2009 at 7:05 AM
Yes. You can modify the source code to support the CipherMode in the config and just rebuild it.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com