views:

57

answers:

2

All I can make out is that one of them is the BC for all 'DES' algorithms to be derived from and the later is a wrapper for the Cryptographic service provider implementation of the DES algorithm.

The reason why I ask is that I am going over .Net Security and the MS official training book simply refers to the DES class but the another official MS book refers to the DESCrypto' class. What's the difference between these two? When would you use either of them? What do I need to know as far as the 70-536 exam is concerned.

I am asking my question from an educational P.O.V as far as the 70-536 exam is concerned.

UPdate:

Someone wanna shed some light on the IV property?

Thanks In Advance.

Ibrar

+3  A: 

Yes, the DES class is an abstract base class, DESCryptoServiceProvider is a concrete implementation for it. The inheritance chain is a bit boring, it is the only one.

Most cryptography classes follow this pattern. It is documented as follows:

The .NET Framework security system implements an extensible pattern of derived class inheritance. The hierarchy is as follows:

  • Algorithm type class, such as SymmetricAlgorithm or HashAlgorithm. This level is abstract.
  • Algorithm class that inherits from an algorithm type class; for example, RC2 or SHA1. This level is abstract.
  • Implementation of an algorithm class that inherits from an algorithm class; for example, RC2CryptoServiceProvider or SHA1Managed. This level is fully implemented.

Using this pattern of derived classes, it is easy to add a new algorithm or a new implementation of an existing algorithm. For example, to create a new public-key algorithm, you would inherit from the AsymmetricAlgorithm class. To create a new implementation of a specific algorithm, you would create a nonabstract derived class of that algorithm.

Not so sure how often somebody actually adds a new public key algorithm.

Hans Passant
+1 correct, although I always found it bizarre myself, are there actually `DES` implementations floating around other than the `DESCryptoServiceProvider`?
Aaronaught
thanks for this, this really clears things up alot.
IbrarMumtaz
The pluggability allows for alternate implementations, including hardware accelerated versions.
GregS
+1  A: 

Just for clarification: algorithm classes ending in CryptoServiceProvider are offloading the work to the built-in Windows crypto libraries; and those ending in Managed are written in C#.

Michael Howard-MSFT