Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - 70-551, 70-552, 70-553 Section I, Part X - Cryptography
Phil Denoncourt's Technology Rants
 
 Wednesday, February 08, 2006
Encrypt, decrypt, and hash data by using the System.Security.Cryptography classes. (Refer System.Security.Cryptography namespace)
  • DES class and DESCryptoServiceProvider class
  • HashAlgorithm class
  • DSA class and DSACryptoServiceProvider class
  • SHA1 class and SHA1CryptoServiceProvider class
  • TripleDES and TripleDESCryptoServiceProvider class
  • MD5 class and MD5CryptoServiceProvider class
  • RSA class and RSACryptoServiceProvider class
  • RandomNumberGenerator class
  • CryptoStream class
  • CryptoConfig class
  • RC2 class and RC2CryptoServiceProvider class
  • AssymetricAlgorithm class
  • ProtectedData class and ProtectedMemory class
  • RijndaelManaged class and RijndaelManagedTransform class
  • CspParameters class
  • CryptoAPITransform class
  • Hash-based Message Authentication Code (HMAC)

Knowing some basics about Cryptography is a big help with this objective.  Dino Esposito has an article on DevX going over the basics. It's based on 1.1, but the ideas haven't changed.

For the most part this namespace hasn't changed.  ProtectedData/Memory and HMAC are the new classes they want you to know about.

DES class - Abtract class that all (one) DES implementations derive from.  DES is a symmetric encryption algorithm.  It's an old algorithm that can be cracked in a matter of days.

DESCryptoServiceProvider class - Service provider class for DES encryption.  Derives from DES and is the class you'd use when encrypting/decrypting with DES.

HashAlgorithm class - base class that all hash algorithms derive from.  MSDN has an example implementation showing that you invoke the ComputeHash method to get the hash.

DSA class - base class that all (one) DSA implentations derive from.  Richard Grimes has a blurb about digital signatures on his security workshop page.

DSACryptoServiceProvider class - provides an implementation of the DSA (Digital Signature Algorithm) .

SHA1 class - Abtract class for the SHA1 Hash algorithm.  160 bit hash size.

SHA1CryptoServiceProvider class - Implementation of the SHA1 hash algorithm.  There's some concern that this algorithm is weak, so it's probably best to use a different hashing algorithm.

TripleDES class - Abtract class for the TripleDES encryption algorithm.  TripleDES is a symmetric algorithm support key sizes of 128 or 192 bits.

TripleDESCryptoServiceProvider class - Implementation of the TripleDES encryption algorithm, which appears to encrypt the text by running DES 3 times.

MD5 class - Abtract class that all MD5 hash algorithms derive from.  MD5 produces a 128 bit hash.

MD5CryptoServiceProvider class - Implementation of the MD5 Hash Algorithm.  It appears there might be weaknesses with this algorithm as well.

RSA class - Abtract class that all RSA encryption algorithms derive from.  RSA is an asymmetric algorithm supporting bit sizes between  384 - 16384 bits in increments of 8 bits.

RSACryptoServiceProvider class - Implementation of the RSA Encryption algorithm.  There don't appear to be flaws in the RSA algorithm provided your key is >2k.

RandomNumberGenerator class - Abtract class that all Random Number generators are supposed to derive from.  There is only one implementation of a random number generator - RNGCryptoServiceProviderChristopher Wille has an example that creates random passwords using the RNGCryptoServiceProvider.

CryptoStream class - defines a stream that is used with cryptographic functions.  The idea is to prevent storing the data in an intermediate area during cryptographic functions.  It also handles buffering which I guess gets complicated with block ciphers.

CryptoConfig class - Documentation says that it is used to get cryptography configuration information.  I don't see it doing that.  It appears that the main method, CreateFromName, is used to get an instance of a specific CryptoServiceProvider.  There is mention of the CryptoConfig being used in this best practices in Mono document.

RC2 class - Abtract class that all RC2 implementations derive from.  RC2 is an Symmetric Encryption algorithm.

RC2CryptoServiceProvider class - Implementation of the RC2 Encryption algorithm.  Key size is from 40-128 bits in 8 bit increments. 

AssymmetricAlgorithm class - base class for all encryption methods that are classified as Assymmetric (meaning public key algorithms)  Dr. Peter Bromberg has a simple example of using the RSA classes.

ProtectedData class  - This is a new class for the 2.0 framework.  It is a frontend to the DPAPI protect and unprotect methods, making it very easy to secure data using DPAPI.  Remember that stuff protected by DPAPI can only be unprotected on the same machine.

ProtectedMemory class - Also a new class for the 2.0 framework.  It works the same as ProtectedData.  The difference is that ProtectedMemory is only valid until the machine reboots.  Shawn has an informative post on his blog.

RijndaelManaged class - A managed implementation of the Rijndael encryption algorithm, also known as AES.  Rijndael is a symmetric algorithm supporting key sizes of 128,192, and 256 bits. 

RijndaelManagedTransform class - the actual class that does the encryption/descryption for the RijndaelManaged class.

CspParameters class - contains parameters that are passed to the CSP (Cryptographic Service Provider).  This is used to pass specific parameters back to the Crypto subsystem.  An example is specifying which key container to use.  Gowri Paramasivm has an example using RSA.

CryptoAPITransform class - Represents a cryptographic algorithm that encrypts or decrypts data.

HMAC (Hash-based Message Authentication Code) - Abstract class that all implementations of HMAC derive from.  HMAC is a way of verifying the authenticity and integrity of a message.  These are new classes.

Next up -> Permissions

Wednesday, February 08, 2006 8:04:13 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Comments are closed.
Copyright © 2010 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: